Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Bug report
description: Wrong result, crash or installation failure.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for the report. For security problems, use the private
[vulnerability report](https://github.com/ap-base/apbase-python/security/advisories/new) instead.
- type: textarea
id: description
attributes:
label: What happened
description: What went wrong, and the full error message or traceback if there is one.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Minimal example
description: The smallest script (and data, if small) that shows the problem.
render: python
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: input
id: version
attributes:
label: apbase version
placeholder: "0.1.3"
validations:
required: true
- type: dropdown
id: platform
attributes:
label: Platform
options:
- Linux x86_64
- macOS arm64 (Apple Silicon)
- macOS x86_64 (Intel)
- Windows x86_64
- Other
validations:
required: true
- type: input
id: python
attributes:
label: Python version
description: Output of `python --version`.
validations:
required: true
- type: textarea
id: environment
attributes:
label: Other environment details
description: How apbase was installed (PyPI wheel or git), NumPy, pyproj and Shapely versions, anything else relevant.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://apbase.io
about: Guides and API reference.
- name: Questions and ideas
url: https://github.com/ap-base/apbase-python/discussions
about: Ask how to use APbase or discuss ideas before opening an issue.
- name: Security vulnerability
url: https://github.com/ap-base/apbase-python/security/advisories/new
about: Report security problems privately.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Feature request
description: Suggest a new method, option or improvement.
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What are you trying to do, and what is missing or hard today?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposal
description: How you would like it to work (API sketch, references, example data).
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
sudo apt-get install --no-install-recommends -y libgfortran5 libgomp1 libopenblas0-pthread

- name: Install package and test dependencies
run: python -m pip install . pytest geopandas
run: python -m pip install ".[test]"

- name: Check native extension
run: python -c "from apbase._native._lib import lib; lib.load()"
Expand Down
107 changes: 107 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Changelog

All notable changes to the `apbase` package are documented here. The format
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the
project uses [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added

- Cokriging section in the README and `apbase.cross_variogram` in the module
list; `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `CITATION.cff`
and issue templates.
- `test` extra (`pip install "apbase[test]"`) with the test dependencies
(pytest, geopandas).
- Package keywords and classifiers (Python versions, operating systems,
topics).
- `CoKriging`, `co_kriging` and `cross_validate_cokriging` options
`max_colocation_dist` (pairing distance for the cross-covariances of
heterotopic secondaries) and `max_secondary_neighbors` (secondary neighbor
limit of ICM and LMC; `None` keeps `max_neighbors`).

### Fixed

- ICM and LMC cokriging estimated no cross-covariance for a secondary that
does not share the primary's sample locations (for example, a raster): the
fit silently set it to zero, and dense secondaries then left the block system
singular (NaN estimates) or unstable. The new `max_colocation_dist` option
pairs each primary sample with its nearest secondary point within that
distance; without it, every method raises a `ValueError` naming the
secondary instead of fitting a zero cross-covariance.
- With the gaussian model, ICM, LMC and collocated cokriging (and their
cross-validation) give each variable a nugget of at least 0.01% of its sill.
A gaussian model without nugget over close sources produced exploding
estimates; models with a larger nugget, and the other models, are unchanged.

### Changed

- The README states that installing from git works only on Linux x86_64 with
Python 3.14; other platforms install the wheels from PyPI.

## [0.1.3] - 2026-10-17

### Changed

- Results no longer depend on the unit of the values: variogram fits (now
Cressie-weighted) and the kriging and cokriging systems are scale-invariant.
- Covariate screening tolerates a 10% excess over the Cauchy-Schwarz bound of
the cross-variogram.
- ICM cokriging projects its coregionalization matrices onto the
positive-semidefinite cone; LMC reports projection and allocation failures
as errors instead of returning an invalid fit.
- `cross_validate_cokriging` leaves out of `by_method` and `model_params` a
method whose model cannot be fitted, instead of failing the call; the first
fit error is raised only when no method can be fitted.

### Fixed

- Collocated cokriging raises a `ValueError` naming the secondary when it has
too few samples at the primary locations to estimate its correlation, instead
of producing NaN estimates.
- The native loader no longer returns the compiled extension instead of its
facade after the first import.

## [0.1.2] - 2026-10-15

### Changed

- The default search radius (no `radius` given) is the variogram `range` below
10 000 points and `range / 3` from there on (was always `range / 3`).
- When fewer than `min_neighbors` sources lie within the search radius, IDW,
kriging, cokriging and cross-validation use the `max_neighbors` nearest, so
every target inside the boundary gets a value.

## [0.1.1] - 2026-09-21

### Added

- First release on PyPI, with wheels for Linux (x86_64), macOS (arm64 and
x86_64) and Windows (x86_64), for CPython 3.12, 3.13 and 3.14.

### Changed

- The top-level namespace exposes only `Map`, `create_map` and `config`; the
geostatistical building blocks are imported from their submodules
(`apbase.idw`, `apbase.kriging`, `apbase.cokriging`, ...).
- Shorter PyPI README with links to the documentation at https://apbase.io;
package metadata links the documentation, source and issues.
- Expanded docstrings and input validation across the public API.

## [0.1.0] - 2026-09-09

### Added

- First release, on GitHub: `Map` and `create_map`, an automated map pipeline that filters
the source data, converts geographic coordinates when needed, builds the
target grid, fits a shared variogram, cross-validates IDW against ordinary
kriging and keeps the better map.
- Modules `filtering`, `grid`, `variogram`, `idw`, `kriging`, `cokriging`
(collocated, ICM and LMC), `cross_variogram` and `cross_validate`, backed by
native Fortran kernels with OpenMP.

[Unreleased]: https://github.com/ap-base/apbase-python/compare/0.1.3...HEAD
[0.1.3]: https://github.com/ap-base/apbase-python/compare/0.1.2...0.1.3
[0.1.2]: https://github.com/ap-base/apbase-python/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/ap-base/apbase-python/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/ap-base/apbase-python/releases/tag/0.1.0
27 changes: 27 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cff-version: 1.2.0
message: "If you use APbase in your work, please cite it as below."
type: software
title: "APbase"
abstract: >-
APbase is an intelligent mapping pipeline for irregular field data,
including yield monitor, soil samples, and sensor grids. It automates the
map workflow: filtering source data, handling geographic coordinates when
needed, building the target grid, comparing interpolation methods (IDW,
ordinary kriging, cokriging), and selecting a ready-to-use map without
requiring users to choose a mathematical model by hand.
authors:
- given-names: "Leonardo Felipe"
family-names: "Maldaner"
orcid: "https://orcid.org/0000-0003-2675-767X"
version: "0.1.3"
date-released: "2026-10-17"
license: Apache-2.0
url: "https://apbase.io"
repository-code: "https://github.com/ap-base/apbase-python"
keywords:
- geostatistics
- kriging
- cokriging
- interpolation
- precision agriculture
- python
84 changes: 84 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [leonardofm@alumni.usp.br](mailto:leonardofm@alumni.usp.br). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
Loading
Loading