-
Notifications
You must be signed in to change notification settings - Fork 54
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
Removing all wildcard imports #1252
base: master
Are you sure you want to change the base?
Removing all wildcard imports #1252
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1252 +/- ##
==========================================
+ Coverage 38.47% 38.49% +0.01%
==========================================
Files 164 164
Lines 37020 37029 +9
Branches 5728 5728
==========================================
+ Hits 14243 14253 +10
+ Misses 21650 21649 -1
Partials 1127 1127 ☔ 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.
Thanks @ksbeattie for doing this, I see that there was a significant amount of nested wildcard importing going on. I have a few questions but overall this looks nice.
@@ -57,13 +54,13 @@ | |||
from pyomo.opt import SolverFactory | |||
|
|||
pyutilib.subprocess.GlobalData.DEFINE_SIGNAL_HANDLERS_DEFAULT = False | |||
from pyDOE import * | |||
import pyDOE # pylint: disable=unused-import |
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.
It doesn't look like this import is covered, or necessary. Can this be removed?
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.
Yes, this is a tricky one. I left it in and added the pylint disable because I believe that Anuja (who wrote this code) was using it to detect if the SM Opt "plugin" was available or not. I actually couldn't find where else it is used. I would like to get @anujad95 to review and test this part directly, if possible.
from foqus_lib.framework.graph.nodeVars import NodeVars | ||
from foqus_lib.framework.pymodel.pymodel import pymodel |
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.
Digging a bit into the files, the coverage issue is because this file is never executed directly:
FOQUS/foqus_lib/gui/tests/test_plugins.py
Line 165 in 62534b8
# def test_load_and_run_heatintegration(self, active_session, simnode): |
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.
I believe this is related to the whole plugin management problem (described in #1085) but shelved due to lack of time. If we could get it into the CI somehow, that would be great.
@@ -1561,8 +1567,8 @@ def updateOutputValues(self): | |||
runState = data.getRunState() | |||
|
|||
if len(outputData) == 0: |
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.
This is also not covered by the tests.
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.
I'm all for adding more test coverage, I was just concentrating on removing all the wildcard-imports for this PR.
Fixes/Addresses:
The next step in #1162: this PR removes all wildcard imports as reported by pylint and adds that check to GHA.
Summary/Motivation:
Clean up the code
Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: