-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix linting: address failing workflows on github #7
Conversation
Reviewer's Guide by SourceryThis PR fixes linting issues by updating type hints to maintain compatibility with Python 3.9. The changes replace newer Union type syntax (|) with older typing module constructs (Union, Optional, Tuple). Updated class diagram for DetailedDescription and nodes_from_moduleclassDiagram
class DetailedDescription {
- Optional~str~ descr
- name
+ __init__(descr: Optional~str~ = None, name=None)
}
class nodes_from_module {
+ nodes_from_module(module_path, recursive=True) Tuple~list, Any~
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @myxie - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
==========================================
+ Coverage 84.92% 88.28% +3.36%
==========================================
Files 6 6
Lines 1386 1502 +116
==========================================
+ Hits 1177 1326 +149
+ Misses 209 176 -33 ☔ View full report in Codecov by Sentry. |
@awicenec I have put together this PR to help the build pass, which will help us pass CI on the DALiuGE workflows as well (they are currently failing due to the paletteGen not being able to run). On reviewing these failures it also looks like there were a few other issues with the project:
Please let me know if you are happy with these changes. |
@@ -285,7 +285,7 @@ def get_members(mod: types.ModuleType, module_members=[], parent=None): | |||
:param parent: the parent module | |||
:param member: filter the content of mod for this member | |||
""" | |||
if not mod: | |||
if mod is 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 assumes that what we are getting at mod
here is some form of module/function/class, like the following:
mod=<class 'numpy.complexfloating'>
mod=<function histogram2d at 0x754af8827fb0>
mod=<module 'numpy.polynomial' from '/home/00087932/github/daliuge-new/.venv/lib/python3.10/site-packages/numpy/polynomial/__init__.py'>
mod=<function set_default_printstyle at 0x754af28d1a20>
mod=<module 'numpy.polynomial.polynomial' from '/home/00087932/github/daliuge-new/.venv/lib/python3.10/site-packages/numpy/polynomial/polynomial.py'>
The problem here is that during the test_base test, we also get the following pop up as "modules" that are for some reason imported from numpy:
mod=array([0])
mod=array([1])
mod=array([0, 1])
This throws an error because the if not mod
check doesn't work for arrays:
E ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I don't know why it ends up importing a couple of random arrays, but I suspect somewhere in the numpy
code these are declared somewhere. At any rate, quite a confusing bug!
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.
The test_full_numpy was actually skipped most of the time, because it took very long. Now it is much better and I have re-enabled it.
Summary 📝
Previous work introduced code not compatible with Python 3.9, we we still support in DALiuGE, which runs these tests.
Details
I've used elements from the
typing
module for backwards compatibility.Checks
Summary by Sourcery
Bug Fixes: