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

Remove references to obsolete types #243

Closed
wants to merge 1 commit into from

Conversation

Sbozzolo
Copy link
Contributor

NCDatasets.Dimensions is no longer around as far as I can tell.

@Alexander-Barth
Copy link
Owner

Alexander-Barth commented Dec 20, 2023

It moved to CommonDataModel, but it is imported in NCDatasets from CommonDataModel.
The type NCDatasets.Dimensions is still defined (but as CommonDataModel.Dimensions)

The functions that you want to remove still work as far as I can tell.

julia> using NCDatasets

julia> NCDatasets.Dimensions
CommonDataModel.Dimensions

julia> ds = NCDataset("/tmp/foo.nc","c"); defVar(ds,"data",randn(4,3),("lon","lat"),attrib=Dict("foo" => "bar")); close(ds);

julia> ds = NCDataset("/tmp/foo.nc","a");

julia> unlimited(ds.dim)
String[]

julia> keys(ds.dim)
2-element Vector{String}:
 "lon"
 "lat"

julia> setindex!(ds.dim,123,"time")

Defining a new method on NCDatasets.Dimensions also works:

julia> foo(d::NCDatasets.Dimensions) = "bar"
foo (generic function with 1 method)

julia> foo(ds.dim)
"bar"

Can you provide a MWE what does not work for you?

@Sbozzolo
Copy link
Contributor Author

Sbozzolo commented Dec 20, 2023

I see this in the documentation:

2023-12-20:12:13:19

2023-12-20:12:12:49

https://alexander-barth.github.io/NCDatasets.jl/stable/dimensions/

@Alexander-Barth
Copy link
Owner

OK, I see now! I forgot to add the docstring to the new functions in CommonDataModel which replaced the old ones. I added them to CommonDataModel and they are now also available as keys(d::NCDatasets.Dimensions) (and similar).

The documentation should now be fixed in the dev version.

The PR should not be necessary, but thank you for your time.

@Sbozzolo Sbozzolo closed this Jan 15, 2024
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.

2 participants