-
Notifications
You must be signed in to change notification settings - Fork 7
Fix get_required_parameters_for_parameter_table
#340
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -621,11 +621,8 @@ def append_overrides(overrides): | |
| if not problem.model.has_entity_with_id(p) | ||
| ) | ||
|
|
||
| # remove parameters that occur in the condition table and are overridden | ||
| # for ALL conditions | ||
| for p in problem.condition_df.columns[ | ||
| ~problem.condition_df.isnull().any() | ||
| ]: | ||
| # parameters that are overridden via the condition table are not allowed | ||
| for p in problem.condition_df.columns: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since parameter IDs is now a set, can change try-except/loop to parameter_ids -= set(condition_df.columns)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but parameter_ids is still an OrderedDict (we wanted to preserve order here). Only the returned DictKeyView (or similar) acts like a set.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's right before returning, it could be done just on the keys, but then future modifications might easily mess up the ordering. I'd leave it as is until Python has a proper OrderedSet.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does it become
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. I was in v1. |
||
| try: | ||
| parameter_ids.remove(p) | ||
| except KeyError: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of try-except, could do one of these, but fine as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but then one has to look up each element twice.