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

Fix invalid type error when loading antimony model from file #2281

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/sdist/amici/antimony_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
is_file = False

if is_file:
status = ant.loadAntimonyFile(ant_model)
status = ant.loadAntimonyFile(str(ant_model))

Check warning on line 31 in python/sdist/amici/antimony_import.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/antimony_import.py#L31

Added line #L31 was not covered by tests
else:
status = ant.loadAntimonyString(ant_model)
if status < 0:
raise RuntimeError("Antimony model could not be loaded.")
raise RuntimeError(
f"Antimony model could not be loaded: {ant.getLastError()}"
)

if (main_module_name := ant.getMainModuleName()) is None:
raise AssertionError("There is no Antimony module.")
Expand Down