Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Problema con i test del HW4

F
FraPennacchietti (350 points)
1 6 7
in HW4 obbligatorio by (350 points)
Su spider il mio codice funziona bene ritornando la tupla richiesta. Quando però provo sul prompt a lanciare i test mi dà questo errore sulla prosodia:

FAILED test_01.py::Test::test_examples_00001_esempio - AssertionError: Lists differ: [0] != [0, 1, 1, 2, 0, 3, 4, 4, 5, 3]
FAILED test_01.py::Test::test_examples_00002_example - AssertionError: Lists differ: [0] != [0, 1, 1, 2, 1, 3, 4, 4, 5, 4]
FAILED test_01.py::Test::test_random_1024_00001_random_1024_rnd - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, [4859 chars] 601]
FAILED test_01.py::Test::test_random_102_00001_random_102_rnd - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 1[343 chars], 36]
FAILED test_01.py::Test::test_random_10_00001_random_10_rnd - AssertionError: Lists differ: [0] != [0, 0, 1, 0, 1, 2, 2, 3, 2, 3]
FAILED test_01.py::Test::test_random_1173_00001_random_1173_rnd - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 5, 6, 7, 7, 8, 5, 6, 2, 9, [5633 chars] 712]
FAILED test_01.py::Test::test_random_180_00001_random_180_ita - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 2, 4, 5, 6, 5, 7, 8, 1, 9, 10,[711 chars] 142]
FAILED test_01.py::Test::test_random_2048_00001_random_2048_rnd - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 0, 5, 6, 7, 8, 9, 10, 11, 1[10450 chars]1291]
FAILED test_01.py::Test::test_random_2592_00001_random_2592_rnd - AssertionError: Lists differ: [0] != [0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1[13886 chars]1791]
FAILED test_01.py::Test::test_random_270_00001_random_270_eng - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 2, 4, 5, 6, 5, 1, 7, 8, 9, 10,[1142 chars], 78]
FAILED test_01.py::Test::test_random_2754_00001_random_2754_eng - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 5, 3, 6, 7, 8, 9, 10, 5, 7,[14659 chars]1332]
FAILED test_01.py::Test::test_random_558_00001_random_558_eng - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 1, 10, 6,[2575 chars] 377]
FAILED test_01.py::Test::test_random_840_00001_random_840_ita - AssertionError: Lists differ: [0] != [0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 7, 9, 10, 11[3992 chars] 585]
304 views

3 Answers

CiZ (3810 points)
5 13 21
by (3.8k points)

Su Spyder intendi la console o nei test fatti su Spyder? 
Nel primo caso controlla i dati che hai inserito dopo if __name__ ecc.ecc..

Inoltre come avrai potuto vedere l'output che tu invii rimanda solo [0] quindi ci potrebbe essere solo un semplice errore di distrazione nel codice.
 

F
FraPennacchietti (350 points)
1 6 7
by (350 points)
Sulla console di spyder con if __name__ == "__main__":
    ex1(poem_filename del esempio iniziale) mi ritorna la tupla come quella del esempio.

Sui test nel prompt invece è come se mi prendesse solo il primo elemento della prosodia e quindi ovviamente dice che [0] != dalla prosodia che dovrebbe essere
L
LorenzoVise (100 points)
0 0 1
by (100 points)
potrebbe non c'entrare nulla ma è una cosa che ho fatto all'inizio quindi ci provo, non devi copiare i dati nell'ordine che li ha messi nell'esempio scritto perché sono in ordine sbagliato devi andare nei file json direttamente a vedere come li vuole lui se non è questo il caso non saprei
CiZ (3810 points)
5 13 21
by (3.8k points)

Sicuro tu stia aprendo il file esatto? Sicuro tu non sia in qualche directory sbagliata? Magari quella di un vecchio homework per questo avvia il test ma non va a buon fine. Se mandassi tutti i log potremmo capire molto meglio smiley 

EDIT: ho detto una stupidaggine, penso sia ovvio tu sia nella directory esatta, sennò non ti avrebbe startato nemmeno il test giusto ahaha

Romitoskj (8920 points)
5 8 40
by (8.9k points)
L'errore significa che lo schema prosodico che ritorna la funzione non è corretto rispetto ai singoli test. Non capisco come fa a funzionarti su spyder però...
O
Oakandrew (6400 points)
7 27 64
by (6.4k points)
probabilmente non hai salvato il file