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 types to allow float32 computations for SAR-C #2925

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

mraspaud
Copy link
Member

This PR fixes type to makes sure the sensor data is kept in float32s.
It also add the get_bounding_box method and puts it as an attribute in the SwathDefinition.

  • Closes #xxxx
  • Tests added
  • Fully documented
  • Add your name to AUTHORS.md if not there already

@mraspaud mraspaud added the enhancement code enhancements, features, improvements label Oct 11, 2024
@mraspaud mraspaud self-assigned this Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.08%. Comparing base (eceedf9) to head (5634073).
Report is 99 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2925      +/-   ##
==========================================
+ Coverage   96.05%   96.08%   +0.03%     
==========================================
  Files         375      375              
  Lines       54607    54615       +8     
==========================================
+ Hits        52451    52478      +27     
+ Misses       2156     2137      -19     
Flag Coverage Δ
behaviourtests 3.98% <0.00%> (+<0.01%) ⬆️
unittests 96.18% <100.00%> (+0.03%) ⬆️

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 Oct 11, 2024

Pull Request Test Coverage Report for Build 11380299578

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 54 of 54 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 96.183%

Totals Coverage Status
Change from base Build 11380133918: 0.002%
Covered Lines: 52714
Relevant Lines: 54806

💛 - Coveralls

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

LGTM, again just one suggestion inline.

satpy/readers/sar_c_safe.py Outdated Show resolved Hide resolved
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.

I wouldn't mind some dtype before and after dask compuation, but otherwise looks good. Not a show stopping request. Merge if you disagree. Example:

data_arr_dask = filehandler.get_dataset(...)
data_arr_np = data_arr_dask.compute()
assert data_arr_np.dtype == np.float32
assert data_arr_np.dtype == data_arr_dask.dtype

@mraspaud
Copy link
Member Author

I wouldn't mind some dtype before and after dask compuation, but otherwise looks good. Not a show stopping request. Merge if you disagree. Example:

data_arr_dask = filehandler.get_dataset(...)
data_arr_np = data_arr_dask.compute()
assert data_arr_np.dtype == np.float32
assert data_arr_np.dtype == data_arr_dask.dtype

You mentioned this in another pr already, and I basically agree. It's just that I forget about it. I'll fix it soon.

@mraspaud mraspaud merged commit 9ebda32 into pytroll:main Oct 17, 2024
18 checks passed
@mraspaud mraspaud deleted the fix-sar-type branch October 17, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:readers enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants