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 functionality for input based model options #1270

Merged
merged 7 commits into from
Jan 26, 2024

Conversation

MichaelPesce
Copy link
Contributor

@MichaelPesce MichaelPesce commented Jan 16, 2024

Fixes/Resolves:

Addresses issue #1239 and UI issue watertap-org/watertap-ui#98

Summary/Motivation:

Allow for flowsheets to have model options that take string, integer, or float types as the value.

Changes proposed in this PR:

  • Add additional options for ModelOption class in fsapi

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.

@MichaelPesce MichaelPesce self-assigned this Jan 16, 2024
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (66eada1) 94.28% compared to head (1bc3ab8) 94.28%.

Files Patch % Lines
watertap/ui/fsapi.py 89.65% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1270   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files         367      367           
  Lines       37234    37259   +25     
=======================================
+ Hits        35105    35131   +26     
+ Misses       2129     2128    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@avdudchenko avdudchenko left a comment

Choose a reason for hiding this comment

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

LGMT - my comments can be addressed in future PRs.

@@ -611,6 +631,14 @@ def __init__(
self.add_action("diagram", None)

self._actions["custom_do_param_sweep_kwargs"] = custom_do_param_sweep_kwargs
self.fs_exp.add_option(
name="NumParallelWorkers",
display_name="Number of multi-processing workers",
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be more clear to say "Number of multi-processing workers for sensitivity analysis"

right now when there are build options, we don't have a way to do any groupings. Might be nice if we had a groups for build options like we do for flowsheet inputs (e.g. flowsheet model build options, analysis options etc..)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @MichaelPesce mentioned that he would exclude this bit from the PR

@@ -218,11 +220,29 @@ def validate_description(cls, v, values):
@classmethod
def validate_value(cls, v, values):
Copy link
Contributor

Choose a reason for hiding this comment

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

If I read this right, we can allow users select an option from a list, or enter a string, int or float?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's true according to @MichaelPesce

@lbianchi-lbl lbianchi-lbl added Priority:High High Priority Issue or PR fsapi labels Jan 18, 2024
@lbianchi-lbl lbianchi-lbl self-requested a review January 18, 2024 21:29
Copy link
Contributor

@adam-a-a adam-a-a left a comment

Choose a reason for hiding this comment

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

LGTM

@bknueven bknueven enabled auto-merge (squash) January 26, 2024 17:05
@bknueven bknueven merged commit 4211205 into watertap-org:main Jan 26, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fsapi Priority:High High Priority Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants