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

Return type for parse_access_ncfile #186

Closed
marc-white opened this issue Aug 26, 2024 · 1 comment · Fixed by #212 or #222
Closed

Return type for parse_access_ncfile #186

marc-white opened this issue Aug 26, 2024 · 1 comment · Fixed by #212 or #222
Labels
enhancement New feature or request

Comments

@marc-white
Copy link
Collaborator

marc-white commented Aug 26, 2024

Is your feature request related to a problem? Please describe.

The return out of BaseBuilder.parse_access_ncfile is currently a long tuple of assorted file information. This makes it difficult to remember which item is which during debugging & testing.

Describe the feature you'd like

We should consider if parse_access_ncfile should return a dict instead. This will have the advantage of making the return more human-legible. (It will also simplify the parser functions of the various builders, which effectively all rebuild the tuple return into a dict anyway.)

Describe alternatives you've considered

Nil.

Additional context

I'm about to add another issue (#187) to suggest an expansion of the testing for builders, which will be made easier by this feature.

@charles-turner-1
Copy link
Collaborator

The changes in #212 should cover this - I'd initially thought that we'd want to have separate flags in the catalogue for data and coordinate variables, so I factored it out as a way of keeping track of changes. It turned out to be unnecessary to do that, but I agree the long tuple is difficult to keep track of & creates a lot of unnecessary context.

I used a dataclass, not a dict, however - let me move a lot of the repetitive stuff inside the class. Given pydantic is used pretty heavily upstream in intake-esm, I wonder whether we might want to use a pydantic dataclass? It might be handy to enforce the extra validation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants