Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9cd055b
ci:added pytest ci; modified readthedocs
feefladder Nov 11, 2025
e32b2d8
doc: catalog loading example working
feefladder Nov 11, 2025
6b0d73c
build: move docs/requirements.txt to pyproject.toml
feefladder Nov 11, 2025
ef036f9
doc: logo text-to-path
feefladder Nov 12, 2025
86475b6
doc: unremoved all-important api.rst
feefladder Nov 12, 2025
2a004cf
doc: fixed doctests by skipping most
feefladder Nov 17, 2025
b383dc7
doc: improve readdata error message with accepted datatypes
feefladder Nov 21, 2025
cfd3e2c
fix: remove __version__ string and add c++ documentation
feefladder Nov 24, 2025
e0675cf
ci: add doxygen to ci
feefladder Nov 24, 2025
75a0469
chore: fix typos sufix pix_blok_ also some doc comments
feefladder Nov 26, 2025
8ee1690
docs: cpp api docs improvement
feefladder Nov 26, 2025
1b02892
docs: organizing and dperecating extractArray{Rows/Cols}
feefladder Nov 26, 2025
9ef35a7
FIXME
feefladder Nov 26, 2025
ac16116
docs: made c++ groups, ordered skmap_bindings.cpp
feefladder Nov 26, 2025
ee83669
fmt: clang-format -i $(find . -iname "*.cpp" -o -iname "*.h")
feefladder Nov 26, 2025
067642e
build: changed CMake to include tests, now we build skmap as a static…
feefladder Nov 28, 2025
8b7437f
added unit test workflow
feefladder Nov 28, 2025
127523c
test: added tests and docs for data mangling functions
feefladder Dec 3, 2025
2d890ac
test: Added docs+unit tests for data manipulation primitives
feefladder Dec 5, 2025
0522550
docs: added docs, re-order functions so they appear in docs in a sens…
feefladder Dec 5, 2025
e14bd5a
ci: remove disabled tests from run since some are FIXME
feefladder Dec 5, 2025
e04c703
style: typo fix
feefladder Dec 8, 2025
f834258
fix: project failed to build due to misplaced }
feefladder Dec 12, 2025
b064f1e
test: added tests and docs for ParArray
feefladder Dec 12, 2025
46c5923
docs: moved ramble.md notes into COUNTRIBUTING.md
feefladder Dec 15, 2025
0044da4
refactor: moved environment declarations to single file
feefladder Dec 15, 2025
4b87be2
refactor: some reordering for docs
feefladder Dec 15, 2025
d4996d8
style: reorder imports
feefladder Dec 15, 2025
5579865
style: ruff lint --fix
feefladder Dec 15, 2025
a617f01
style: ruff check --unsafe-fix --fix and manually checked
feefladder Dec 15, 2025
19d01b5
test: test_overlay working, also some lint fixes
feefladder Dec 15, 2025
38103a7
ci: added import order lint and format check to ci
feefladder Dec 15, 2025
1728fdb
refactor: ruff lint fixes
feefladder Dec 15, 2025
4fbcc55
style: comment out unused vars
feefladder Dec 15, 2025
4355581
test: added tests+docs for computePercentiles
feefladder Dec 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .coverage
Binary file not shown.
26 changes: 26 additions & 0 deletions .github/workflows/gtest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: GTest

on:
push:
paths:
- '.github/workflows/gtest.yaml'
- 'skmap/src/**'
- 'skmap/include/**'
- 'tests/src/**'
- 'CMakeLists.txt'

jobs:
gtest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libgdal-dev build-essential
- name: run tests
run: |
cmake -B build -DTESTS=1 .
cmake --build build -j
./build/tests/src/unit_tests

39 changes: 39 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyTest

on:
push:
paths:
- '.github/workflows/pytest.yaml'
- 'skmap/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'setup.py'
- 'pyproject.toml'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev
gdal-config --version
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: "true"
- name: install with python ${{ matrix.python-version }}
run: |
gdal-config --version
uv pip install .[full,dev]
. .venv/bin/activate
- name: Run format and tests
run: |
ruff format --check
pytest
43 changes: 43 additions & 0 deletions .github/workflows/sphinx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python sphinx

