https://github.com/benbovy/pys2index

Python/NumPy compatible geographical index based on s2geometry

https://github.com/benbovy/pys2index

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
Last synced: 11 months ago · JSON representation

Repository

Python/NumPy compatible geographical index based on s2geometry

Basic Info
  • Host: GitHub
  • Owner: benbovy
  • License: bsd-3-clause
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 45.9 KB
Statistics
  • Stars: 21
  • Watchers: 3
  • Forks: 2
  • Open Issues: 6
  • Releases: 6
Created almost 6 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

pys2index

test status

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

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

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

All Time
  • Total Commits: 26
  • Total Committers: 2
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.038
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 10 Last month
Rankings
Dependent packages count: 10.0%
Stargazers count: 13.3%
Average: 16.9%
Dependent repos count: 21.7%
Forks count: 22.6%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: pys2index
  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 4
Rankings
Dependent repos count: 16.2%
Average: 46.0%
Stargazers count: 50.2%
Dependent packages count: 51.6%
Forks count: 66.1%
Last synced: 11 months ago

Dependencies

.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • mamba-org/setup-micromamba v1 composite
pyproject.toml pypi
  • numpy *