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

Turn InferenceObjectsNetCDF into an extension #51

Closed
sethaxen opened this issue Feb 28, 2023 · 1 comment · Fixed by #60
Closed

Turn InferenceObjectsNetCDF into an extension #51

sethaxen opened this issue Feb 28, 2023 · 1 comment · Fixed by #60

Comments

@sethaxen
Copy link
Member

If we move from_netcdf and to_netcdf into InferenceObjects with a fallback that instructs the user to load NCDatasets to use these functions, then we can place the implementations in an extension. There seem to be some trade-offs to this approach, and it's not clear either way whether it should be preferred to our current subpackage approach.

@sethaxen
Copy link
Member Author

An even better approach would be to just overload functions in the two files. e.g. for loading an InferenceData from a NetCDF file, we could just define the overload convert_to_inference_data(::NCDataset). The problem is writing to a NetCDF file. The NCDatasets API only provides functionality for iteratively writing data to a NCDataset, not a way to write an object to one.

If #16 is implemented, then a better solution would be to support an NCDataset being a store for an InferenceData.

By comparison, NetCDF.jl has ncwrite and ncread that we could perhaps overload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant