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

Missing metadata getters #2643

Open
TorkelE opened this issue Apr 15, 2024 · 8 comments · May be fixed by #3334
Open

Missing metadata getters #2643

TorkelE opened this issue Apr 15, 2024 · 8 comments · May be fixed by #3334
Assignees
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Apr 15, 2024

It seems that getters for these metadata are missing: misc, input. Possibly this holds for a few others.

@TorkelE TorkelE added the bug Something isn't working label Apr 15, 2024
@vyudu
Copy link
Contributor

vyudu commented Jan 16, 2025

@TorkelE Is this metadata for XSystems? Or something else? not seeing any XSystems that have input and misc as fields

@TorkelE
Copy link
Member Author

TorkelE commented Jan 16, 2025

Sorry, symbolic metadata: https://docs.sciml.ai/ModelingToolkit/stable/basics/Variable_metadata/

Typically, a metadata md has two corresponding functions hasmd and getmd. But these metadata lacks them. basically you have to implement getmisc and getinput` so that

using ModelingToolkit
@parameters p [misc=["Random", :metadata]]
ModelingToolkit.getmisc(X)

works.

Check how similar functions are working. It can be worthwhile to see if you can find a list somewhere (and if there is not an exhaustive one, creating it) and checking that each one have both the hasX and getX functions.

As an example, it is using symbolic metadata that we e.g. have implemented the metadata tag telling us that a parameter is a conservation law parameter.

@vyudu vyudu linked a pull request Jan 16, 2025 that will close this issue
@vyudu
Copy link
Contributor

vyudu commented Jan 16, 2025

Added misc, though I think input is already there as isinput

@TorkelE
Copy link
Member Author

TorkelE commented Jan 16, 2025 via email

@vyudu
Copy link
Contributor

vyudu commented Jan 16, 2025

The input field is just a Bool that says whether the variable is an input, I thought?

@TorkelE
Copy link
Member Author

TorkelE commented Jan 16, 2025 via email

@vyudu
Copy link
Contributor

vyudu commented Jan 16, 2025

It seems like all of the boolean metadata variables just have isX as the getter (like input, output, irreducible). Is there a reason to write a separate getX?

@TorkelE
Copy link
Member Author

TorkelE commented Jan 16, 2025

To be honest, you are probably right. I was thinking of some system where it loops through metadata, but doesn't really make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants