Skip to content
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

Move sanity checks of tesseroids outside jitted functions #84

Closed
santisoler opened this issue Jul 30, 2019 · 1 comment · Fixed by #87
Closed

Move sanity checks of tesseroids outside jitted functions #84

santisoler opened this issue Jul 30, 2019 · 1 comment · Fixed by #87
Labels
enhancement Idea or request for a new feature
Milestone

Comments

@santisoler
Copy link
Member

Description of the desired feature

Would be better to remove the functions that perform sanity checks of tesseroids outside the jitted functions intended to perform the forward modelling. For any arbitrary set of tesseroids, the current location of these functions is not an issue, but for future tesseroid arrangements like layers (#83) or meshes, these functions can be simplified: instead of calling them once for each tesseroid, we could write alternate simpler functions that work on the entire tesseroid collection.

So, the proposal is to refactor:

  • _check_tesseroid(),
  • _check_point_outside_tesseroid() and
  • _longitude_continuity()
    in order to be called from tesseroid_gravity(). We could use some numpy array properties, so there's no need to jit them. They must take the entire set of tesseroids and coordinates as arguments.

Are you willing to help implement and maintain this feature? Yes

@santisoler
Copy link
Member Author

Also, would be nice that error messages were more explicit now they won't be raised inside a Numba jitted function.

@santisoler santisoler added the enhancement Idea or request for a new feature label Jul 30, 2019
@santisoler santisoler added this to the v0.1.0 milestone Jul 30, 2019
leouieda pushed a commit that referenced this issue Aug 15, 2019
Refactor the functions that checks if tesseroids are well defined and no computation
points are inside tesseroids. Instead of being Numba jitted, they now make use of Numpy
array properties. The sanity checks are done on the public Python function that performs
the forward modelling instead of calling them on the Numba jitted functions so we can
control the error messages better and disable checks if more speed is desired. Make error
messages more explicit by showing which tesseroids or computation points are not valid.
Improve docstrings by specifying the shape of coordinates and tesseroids arrays. Extend
test functions for computation points inside tesseroids in case the longitudinal
coordinates of points are shifted by 360 degrees.

Fixes #84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant