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

Set HDF5 API to closer match netCDF3 #188

Merged
merged 4 commits into from
Jul 13, 2022
Merged

Conversation

martindurant
Copy link
Member

Fixes #186

@rabernat , this raises the question of what to do for the backends that are implemented as simple functions, e.g., grib. Should they all be wrapped in a class of the same structure?

@martindurant
Copy link
Member Author

This is how a wrapper class for grib would look:

class GribToZarr:
    def __int__(self, url, common_vars=None, storage_options=None,
                inline_threshold=100, skip=0, filter=None):
        self.url = url
        self.common_vars = common_vars or []
        self.inline_threshold= inline_threshold
        self.storage_options = storage_options or {}
        self.skip = skip
        self.filter = filter or {}

    def translate(self):
        return scan_grib(self.url, self.common_vars, self.storage_options, self.inline_threshold,
                         self.skip, self.filter)

@martindurant
Copy link
Member Author

Merging this here, so that development can continue for netCDF3 without conflicts with the reformatting

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 this pull request may close these issues.

API inconsistencies between SingleHdf5ToZarr and netcdf_recording_file
1 participant