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

Add attrs to future swath definition #578

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

mraspaud
Copy link
Member

This PR adds attrs to the future swath definition.

  • Tests passed
  • Passes git diff origin/main **/*py | flake8 --diff
  • Fully documented

@djhoese
Copy link
Member

djhoese commented Jan 29, 2024

You brought up nprocs on slack, do we want to deprecate that with a warning in the old class?

@mraspaud
Copy link
Member Author

I don't know. On one hand, we should encourage users to go over to dask, but on the other hand, maybe that's a showstopper for some (I have not heard of such myself though)?

@djhoese
Copy link
Member

djhoese commented Jan 31, 2024

I think it is more of the nprocs on __init__ being a problem. Having it in other places is fine (although could be refactored to be presented differently). For example, getting coordinates or reprojecting or whatever, then nprocs makes sense as a convenience to say "do it with multiple cores, whatever that means". I don't think dask is usually a show stopper, but it may be an unnecessary dependency in some users eyes. Especially if it becomes a hard requirement when users are totally fine doing everything in numpy land.

Side note: nprocs could maybe be a global setting in pyresample.config to hide it away.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (eaf8367) 94.05% compared to head (5b05353) 94.01%.
Report is 42 commits behind head on main.

Files Patch % Lines
pyresample/future/geometry/swath.py 95.45% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   94.05%   94.01%   -0.04%     
==========================================
  Files          90       92       +2     
  Lines       13575    13836     +261     
==========================================
+ Hits        12768    13008     +240     
- Misses        807      828      +21     
Flag Coverage Δ
unittests 94.01% <98.07%> (-0.04%) ⬇️

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

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

@coveralls
Copy link

coveralls commented Feb 15, 2024

Coverage Status

coverage: 93.676% (+0.03%) from 93.649%
when pulling 5b05353 on mraspaud:add-attrs-to-swath-def
into eaf8367 on pytroll:main.

Swath cartesian coordinates
"""

def __init__(self, lons, lats, crs=None, nprocs=1, attrs=None):
Copy link
Member

Choose a reason for hiding this comment

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

Please remove nprocs. The commit message says "for backwards compatibility". There is no backwards compatibility in the future modules...at least let's try really hard to avoid it. If it is going to be here then it at least needs a warning or something about it being deprecated. But I'd rather have a create_swath_def pytest fixture that excludes nprocs from the kwargs when creating the new version of the swath class.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I didn't understand the gist of your previous comments obviously. Removing.

Copy link
Member Author

Choose a reason for hiding this comment

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

done, ready for rereview :)

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Thanks for going back and forth with me. Looks good. It's giving me a lot of ideas on where we could take this, but we'll have to get to that later.

@djhoese djhoese merged commit 60b4b38 into pytroll:main Feb 16, 2024
25 of 27 checks passed
@mraspaud mraspaud deleted the add-attrs-to-swath-def branch February 19, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants