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

Review subclasses of BaseFileHander #453

Closed
honnorat opened this issue Oct 9, 2018 · 1 comment · Fixed by #455
Closed

Review subclasses of BaseFileHander #453

honnorat opened this issue Oct 9, 2018 · 1 comment · Fixed by #455

Comments

@honnorat
Copy link
Contributor

honnorat commented Oct 9, 2018

This is to carry on with #450 (and PR #451), where @djhoese asked:

One question, since you had to change the fake hdf5 handler to make the test work, does this mean that the base file handler (satpy/readers/file_handlers.py) might also need to be updated? What readers have you tried this with?

Describe the bug
Using pathlib.Path instances as filenames in subclasses of BaseFileHander may not always work. Most of the time, BaseFileHander.filename is used with open() or compatible calls (h5py.File(), xr.open_rasterio(), etc.) which is fine. But some classes may need adjustments:

  • GRIBFileHandler
  • HDF4BandReader and HDF4FileHandler
  • NativeMSGFileHandler
  • NcNWCSAFMSG which uses h5netcdf (side note: why not h5py like most other readers ?)
  • classes from satpy.readers.nc_slstr
@djhoese
Copy link
Member

djhoese commented Oct 9, 2018

@honnorat would it be enough to do file_handler_class(str(filename), ...) in the base YAML file reader? Is there any performance or other benefit by using the pathlib object?

h5netcdf is a package for reading NetCDF files (not hdf5). So its equivalent is the netcdf4-python package (not h5py). For reasons someone might want to use it see: https://github.com/shoyer/h5netcdf#why-h5netcdf

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 a pull request may close this issue.

2 participants