Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat/var meta #877

Closed
wants to merge 11 commits into from
Closed

Conversation

jmccreight
Copy link
Contributor

@jmccreight jmccreight commented Feb 2, 2022

This is really a shoe horn to get a human-readable format (e.g. a flattened csv in the source) into a new memory manager field for attributes (using keys/hashes to ensure some sanity, at least for me).

Currently the the attribute keys are a constant and are not stored in the memory manager (only the values are). I've only started with 3 attributes: "variable name", "long name", and "units". This can easily be changed but gets back to the idea that this is currently the same for all Attrs instances.

In theory the Attribute object is usable for all variables and subclassable for special cases. Here I've only implemented for scalar variables in Numerical Solution.

The bmi interface has been extended to allow access to the variable metadata: get_attrs_item_count, get_attrs_keys (not-variable specific, as mentioned above), and get_var_attrs. It can do something like this:

image

Forthcoming draft PR on modflow API for that.

@jmccreight
Copy link
Contributor Author

jmccreight commented Feb 2, 2022

I did remove trailing whitespace, you may want to review with the equivalent of -w.

I did a small set of tests locally before pushing. So, I'll take a look at what I broke.

Also, no tests were added! 🤦 This is easiest to test through the api.

@langevin-usgs
Copy link
Contributor

Closing this PR as we are headed a different direction with the input data model.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants