Repository navigation
Quote nn.Module annotations so torch stays optional - #97
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
+ Coverage 96.09% 96.16% +0.07%
==========================================
Files 13 13
Lines 563 574 +11
==========================================
+ Hits 541 552 +11
Misses 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
dilpath
approved these changes
Nov 2, 2026
dilpath
left a comment
Member
There was a problem hiding this comment.
Should we rather just reintroduce from __future__ import annotations -- what was the reason for removing that? Both fine for me
9b60487 removed `from __future__ import annotations` from nn_model.py, so the nn.Module annotations are evaluated at import time. Without torch installed, `nn` is undefined and importing petab_sciml (and therefore petab.v2) fails with NameError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BSnelling
force-pushed
the
bes/restore-future-annotations
branch
from
November 2, 2026 11:56
8eec916 to
3c11f48
Compare
Collaborator
Author
|
Given that you don't know the reason for removing |
BSnelling
added a commit
to AMICI-dev/AMICI
that referenced
this pull request
Nov 2, 2026
petab_sciml 9d076fe dropped `from __future__ import annotations` from nn_model.py, so importing petab.v2 failed with NameError wherever torch was not installed. Pin to 76a2006 (PEtab-dev/petab_sciml#97), which restores it, and bring the docs requirements in line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9b60487 removed
from __future__ import annotationsfrom nn_model.py, so the nn.Module annotations are evaluated at import time. Without torch installed,nnis undefined and importing petab_sciml (and therefore petab.v2) fails with NameError. Restore the future import.This is in service of bumping the petab-sciml pin in AMICI, so we can avoid installing torch in more workflows: AMICI-dev/AMICI#3502