Comments (2)
Thank you for this cleanup!
Most of these issues have accumulated over the past few years, during which testing and linting were apparently not used in development even locally. An exception is utils.navigator
, which I had excluded from the cleanup before the initial public release. The configuration update in 911fb11 unfortunately missed moving the ignore
pattern from pytest-flake8
to flake8
, but I have now removed it entirely in aa56ad1.
Regarding your questions:
-
Note that the default threshold is 5, and I had originally raised it to 12, which was a compromise between refactoring effort and linting benefit. Further raising this value to 16 would effectively switch off the warning. I would rather suggest grouping related arguments into dictionaries, e.g., in this case by the parent classes they are passed to.
-
This sort of encoding choice is contextual. In principle, you could have an explicit
return None
or some other representation of failure along the exception-handling branch, but note that the underlying cause for the linter warning here is that the exception is not being re-raised. In this specific case I agree with the SO answer you linked, to the extent that it argues against internally "wrapping" the exception with print statements --- The print statement in the catch clause is currently not only failing to add any useful information beyond what would already be contained in the exception, but by successfully returning an invalid object (None
) it requires explicit downstream failure detection. -
All of these class inheritance issues arise from a lack of precision in the abstractions encoded by the classes.
- I agree with your suggestions about the cases 1-3, with the addition of checks ensuring that the "optional" argument
filename_grid
is present and that the argument(lat_grid,lon_grid) ~ space_grid
, which should be treated uniformly across all relevant classes, has the correct shape. - For the cases 4-6, I would similarly make the newly added argument(s) optional, but asserting their presence in the method body, and realigning the treatment of
dimension_names
inClimateData.Load()
with that inData.Load()
.
- I agree with your suggestions about the cases 1-3, with the addition of checks ensuring that the "optional" argument
Please also make sure to update the tests and tutorials accordingly.
from pyunicorn.
Thank you for the advice and for updating the flake8
configuration!
I'll take care of those remaining fixes as soon as possible, hopefully later this week.
from pyunicorn.
Related Issues (20)
- MAINT: review funcionality and use of `CouplingAnalysis.get_nearest_neighbors()` and add a specific test
- ENH: Theiler window option for diagonal RQA measures in `RecurrencePlot` HOT 2
- CI: set up Travis CI for macOS and Windows builds
- MAINT: drop `climate.MapPlots` in favour of `climate.CartopyPlots` HOT 2
- ENH: Remove old examples folder
- `Network.nsi_local_clustering()` might encounter divide by zero when `typical_weight` is given HOT 1
- module 'numpy' has no attribute 'int' HOT 1
- Failed building wheel for pyunicorn while installing HOT 4
- Printing `ClimateData` object throws `KeyError` from `h5netcdf` HOT 2
- Add `typical_weight` argument for all n.s.i. measures to enable their "corrected" versions
- numpy module not found during installation (Win10) HOT 1
- DOC: sphinx `Didn't find <class attribute> in <module>` when building docs HOT 2
- ModuleNotFoundError from pip install (version 0.6.1) HOT 2
- Complete implementation of new caching system, and extend
- 'pip install pyunicorn' no longer works - fails to build wheel HOT 6
- Python 3.13: igraph tests fail with SystemError (method returned NULL without setting an exception) HOT 3
- MAINT: migrate to Numpy 2.0 HOT 1
- BUG: Potentially endless while loops in experimental methods `Network.GrowPreferentially`
- MAINT: port remaining C modules to Cython in `climate`, `core` and `timeseries` extension modules
- BUG: `PartialCorrelationClimateNetwork._calculate_correlation()` throws dubious divide-by-zero warning on Windows builds only
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyunicorn.