Skip to content

Add missing deps and fix device bug#72

Merged
aknierim merged 5 commits into
mainfrom
fix-deps-bug
Jun 24, 2026
Merged

Add missing deps and fix device bug#72
aknierim merged 5 commits into
mainfrom
fix-deps-bug

Conversation

@aknierim

Copy link
Copy Markdown
Member

Small PR to fix missing cartopy and mergedeep dependencies introduced in #50.
Also fixes Gridder.from_pyvisgen to ensure that vis_data is a numpy array when obtained from pyvisgen.

@aknierim aknierim requested a review from tgross03 June 24, 2026 09:28
@aknierim aknierim added the bug Something isn't working label Jun 24, 2026
@codecov-commenter

codecov-commenter commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.45%. Comparing base (c00a355) to head (b399af7).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/pyvisgrid/core/gridder.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #72       +/-   ##
===========================================
+ Coverage   39.25%   50.45%   +11.20%     
===========================================
  Files          10        9        -1     
  Lines         912      660      -252     
===========================================
- Hits          358      333       -25     
+ Misses        554      327      -227     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@tgross03

Copy link
Copy Markdown
Member

cartopy and mergedeep seem to be used only in the animations module, which is an optional dependency. Should they really be mandatory dependencies?

@aknierim

Copy link
Copy Markdown
Member Author

cartopy and mergedeep seem to be used only in the animations module, which is an optional dependency. Should they really be mandatory dependencies?

Then the code should treat them as such. For now, whenever one tries to plot something, one would get an ImportError. I can change the code so it is optional if you like

@tgross03

Copy link
Copy Markdown
Member

Then the code should treat them as such. For now, whenever one tries to plot something, one would get an ImportError. I can change the code so it is optional if you like

Ah, I see I missed the import in the __init__.py of the plotting module. If you have time to fix this, that would be nice.

@aknierim

Copy link
Copy Markdown
Member Author

Then the code should treat them as such. For now, whenever one tries to plot something, one would get an ImportError. I can change the code so it is optional if you like

Ah, I see I missed the import in the __init__.py of the plotting module. If you have time to fix this, that would be nice.

That one, right? I'll remove it :)

"animate_observation",

@tgross03

tgross03 commented Jun 24, 2026

Copy link
Copy Markdown
Member

That one, right? I'll remove it :)

"animate_observation",

All of the functions imported from pyvisgrid.plotting.animations will create problems because cartopy and mergedeep are imported at the top of the animations.py file.

Thus have to check whether pyvisgrid.plotting.animations can be imported and then add the functions to the __all__ variable or we have to remove all of the animations functions from __init__.py.

@aknierim

Copy link
Copy Markdown
Member Author

That one, right? I'll remove it :)

"animate_observation",

All of the functions imported from pyvisgrid.plotting.animations will create problems because cartopy and mergedeep are imported at the top of the animations.py file.

Thus have to check whether pyvisgrid.plotting.animations can be imported and then add the functions to the __all__ variable or we have to remove all of the animations functions from __init__.py.

Ah, missed those two there, sorry, my bad. I think it's easier to remove them from module init for now.

@tgross03

Copy link
Copy Markdown
Member

That one, right? I'll remove it :)

"animate_observation",

All of the functions imported from pyvisgrid.plotting.animations will create problems because cartopy and mergedeep are imported at the top of the animations.py file.
Thus have to check whether pyvisgrid.plotting.animations can be imported and then add the functions to the __all__ variable or we have to remove all of the animations functions from __init__.py.

Ah, missed those two there, sorry, my bad. I think it's easier to remove them from module init for now.

Yeah, I also think that this is the easiest way but sadly it is potentially breaking for certain scripts that i.e. use from pyvisgrid.plotting import animate_observation.

@aknierim

aknierim commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

I mean, in that case you should install pyvisgrid via the [animations] optional dependencies anyway as intended, so I think that should not be too much of a problem

@aknierim aknierim merged commit 87cb966 into main Jun 24, 2026
9 checks passed
@aknierim aknierim deleted the fix-deps-bug branch June 24, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants