-
Notifications
You must be signed in to change notification settings - Fork 56
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
Fixing import errors, adding isort, cleaned up regression tests, and added unit tests for new import procedure. #180
Conversation
Codecov Report
@@ Coverage Diff @@
## main #180 +/- ##
==========================================
+ Coverage 64.61% 64.74% +0.12%
==========================================
Files 47 47
Lines 11954 11941 -13
==========================================
+ Hits 7724 7731 +7
+ Misses 4230 4210 -20
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Nice work, but it needs some changes for the test skipping to work with DVGeoMulti. I also left some more minor comments, mostly on formatting.
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 think the logic for skipping tests on DVcon is not correct, but everything else looks great
|
||
@ignore_warnings | ||
def test__DVGeometryVSP_import_openvsp(self): | ||
with patch.dict(sys.modules, {"openvsp": None}): |
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 neat
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 took me a long time to figure out.
import warnings | ||
|
||
|
||
def ignore_warnings(test_func): |
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.
Nice
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.
Yeah you can see my comment above, but this is because numpy is annoying for these tests.
Purpose
This PR adds the following features:
DVGeometryESP
,DVGeometryVSP
,DVGeometryMulti
, andDVGeometryCST
all have optional dependencies required to function properly. Previously, pyGeo suppressed the import errors leaving users confused as to why their code wasn't working with pyGeo. In this PR, the import suppression was replaced in favor of logic control in the import statements that will throw an error if the user tries to initialize any of the classes listed above. Using this new procedure, the correct errors will be thrown with descriptions when the user tries to use one of the classes, without suppression..isort.cfg
file here to the root of the the pyGeo repo. I added iSort the the azure pipeline yaml file as well.This PR will close issue #176
Expected time until merged
This is a quality of life PR, so not urgent. I would estimate a few weeks or less to merge.
Type of change
Testing
To test the new changes, run the new unit tests with either pyTest or testflo.
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable