https://github.com/benbovy/pys2index
Python/NumPy compatible geographical index based on s2geometry
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.7%) to scientific vocabulary
Repository
Python/NumPy compatible geographical index based on s2geometry
Basic Info
Statistics
- Stars: 21
- Watchers: 3
- Forks: 2
- Open Issues: 6
- Releases: 6
Metadata Files
README.md
pys2index
Python / NumPy compatible geographical index based on s2geometry.
This project doesn't provide Python wrappers for the whole s2geometry library.
Instead, it aims to provide some index wrappers with an API similar to
scipy.spatial.cKDTree.
Build Dependencies
- C++17 compiler
- CMake
- s2geometry
- scikit-build-core
- xtensor-python
- pybind11
- Python
- NumPy
Installation
Using conda
pys2index can be installed using conda (or mamba):
bash
$ conda install pys2index -c conda-forge
From source
First, clone this repository:
bash
$ git clone https://github.com/benbovy/pys2index
$ cd pys2index
You can install all the dependencies using conda (or mamba):
bash
$ conda install python cxx-compiler numpy s2geometry pybind11 xtensor-python cmake scikit-build-core -c conda-forge
Build and install this library
bash
$ python -m pip install . --no-build-isolation
Usage
```python In [1]: import numpy as np
In [2]: from pys2index import S2PointIndex
In [3]: latlon_points = np.array([[40.0, 15.0], ...: [-20.0, 53.0], ...: [81.0, 153.0]]) ...:
In [4]: index = S2PointIndex(latlon_points)
In [5]: query_points = np.array([[-10.0, 60.0], ...: [45.0, -20.0], ...: [75.0, 122.0]]) ...:
In [6]: distances, positions = index.query(query_points)
In [7]: distances Out[7]: array([12.06534671, 26.07312392, 8.60671311])
In [8]: positions Out[8]: array([1, 0, 2])
In [9]: index.getcellids() Out[9]: array([1386017682036854979, 2415595305706115691, 6525033740530229539], dtype=uint64)
```
Running the tests
Running the tests requires pytest (it is also available on conda-forge).
bash
$ pytest .
Owner
- Name: Benoit Bovy
- Login: benbovy
- Kind: user
- Location: Liège (Belgium) / Berlin
- Twitter: benbovy
- Repositories: 96
- Profile: https://github.com/benbovy
Earth scientist, software developer, musician
GitHub Events
Total
- Issues event: 1
- Issue comment event: 4
- Push event: 7
- Pull request event: 1
- Create event: 1
Last Year
- Issues event: 1
- Issue comment event: 4
- Push event: 7
- Pull request event: 1
- Create event: 1
Committers
Last synced: about 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Benoit Bovy | b****y@g****m | 25 |
| Benoit Bovy | b****y@g****e | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 3
- Total pull requests: 13
- Average time to close issues: 5 months
- Average time to close pull requests: 3 months
- Total issue authors: 3
- Total pull request authors: 4
- Average comments per issue: 3.0
- Average comments per pull request: 0.54
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 1
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- zklaus (1)
- carloshorn (1)
- valeriupredoi (1)
Pull Request Authors
- benbovy (8)
- pre-commit-ci[bot] (2)
- carloshorn (2)
- zklaus (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 10 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 5
(may contain duplicates) - Total versions: 4
- Total maintainers: 1
pypi.org: pys2index
Python/NumPy compatible geographical index based on s2geometry
- Documentation: https://pys2index.readthedocs.io/
- License: BSD-3-Clause
-
Latest release: 0.1.5
published over 2 years ago
Rankings
Maintainers (1)
conda-forge.org: pys2index
- Homepage: https://github.com/benbovy/pys2index
- License: BSD-3-Clause
-
Latest release: 0.1.3
published about 4 years ago
Rankings
Dependencies
- actions/checkout v2 composite
- mamba-org/setup-micromamba v1 composite
- numpy *