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 *args to action_wrapper #1475

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

MichaelPesce
Copy link
Contributor

Fixes/Resolves:

Adds optional positional arguments to the action_wrapper(), which wraps the build, solve, and export functions of FlowsheetInterfaces

Summary/Motivation:

To run a parameter sweep using parameter_sweep.ParameterSweep, you must provide a flowsheet's solve function. On the UI, we store this solve function as an action_wrapper('solve'). When running a parameter sweep using the ParameterSweep class, we then have 2 options:

  1. Provide the action wrapped solve function OR
  2. Dynamically locate the underlying Flowsheet solve function

We had been using option 2, but this relied on the assumption that a flowsheet's solve function was named either solve or optimize. To remove this assumption, we can use option 1.

In order for option 1 to work, we must add optional positional arguments, see below screenshot:
Screenshot 2024-07-31 at 10 27 24 AM

Changes proposed in this PR:

  • Add *args to action_wrapper()
  • Update UI accordingly to use action wrapped solve function

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link
Contributor

@bknueven bknueven left a comment

Choose a reason for hiding this comment

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

Surely this can't hurt.

@bknueven bknueven merged commit e81bd8b into watertap-org:main Aug 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Normal Normal Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants