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

check presence of attribute and variables #235

Closed
Alexander-Barth opened this issue Oct 30, 2023 · 0 comments
Closed

check presence of attribute and variables #235

Alexander-Barth opened this issue Oct 30, 2023 · 0 comments

Comments

@Alexander-Barth
Copy link
Owner

Alexander-Barth commented Oct 30, 2023

The following code should be an error:

using NCDatasets
using Test
sz = (4,5)
filename = tempname()
#filename = "/tmp/mytest.nc"


ds = NCDataset(filename,"c")
ds.attrib["comment"] = "foo"
"comment" in ds.attrib

and not return true, as in

"foo" in Dict("foo" => "bar")

Presence of attributes and variables should be checked with haskey.

@Alexander-Barth Alexander-Barth changed the title check presence of attribute check presence of attribute and variables Oct 30, 2023
Alexander-Barth added a commit that referenced this issue Oct 30, 2023
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

No branches or pull requests

1 participant