Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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), andget_var_attrs
. It can do something like this:Forthcoming draft PR on modflow API for that.