Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect and display error for duplicate reaction names (keys) - Issue #235 #241

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

carl-drews
Copy link
Collaborator

New function MusicBox.check_config() looks at loaded configuration for duplicate reaction names, which cause an array index error if allowed to pass into the solver. We supply diagnostic information so the user may correct the problem in JSON.

In the unit test, reaction rates are implemented as a python list, according to the same convention when loading from JSON. A possible improvement would be to make ReactionList iterable and use that Musica data structure instead.

src/acom_music_box/main.py Outdated Show resolved Hide resolved
tests/integration/test_duplicate_reactions.py Outdated Show resolved Hide resolved
tests/integration/test_duplicate_reactions.py Outdated Show resolved Hide resolved
tests/integration/test_duplicate_reactions.py Outdated Show resolved Hide resolved
tests/integration/test_duplicate_reactions.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate MUSICA name keys are not detected
2 participants