on:
push:
paths:
- '.github/workflows/sphinx.yaml'
- 'docs/**'
- 'skmap/**'
- 'CMakeLists.txt'
- 'setup.py'
- 'pyproject.toml'

jobs:
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev pandoc doxygen build-essential
gdal-config --version
- name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@v7
with:
activate-environment: "true"
- name: Run doctests
run: |
gdal-config --version
uv pip install .[full,dev,docs]
doxygen
. .venv/bin/activate
sphinx-build -M doctest docs/ _build/
- name: Build docs
run: |
. .venv/bin/activate
sphinx-build docs/ _build/
rm -rf build/*.linux-*
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
__pycache__
build
build/
_build/
dist
*.egg*
.vscode
.ipynb_checkpoints
skmap_data
gapfilled
tmp*
docs/_build/
docs/_autosummary/
docs/notebooks/*.gpkg
*.aux.xml
Expand All @@ -19,3 +19,7 @@ skmap_test.ipynb
.cache/
html/
latex/
xml/
.*_cache/
.venv/
compile_commands.json
9 changes: 7 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ sphinx:

build:
os: ubuntu-24.04
apt_packages:
- libproj-dev
- libgeos-dev
- gdal-bin
- libgdal-dev
tools:
python: "3.13"
jobs:
Expand All @@ -17,5 +22,5 @@ build:
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- export UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv pip install . -r docs/requirements.txt
-
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv pip install .[full] -r docs/requirements.txt

55 changes: 43 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.15...3.26)
project(skmap_bindings LANGUAGES CXX)

option(TESTS "Build unit tests" OFF)

include(FetchContent)

FetchContent_Declare(
Expand Down Expand Up @@ -28,13 +30,6 @@ find_package(OpenMP REQUIRED)
message(STATUS "GDAL library: ${GDAL_LIBRARIES}")
message(STATUS "GDAL headers: ${GDAL_INCLUDE_DIRS}")

add_subdirectory("${pybind11_SOURCE_DIR}")

include_directories("${eigen_SOURCE_DIR}")
include_directories("${GDAL_INCLUDE_DIRS}")
include_directories(skmap/include)
include_directories(skmap/src)

include(CheckCXXCompilerFlag)

# List of AVX-512 flags to test
Expand Down Expand Up @@ -65,17 +60,53 @@ foreach(FLAG IN LISTS AVX512_CANDIDATES)
endforeach()

# Add all supported flags at once


if(AVX512_FLAGS)
# Always append -mfma when using AVX-512
list(APPEND AVX512_FLAGS -mfma)
add_compile_options(${AVX512_FLAGS})
message(STATUS "Final AVX-512 compile options: ${AVX512_FLAGS}")
endif()

# -------------------------
# LIBRARIES AND EXECS
# -------------------------

# create a core library for tests and bindings

# all sources EXCEPT bindings
set(
SOURCES
skmap/src/ParArray.cpp skmap/src/io/IoArray.cpp
skmap/src/transform/TransArray.cpp
)

set(SOURCES skmap/src/skmap_bindings.cpp skmap/src/ParArray.cpp skmap/src/io/IoArray.cpp skmap/src/transform/TransArray.cpp)
pybind11_add_module(skmap_bindings ${SOURCES})
add_library(skmap STATIC ${SOURCES})
# we need to tell the static library that it will become part of a shared library in the bindings
set_target_properties(skmap PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

target_link_libraries(skmap_bindings PRIVATE ${GDAL_LIBRARIES} OpenMP::OpenMP_CXX)
target_include_directories(skmap PUBLIC
${eigen_SOURCE_DIR}
${GDAL_INCLUDE_DIRS}
skmap/include
skmap/src
)
target_link_libraries(skmap PUBLIC ${GDAL_LIBRARIES} OpenMP::OpenMP_CXX)
if(AVX512_FLAGS)
target_compile_options(skmap PUBLIC ${AVX512_FLAGS})
endif()

# -------------------------
# Python bindings
# -------------------------

set(BINDINGS_SOURCES skmap/src/skmap_bindings.cpp)
pybind11_add_module(skmap_bindings ${BINDINGS_SOURCES})
target_link_libraries(skmap_bindings PRIVATE skmap)

# -------------------------
# Tests
# -------------------------
if(TESTS)
enable_testing()
add_subdirectory(tests/src)
endif()
62 changes: 56 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ For reporting issues and making feature suggestions please refer to the [issue t

### Initial setup

1. Clone the repo: `git clone https://github.com/openlandmap/scikit-map.git`
1. Clone the repo: `git clone git@github.com:openlandmap/scikit-map.git`
2. Install dependencies (not needed if only contributing documentation):
- for the Python package: `pip install -r requirements.txt` into a Python 3.6+ environment
- Documentation: `uv pip install .[full,dev,docs] sphinx-autobuild`
- Code: `uv` doesn't like editable installs with our setup, after the above, re-run: `pip install -e .[full,dev,docs]` into a Python 3.6+ environment

### Development
This will ensure that a change to python files triggers a rebuild, as well as running `doxygen` again.

### Development: Git

All changes to code and documentation should be made in a separate branch, created from an up-to-date local `main`. The **branch name** must refer a open issue (``i{ISSUE_ID}``):

Expand Down Expand Up @@ -71,15 +74,62 @@ Must be one of the following:

Based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

### Code conventions
### Documentation

`scikit-map` is a mixed Python/C++ project. It auto-builds documentation from Python and C++ docstrings.

1. For Python documentation live-updates run
```bash
sphinx-autobuild docs/ _build/ --watch xml/
```
2. For C++: in the top-level directory, run `doxygen` to create xml documentation for `skmap_bindings`
3. If you change C++ documentation, in a separate terminal run `doxygen` again and it will auto-update.

### Python code


#### Code conventions

We strongly prefer to submit code to `scikit-map` with [type hints](https://docs.python.org/3/library/typing.html). Additionally, we support Python versions as low as 3.8 and no code that uses syntax introduced in later versions of Python (e.g. the walrus operator) will be accepted.

Python code is formatted using ruff:

```bash
ruff format
```

There are currently no style restrictions guidelines imposed upon code contributions. This may change at a later date.

### C++ code

C++ code is formatted with clang-format:

```bash
# specify directories to omit build directory
find {skmap/,tests/} -iname "*.cpp" -o -iname "*.h" | xargs clang-format --verbose -i
```
#### Clangd language server

For code completion and intellisense. It needs a `compile_commands.json` at top-level. generate with:

```bash
cmake -B build -DTESTS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
mv build/compile_commands.json .
```
#### Unit tests

Unit tests with [`gtest`](https://google.github.io/googletest/quickstart-cmake.html) are included.

To run:

```bash
cmake -B build -DTESTS=1 . # only have to run once
cmake --build build -j && ./build/tests/src/unit_tests
```

### Versioning

We adthere to standard [semantic versioning](https://semver.org/). Since we release from `main` <!-- needs to be discussed -->
We adhere to standard [semantic versioning](https://semver.org/). Since we release from `main` <!-- needs to be discussed -->
all merge requests should be accompanied with a version increment and the responsibility for increasing the version number falls on the contributor merging a branch: when merging a request either increment the MINOR version and reset the PATCH version to zero (if the intent of the merge request is to add new features) or increment the PATCH version (if the merge request only contains bugfixes). When merging a branch made by another contributor (e.g. because they do not have the required permissions to do so) please confirm the intent of the merge request (i.e. which semver number needs to be incremented).

When incrementing the version of `scikit-map` it is enough to write the version change into [`__init__.py`](./skmap/__init__.py) in the appropriate branch.
When incrementing the version of `scikit-map` it is enough to write the version change into [`pyproject.toml`](./pyproject.toml) in the appropriate branch.
Loading