-
Notifications
You must be signed in to change notification settings - Fork 0
chore: pyinterp version 2026.2.0 #3
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
base: main
Are you sure you want to change the base?
Changes from all commits
310491d
39d2a8a
b0756d3
f3dc678
f9644c5
9dc6e18
6ac73ff
1ddc904
1ff2a9e
71fd627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| """Adapts the distance computation to multiple data shapes.""" | ||
|
|
||
| import numpy as np | ||
| from pyinterp.geodetic import Spheroid, coordinate_distances | ||
| from pyinterp.geometry.geographic import Point, Spheroid | ||
| from pyinterp.geometry.geographic.algorithms import distance | ||
|
|
||
| from fcollections.utilities.reshape import slice_along_axis | ||
|
|
||
|
|
@@ -81,6 +82,16 @@ def distances_along_axis( | |
| return distances_along_axis | ||
|
|
||
|
|
||
| def _coordinate_distances(lon1, lat1, lon2, lat2, spheroid: Spheroid = Spheroid()): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commentaire de FB suite à ma remontée de la fonction manquante:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cette fonction n'est pas dans une version taggée du paquet. J'attends la prochaine release du coup ? |
||
| distances = np.array( | ||
| [ | ||
| distance(Point(lo1, la1), Point(lo2, la2), spheroid=spheroid) | ||
| for lo1, la1, lo2, la2 in zip(lon1, lat1, lon2, lat2) | ||
| ] | ||
| ) | ||
| return distances | ||
|
|
||
|
|
||
| def _spheroid_distances_along_axis( | ||
| longitudes: np.ndarray, | ||
| latitudes: np.ndarray, | ||
|
|
@@ -94,8 +105,8 @@ def _spheroid_distances_along_axis( | |
| lat1 = slice_along_axis(latitudes, axis, slice(1, None)) | ||
|
|
||
| # Compute distance on ellipsoid | ||
| return coordinate_distances( | ||
| lon0.ravel(), lat0.ravel(), lon1.ravel(), lat1.ravel(), wgs=wgs | ||
| return _coordinate_distances( | ||
| lon0.ravel(), lat0.ravel(), lon1.ravel(), lat1.ravel(), spheroid=wgs | ||
| ).reshape(lon0.shape) | ||
|
|
||
|
|
||
|
|
||
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.
Est-ce que tu sais quel module déclenche cet avertissement ?
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.
pyftpdlib