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 circular import in amici.petab_import_pysb #1922

Merged
merged 1 commit into from
Dec 29, 2022
Merged

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Dec 28, 2022

python -c "import amici.petab_import_pysb" failed with something like cannot import name 'PysbPetabProblem' from partially initialized module 'amici.petab_import_pysb' (most likely due to a circular import) (/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/amici/petab_import_pysb.py)

`python -c "import amici.petab_import_pysb"` failed with something like
`cannot import name 'PysbPetabProblem' from partially initialized module 'amici.petab_import_pysb' (most likely due to a circular import) (/opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/amici/petab_import_pysb.py)`
@codecov
Copy link

codecov bot commented Dec 28, 2022

Codecov Report

Merging #1922 (7567b2b) into develop (a4b50d1) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1922      +/-   ##
===========================================
+ Coverage    75.98%   76.10%   +0.11%     
===========================================
  Files           76       76              
  Lines        12965    12967       +2     
===========================================
+ Hits          9852     9869      +17     
+ Misses        3113     3098      -15     
Flag Coverage Δ
cpp 73.13% <ø> (+0.02%) ⬆️
petab 59.74% <100.00%> (+0.01%) ⬆️
python 69.35% <0.00%> (+0.25%) ⬆️
sbmlsuite ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/sdist/amici/petab_import_pysb.py 92.59% <100.00%> (+0.13%) ⬆️
src/sundials_matrix_wrapper.cpp 80.61% <0.00%> (+0.40%) ⬆️
python/sdist/amici/gradient_check.py 96.84% <0.00%> (+13.68%) ⬆️

@dweindl dweindl requested a review from FFroehlich December 28, 2022 17:49
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Member

@FFroehlich FFroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, how did that not pop up in tests?

@dweindl
Copy link
Member Author

dweindl commented Dec 29, 2022

huh, how did that not pop up in tests?

Depends on the import order. python -c "import amici.petab_import; import amici.petab_import_pysb" worked.

@dweindl dweindl merged commit c850d00 into develop Dec 29, 2022
@dweindl dweindl deleted the fix_circ_imp branch December 29, 2022 10:35
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.

2 participants