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

API: simplify/improve the API for external variables #1251

Open
4 tasks done
agarny opened this issue Oct 15, 2024 · 0 comments · May be fixed by #1252
Open
4 tasks done

API: simplify/improve the API for external variables #1251

agarny opened this issue Oct 15, 2024 · 0 comments · May be fixed by #1252
Assignees
Labels

Comments

@agarny
Copy link
Contributor

agarny commented Oct 15, 2024

While working on issue #1244, I can see that some of the API for external variables could be improved:

  • bool addExternalVariable(const AnalyserExternalVariablePtr &externalVariable)
    An AnalyserExternalVariablePtr is currently needed, which is needed when an external variable has some dependencies, but not if it doesn't have any. In the latter case, we should be able to add an external variable using just a VariablePtr.
    • Add bool addExternalVariable(const VariablePtr &variable)
  • bool removeExternalVariable(const ModelPtr &model, const std::string &componentName, const std::string &variableName)
    Rather than passing a ModelPtr, a component name, and a variable name, we could simply pass a VariablePtr.
    • Replace with bool removeExternalVariable(const VariablePtr &variable)
  • bool containsExternalVariable(const ModelPtr &model, const std::string &componentName, const std::string &variableName)
    Same as above.
    • Replace with bool containsExternalVariable(const VariablePtr &variable)
  • AnalyserExternalVariablePtr externalVariable(const ModelPtr &model, const std::string &componentName, const std::string &variableName)
    Similar to above.
    • Replace with AnalyserExternalVariablePtr externalVariable(const VariablePtr &variable)
@agarny agarny self-assigned this Oct 15, 2024
@agarny agarny changed the title API: simplify the API for external variables API: simplify/improve the API for external variables Oct 15, 2024
@agarny agarny linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant