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

fix: Add metadata getters #3334

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

vyudu
Copy link
Contributor

@vyudu vyudu commented Jan 16, 2025

Fixes #2643. Adds getters for connect, unit, misc

@vyudu
Copy link
Contributor Author

vyudu commented Jan 16, 2025

@AayushSabharwal Haven't change vartype to variable_source in this PR but let me know if I should add it.

@vyudu vyudu changed the title Add metadata getters fix: Add metadata getters Jan 16, 2025
@AayushSabharwal
Copy link
Member

Yeah go for it

@ChrisRackauckas
Copy link
Member

add to the docs section on metadata?

@vyudu
Copy link
Contributor Author

vyudu commented Jan 17, 2025

This one should be ready


meta = (
var = var,
vartype,
variable_source,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this key is breaking


## Units

Units for variables can be designated using symbolic metadata. For more information, please see the [model validation and units](@ref units) section of the docs. Note that `getunit` is equivalent to `get_unit`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getunit and get_unit aren't equivalent

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah never mind, I read the code wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make them not equivalent? Having two functions do the same thing doesn't really help. get_unit can do all the unit propagation it currently does, and getunit should just make it get the VariableUnit metadata.

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 this pull request may close these issues.

Missing metadata getters
3 participants