You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@SancyW reported a configuration to use which was failing in music box interactive. The configuration is listed below. The issue is that there were 6 reactions which were actually 3 reactions, each duplicated. Their musica names are
To see the incorrect behavior, download and unzip the configuraiton and run music_box -c configuration/my_config.json -o output.csv
Observe that there is a key index error.
Then, open up configuration/camp_data/reactions.json and find the duplicated reactions above. Delete one of each pair and rerun the configuration. You'll see that it passes.
We should alert when we find duplicate keys and let the user know and then exit
Acceptance criteria
All reactions with duplicate musica names are detected
Duplicate reactions are printed to the terminal and the error is explicitly listed with instructions on how to fix them
A unit test is added that successfully detects duplicate keys
Ideas
The text was updated successfully, but these errors were encountered:
2024-09-12 13:28:52 - DEBUG - main.main - Working directory = /home/drews/MusicBox/music-box-duplicate-keys-235/temp
2024-09-12 13:28:52 - DEBUG - main.main - Configuration file = configuration/my_config.json
Traceback (most recent call last):
File "/home/drews/.conda/envs/musicbox/bin/music_box", line 8, in
sys.exit(main())
^^^^^^
File "/home/drews/.conda/envs/musicbox/lib/python3.12/site-packages/acom_music_box/main.py", line 161, in main
result = myBox.solve(musicBoxOutputPath)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/drews/.conda/envs/musicbox/lib/python3.12/site-packages/acom_music_box/music_box.py", line 154, in solve
ordered_rate_constants = self.order_reaction_rates(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/drews/.conda/envs/musicbox/lib/python3.12/site-packages/acom_music_box/music_box.py", line 325, in order_reaction_rates
ordered_rate_constants[rate_constant_ordering[key]] = float(value)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: list assignment index out of range
@SancyW reported a configuration to use which was failing in music box interactive. The configuration is listed below. The issue is that there were 6 reactions which were actually 3 reactions, each duplicated. Their musica names are
configuration.zip
Reproduce
To see the incorrect behavior, download and unzip the configuraiton and run
music_box -c configuration/my_config.json -o output.csv
Observe that there is a key index error.
Then, open up
configuration/camp_data/reactions.json
and find the duplicated reactions above. Delete one of each pair and rerun the configuration. You'll see that it passes.We should alert when we find duplicate keys and let the user know and then exit
Acceptance criteria
Ideas
The text was updated successfully, but these errors were encountered: