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

Add API method for inspection of user-defined variables #182

Open
sammousavi opened this issue Jul 10, 2024 · 2 comments
Open

Add API method for inspection of user-defined variables #182

sammousavi opened this issue Jul 10, 2024 · 2 comments
Labels
feature Proposal for a new feature.

Comments

@sammousavi
Copy link

There is no direct function in the Model class to view variables (similar to parameters). It would be great to have a function like model.variables() in addition to model.parameters().

@john-hen
Copy link
Collaborator

Hi. I think that's fine. It can be added if someone wants to put the work in.

Personally, I never saw a use case for querying the variables. Like parameters, those we need to automate parameter sweeps. Or even optimization schemes. What are the variables good for? From an automation perspective. (Inside the Comsol model itself they're obviously useful.)

Do you plan to work on this? The demo model (from the tutorial) doesn't define any custom variables. The first step would be to add some, as an example, to that model. Then write a demo script that queries them. So that we see what the new function (method of the Model class) would do. We're eventually going to need something like that anyway, as I'm not adding library code that doesn't come with automated tests.

If you don't want to contribute the code, we can leave this issue open as a feature request.

@john-hen
Copy link
Collaborator

Feature request it is...

@john-hen john-hen changed the title No direct function in Model class to see variables (similar to parameters) Add API method for inspection of user-defined variables Jul 12, 2024
@john-hen john-hen added the feature Proposal for a new feature. label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposal for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants