Skip to content

Commit fe9462c

Browse files
DOC: add installation section (#92)
* add install section + reformat index * doc environment: update pins Avoid issues in new versions of pydata-sphinx-theme or sphinx-book-theme, e.g., pydata/pydata-sphinx-theme#2067 * update README * update CI Check links in markdown files. * minor tweaks * Update README.md Add link to documentation for installation from source instructions. Co-authored-by: Joris Van den Bossche <[email protected]> --------- Co-authored-by: Joris Van den Bossche <[email protected]>
1 parent 64e3c5f commit fe9462c

File tree

8 files changed

+195
-106
lines changed

8 files changed

+195
-106
lines changed

.github/workflows/lint.yaml renamed to .github/workflows/ci-additional.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,29 @@ on:
44
pull_request:
55
branches: [main]
66

7-
name: Lint
7+
name: CI Additional
88

99
jobs:
10-
lint:
11-
name: mypy
10+
check-links:
11+
name: Check markdown hyperlinks
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
17+
- name: Markdown link check
18+
uses: gaurav-nelson/github-action-markdown-link-check@v1
19+
20+
mypy:
21+
name: Mypy
1222
runs-on: ubuntu-latest
1323
defaults:
1424
run:
1525
shell: bash -l {0}
1626

1727
steps:
1828
- name: Checkout repo
19-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
2030

2131
- name: Setup micromamba
2232
uses: mamba-org/setup-micromamba@v1

.github/workflows/run-tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repo
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141

4242
- name: Get Date
4343
id: get-date
@@ -55,7 +55,7 @@ jobs:
5555
python=${{ matrix.python-version }}
5656
5757
- name: Fetch s2geography
58-
uses: actions/checkout@v3
58+
uses: actions/checkout@v4
5959
with:
6060
repository: paleolimbot/s2geography
6161
ref: main
@@ -100,7 +100,7 @@ jobs:
100100
pytest . -vv
101101
102102
- name: Generate and upload coverage report
103-
uses: codecov/codecov-action@v3
103+
uses: codecov/codecov-action@v5
104104
with:
105105
gcov: true
106106
gcov_include: src

README.md

Lines changed: 22 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,78 +13,41 @@ the widely deployed open-source geometry library
1313
[s2geography](https://github.com/paleolimbot/s2geography) which provides a
1414
[GEOS](https://libgeos.org) compatibility layer on top of s2geometry.
1515

16-
This library is at an early stage of development.
17-
18-
## Requirements
19-
20-
- Python
21-
- Numpy
22-
- [s2geography](https://github.com/paleolimbot/s2geography) v0.2.0 or higher
23-
- [s2geometry](https://github.com/google/s2geometry) v0.11.1 or higher
24-
25-
Additional requirements when building spherely from source:
26-
27-
- C++ compiler supporting C++17 standard
28-
- CMake
29-
- [scikit-build-core](https://github.com/scikit-build/scikit-build-core)
30-
31-
(Note: C++11 or C++14 should work too but we have no plan to maintain
32-
compatibility with those older standards)
16+
**This library is at an early stage of development.**
3317

3418
## Installation
3519

36-
There is no pre-compiled package available at the moment. See the section below
37-
for instructions on how to setup a development environment and build / install
38-
spherely from source.
20+
The easiest way to install Spherely is via its binary packages available for
21+
Linux, MacOS, and Windows platforms on [conda-forge](https://conda-forge.org/)
22+
and [PyPI](https://pypi.org/project/spherely/).
3923

40-
## Setting up a development environment using conda
24+
Install the binary wheel using [pip](https://pip.pypa.io/):
4125

42-
After cloning this repo, create a conda environment using the `ci/environment.yml`
43-
file with the required dependencies:
44-
45-
```
46-
$ conda env create -f spherely/ci/environment.yml
47-
$ conda activate spherely-dev
26+
``` sh
27+
$ pip install spherely
4828
```
4929

50-
Build and install `s2spherely`:
30+
Install the conda-forge package using
31+
[conda](https://docs.conda.io/projects/conda/en/stable/):
5132

52-
```
53-
$ cd spherely
54-
$ python -m pip install . -v --no-build-isolation
33+
``` sh
34+
$ conda install spherely --channel conda-forge
5535
```
5636

57-
Note that you can specify a build directory in order to avoid rebuilding the
58-
whole library from scratch each time after editing the code (requires
59-
scikit-build-core v0.2.0+):
37+
To compile and install Spherely from source, see detailed instructions in the
38+
[documentation](https://spherely.readthedocs.io/en/latest/install.html).
6039

61-
```
62-
$ python -m pip install . -v --no-build-isolation --config-settings build-dir=build/skbuild
63-
```
64-
65-
Run the tests:
66-
67-
```
68-
$ pytest . -v
69-
```
70-
71-
Spherely also uses [pre-commit](https://pre-commit.com/) for code
72-
auto-formatting and linting at every commit. After installing it, you can enable
73-
pre-commit hooks with the following command:
40+
## Documentation
7441

75-
```
76-
$ pre-commit install
77-
```
42+
https://spherely.readthedocs.io
7843

79-
(Note: you can skip the pre-commit checks with `git commit --no-verify`)
44+
## License
8045

81-
## Using the latest s2geography version
46+
Spherely is licensed under BSD 3-Clause license. See the LICENSE file for more
47+
details.
8248

83-
If you want to compile spherely against the latest version of s2geography, use:
49+
## Acknowledgment
8450

85-
```
86-
$ git clone https://github.com/paleolimbot/s2geography
87-
$ cmake -S s2geography -B s2geography/build -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
88-
$ cmake --build s2geography/build
89-
$ cmake --install s2geography/build
90-
```
51+
The development of this project has been supported by two
52+
[NumFOCUS](https://numfocus.org) Small Development Grants (GeoPandas 2022 round
53+
1 and GeoPandas 2023 round 3).

docs/conf.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# -*- coding: utf-8 -*-
22

3+
import spherely
4+
35
project = "spherely"
6+
author = "Spherely developers"
47
copyright = "2022, Spherely Developers"
5-
author = "Benoit Bovy"
8+
# The short X.Y version.
9+
version = spherely.__version__.split("+")[0]
10+
# The full version, including alpha/beta/rc tags.
11+
release = spherely.__version__
612

713
# -- General configuration ----------------------------------------------
814

@@ -32,11 +38,12 @@
3238
"array-like": ":term:`array-like <array_like>`",
3339
}
3440

35-
# source_suffix = ['.rst', '.md']
36-
source_suffix = ".rst"
41+
source_suffix = [".rst", ".md"]
3742

3843
master_doc = "index"
3944

45+
language = "en"
46+
4047
exclude_patterns = [
4148
"**.ipynb_checkpoints",
4249
"build/**.ipynb",
@@ -56,13 +63,11 @@
5663
html_theme_options = dict(
5764
repository_url="https://github.com/benbovy/spherely",
5865
repository_branch="main",
59-
path_to_docs="doc",
66+
path_to_docs="docs",
6067
use_edit_page_button=True,
6168
use_repository_button=True,
6269
use_issues_button=True,
6370
home_page_in_toc=False,
64-
extra_navbar="",
65-
navbar_footer_text="",
6671
)
6772

6873
html_static_path = ["_static"]

docs/environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: spherely-docs
33
channels:
44
- conda-forge
55
dependencies:
6-
- python=3.10
6+
- python=3.11
77
- numpy
88
- cxx-compiler
99
- cmake
@@ -12,8 +12,8 @@ dependencies:
1212
- s2geography>=0.2.0
1313
- libabseil
1414
- sphinx
15-
- pydata-sphinx-theme>=0.8.1
16-
- sphinx-book-theme>=0.3.3
15+
- pydata-sphinx-theme=0.15.4
16+
- sphinx-book-theme=1.1.3
1717
- myst-nb
1818
- pip
1919
# TODO: install the library here when s2geography is packaged

docs/index.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Spherely Documentation
2+
3+
Manipulation and analysis of geometric objects on the sphere.
4+
5+
Spherely is the counterpart of [Shapely] (2.0+) for manipulation and analysis
6+
of spherical geometric objects. It is using the widely deployed open-source
7+
geometry library [s2geometry] via the library [s2geography] which provides a
8+
[GEOS] compatibility layer on top of s2geometry.
9+
10+
**This library is at an early stage of development.**
11+
12+
**Useful links**:
13+
[Home](http://spherely.readthedocs.io/) |
14+
[Code Repository](https://github.com/benbovy/spherely) |
15+
[Issues](https://github.com/benbovy/spherely/issues) |
16+
[Discussions](https://github.com/benbovy/spherely/discussions) |
17+
[Releases](https://github.com/benbovy/spherely/releases)
18+
19+
## Contents
20+
21+
```{toctree}
22+
:maxdepth: 1
23+
24+
install
25+
api
26+
```
27+
28+
## Acknowledgment
29+
30+
The development of this project has been supported by two
31+
[NumFOCUS] Small Development Grants (GeoPandas 2022 round
32+
1 and GeoPandas 2023 round 3).
33+
34+
[Shapely]: https://shapely.readthedocs.io
35+
[s2geometry]: https://s2geometry.io
36+
[s2geography]: https://github.com/paleolimbot/s2geography
37+
[GEOS]: https://libgeos.org
38+
[NumFOCUS]: https://numfocus.org

docs/index.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)