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

Update sample usage of writer class #299

Open
Nfargette opened this issue Jan 29, 2025 · 1 comment
Open

Update sample usage of writer class #299

Nfargette opened this issue Jan 29, 2025 · 1 comment

Comments

@Nfargette
Copy link

Hello,
The sample usage at the end of the writer class seem outdated. (https://cdflib.readthedocs.io/en/latest/modules/cdfwrite.html)
The first error is for

info=cdf_master.cdf_info()
cdf_file=cdfwrite.CDF('/path/to/swea_file.cdf',cdf_spec=info,delete=True)

, where cdf_spec expects a dictionnary but info is not one

then the line
globalaAttrs=cdf_master.globalattsget(expand=True) yields TypeError: CDF.globalattsget() got an unexpected keyword argument 'expand'
and the following line
cdf_file.write_globalattrs(globalaAttrs) yields the following error :

in CDF.write_globalattrs(self, globalAttrs)
entryNumMaX = -1
poffset = -1
for entryNum, value in entry.items():
   if entryNumMaX < entryNum:
     entryNumMaX = entryNum
AttributeError: 'list' object has no attribute 'items'

Would it be possible to update the documentation for the latest version of the cdflib package ? Thank you !

@bryan-harter
Copy link
Member

Thanks for that! Yes the docs are a bit out of date, we'll have to go through and rework it

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

No branches or pull requests

2 participants