-
Notifications
You must be signed in to change notification settings - Fork 235
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
Update imports of native_types
and pyomo_constant_types
in scaling module
#1366
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1366 +/- ##
==========================================
- Coverage 77.60% 77.59% -0.01%
==========================================
Files 391 391
Lines 64330 64330
Branches 14244 14244
==========================================
- Hits 49923 49920 -3
- Misses 11831 11835 +4
+ Partials 2576 2575 -1 ☔ View full report in Codecov by Sentry. |
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.
Looks good to me.
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.
Looks good to me. If pyomo_constant_types
is deprecated, we probably should open an issue to move away from using it eventually.
I would also recommend changing the following line (and removing the import of diff --git a/idaes/core/util/scaling.py b/idaes/core/util/scaling.py
index d4bd825..f3ee1cf 100644
--- a/idaes/core/util/scaling.py
+++ b/idaes/core/util/scaling.py
@@ -1509,7 +1509,7 @@ class NominalValueExtractionVisitor(EXPR.StreamBasedExpressionVisitor):
# first check if the node is a leaf
nodetype = type(node)
- if nodetype in native_types or nodetype in pyomo_constant_types:
+ if nodetype in native_types:
return [node]
node_func = self.node_type_method_map.get(nodetype, None) |
These should be imported from
pyomo.common.numeric_types
. Also,pyomo_constant_types
was deprecated last week (although I don't do anything about that). This PR is necessary to prevent import errors with pyomo/main, aspyomo_constant_types
no longer exists inpyomo.core.expr.numvalue
.Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: