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

BUG: attributes are wrapped in tuples #70

Closed
1 task done
bzah opened this issue Feb 14, 2024 · 0 comments · Fixed by #71
Closed
1 task done

BUG: attributes are wrapped in tuples #70

bzah opened this issue Feb 14, 2024 · 0 comments · Fixed by #71

Comments

@bzah
Copy link
Collaborator

bzah commented Feb 14, 2024

Description

It seems when attributes are not strings, the value is wrapped with a tuple.

What I Did

cat >test.xml << EOF
<?xml version="1.0" encoding="UTF-8"?> 
<netcdf xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2">
  <attribute name="toto" type="double" value="42.42" />
  <attribute name="cacao" type="string" value="cacao" />
</netcdf>   
EOF
from xncml import open_ncml

ds = open_ncml("test.xml")
# OK.
assert type(ds.attrs["cacao"]) == str
# KO (the type is actually tuple)
assert type(ds.attrs["toto"]) == float
  • I'm willing to investigate/fix this issue.
bzah pushed a commit that referenced this issue Feb 16, 2024
@bzah bzah mentioned this issue Feb 16, 2024
2 tasks
@bzah bzah closed this as completed in #71 Mar 1, 2024
bzah added a commit that referenced this issue Mar 1, 2024
* FIX: #70 scalar parsing
---------

Co-authored-by: Abel Aoun <[email protected]>
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.

1 participant