Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A new reader for the netcdf sent to Icare by Meteo-France.#2911

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lperier wants to merge9 commits intopytroll:main
base:main
Choose a base branch
Loading
fromlperier:2024_39_netcdficare

Conversation

lperier
Copy link

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

@mraspaud
Copy link
Member

pre-commit.ci autofix

pre-commit-ci[bot] reacted with rocket emoji

@mraspaud
Copy link
Member

@lperier thanks for adding this reader!

As you can see, the CI is complaining about a few things, that would be nice to fix as many as possible.

Another important point is adding tests for this new reader. The way we do it nowadays is to generate a data file in a temporary directory (using pytest'stmp_path), run the reader and check what is being read.

@lperierlperier marked this pull request as draftSeptember 30, 2024 16:46
@mraspaud
Copy link
Member

@lperier the error that is now in the tests is because of an external issue. If you merge your branch with main, it should disappear.

@lperierlperier marked this pull request as ready for reviewOctober 15, 2024 12:49
@codecovCodecov
Copy link

codecovbot commentedOct 15, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is89.09370% with71 lines in your changes missing coverage. Please review.

Project coverage is 96.01%. Comparing base(9e3b342) to head(8bebfc1).
Report is 325 commits behind head on main.

Files with missing linesPatch %Lines
satpy/readers/geos_netcdficare.py82.65%68 Missing⚠️
satpy/tests/reader_tests/test_geos_netcdficare.py98.84%3 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #2911      +/-   ##==========================================- Coverage   96.06%   96.01%   -0.05%==========================================  Files         373      379       +6       Lines       54465    55813    +1348     ==========================================+ Hits        52321    53589    +1268- Misses       2144     2224      +80
FlagCoverage Δ
behaviourtests3.89% <0.00%> (-0.10%)⬇️
unittests96.10% <89.09%> (-0.06%)⬇️

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.

Copy link
Member

@mraspaudmraspaud left a comment

Choose a reason for hiding this comment

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

I added a few comments inline.
In general, try to follow the python coding guidelines. There are some more coding guidelines here:https://pytroll.github.io/guidelines.html

If you install ruff, it will help you spot style issues in your code also.

Comment on lines 117 to 122
# chunk_bytes = self._chunk_bytes_for_resolution()
chunk_bytes = '128 MiB'
# chunk_bytes = '64 MiB'

# with dask.config.set(**{'array.slicing.split_large_chunks': True}) :
with dask.config.set({"array.chunk-size": chunk_bytes}) :
Copy link
Member

Choose a reason for hiding this comment

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

This should be set by the user outside of satpy, so this code needs to be removed.

self.metadata["end_time"] = self.get_endOrStartTime(
"time_coverage_end")

print(
Copy link
Member

Choose a reason for hiding this comment

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

Satpy uses logging, not printing... see other readers.

Comment on lines 143 to 144
self.longitudeReelle = self.satlon()
self.longitudedeprojection = self.projlon()
Copy link
Member

Choose a reason for hiding this comment

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

Please use variable names in english, and snake_case, not CamelCase :)

--------
Here is an example how to read the data in satpy:

from satpy import Scene
Copy link
Member

Choose a reason for hiding this comment

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

Satpy uses 4 space indentations, not tabs

Comment on lines 96 to 97
# from netCDF4 import Dataset
# from xarray import DataArray
Copy link
Member

Choose a reason for hiding this comment

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

Should be remove if not needed

Comment on lines 102 to 103
# from satpy._compat import cached_property
# from satpy.utils import get_dask_chunk_size_in_bytes
Copy link
Member

Choose a reason for hiding this comment

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

should be removed if not needed

# from satpy.utils import get_dask_chunk_size_in_bytes
import dask
from satpy.readers import open_file_or_filename
# import math
Copy link
Member

Choose a reason for hiding this comment

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

Should be removed if not needed.


# Reading the needed attributes.
self.initialisation_dataset()
# __init__()
Copy link
Member

Choose a reason for hiding this comment

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

Remove.

print(
"Unsupported satellite platform : " +
self.plateforme)
exit(1)
Copy link
Member

Choose a reason for hiding this comment

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

Please use exceptions, not exitting.

self.plateforme)
exit(1)

# sensor_name()
Copy link
Member

Choose a reason for hiding this comment

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

This function should return the sensor name. Also, we try to avoid setting attributes in methods other than__init__

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mraspaudmraspaudmraspaud requested changes

@djhoesedjhoeseAwaiting requested review from djhoesedjhoese is a code owner

Assignees

@lperierlperier

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@lperier@mraspaud

[8]ページ先頭

©2009-2025 Movatter.jp