Comments (3)
It would be great to validate all the input parameters. I've tried to do this as much as possible with the various classes that we define, but the routine you are referring to is a fortran function that is called from python. That doesn't mean that its not possible to do, its just a little more complicated and would probably involve writing some kind of decorator that is applied to the wrapped function.
If anyone wants to try doing this, that would be great! The first step would probably first come up with a generic approach that works with all the various legendre function routines, as the parameters are all the same.
from shtools.
e.g. possibly something of the style of the following for now.
if not isinstance(z, (np.floating, float)):
raise TypeError(
"z must be a float type")
)
from shtools.
Thank you @MarkWieczorek! I can only think of specific fixes (e.g. check length once passed to fortran) but this is less generic than an ideal solution.
For anyone who finds this issue in the future:
- this 'user bug' is simple to identify in hindsight (user input mistake of entering an array vs a float and expecting a matrix return rather than an array) but it can masquerade as a downstream calculation error (e.g. why is my code not predicting the right value?). Hope that saves some time for folks! :)
from shtools.
Related Issues (20)
- Release SHTOOLS 4.10.4
- Cannot install M1-Mac by pip HOT 4
- Call to dggglm SHExpandLSQ HOT 1
- Installation on Python 3.10.12 error: metadata-generation-failed, No module named 'numpy.distutils' HOT 2
- Install issue can't build wheel. (Using Pycharm) HOT 2
- Exporting grid data to 3D model
- Sampling is incorrectly set when using DHRealGrid() class. HOT 1
- Release SHTOOLS 4.11 HOT 1
- Meson can't determine version of pyshtools when installing from a source tarball HOT 5
- jupyter is an (undeclared) build-time dependency HOT 6
- Compilation error on MacOS Sonoma HOT 8
- issue when calling pyshtools.spectralanalysis.SHReturnTapersMap HOT 6
- installing pyshtools lead to error: metadata-generation-failed (PyCharm) HOT 4
- Error message when attempting to install pyshtools on Mac OS X 14.2.0 HOT 15
- Release SHTOOLS 4.12.0 HOT 1
- Implement ducc backend to pyshtools gravity and magnetic classes HOT 2
- Help! I can't install pyshtools!!! HOT 8
- Apple silicon M1 macOS 14.4.1 library 'lapack' not found HOT 5
- Plotting methods in `shclasses` use deprecated matplotlib function `matplotlib.cm.get_cmap` HOT 1
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 shtools.