Metadata-Version: 2.5
Name: skyborn
Version: 0.5.1
Summary: Atmospheric science research utilities
Project-URL: Homepage, https://github.com/skyborn-org/Skyborn
Project-URL: Documentation, https://skyborn.readthedocs.io/
Project-URL: Repository, https://github.com/skyborn-org/Skyborn
Project-URL: Bug Tracker, https://github.com/skyborn-org/Skyborn/issues
Author-email: Qianye Su <suqianye2000@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: atmospheric-science,climate,data-analysis,grib,meteorology,netcdf
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Requires-Dist: dask
Requires-Dist: matplotlib
Requires-Dist: metpy
Requires-Dist: netcdf4
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: scipy
Requires-Dist: skyborn-backend>=0.2.1
Requires-Dist: skyborn-plot>=0.2.0
Requires-Dist: skyborn-spharm>=0.2.0
Requires-Dist: statsmodels
Requires-Dist: tqdm
Requires-Dist: xarray
Provides-Extra: cdo
Requires-Dist: skyborn-cdo>=2.6.0.3; ((platform_system == 'Windows' and platform_machine == 'AMD64') or (platform_system == 'Linux' and platform_machine == 'x86_64') or (platform_system == 'Darwin' and platform_machine == 'arm64')) and extra == 'cdo'
Provides-Extra: dev
Requires-Dist: black>=22.12.0; extra == 'dev'
Requires-Dist: flake8>=5.0.4; extra == 'dev'
Requires-Dist: jupyterlab>=3.6.8; extra == 'dev'
Requires-Dist: mypy>=1.20.2; extra == 'dev'
Requires-Dist: pymannkendall>=1.4.3; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.4; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-nb>=0.17.2; extra == 'docs'
Requires-Dist: sphinx-book-theme>=1.1.4; extra == 'docs'
Requires-Dist: sphinx-copybutton>=0.5.2; extra == 'docs'
Requires-Dist: sphinx>=5.3.0; extra == 'docs'
Requires-Dist: toml>=0.10.2; extra == 'docs'
Provides-Extra: grib
Requires-Dist: cfgrib; extra == 'grib'
Requires-Dist: eccodes; extra == 'grib'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://github.com/skyborn-org/Skyborn" target="_blank">
    <img src="https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/_static/SkyBornLogo.svg" alt="Skyborn Logo" width="400"/>
  </a>
</p>

[![PyPI version](https://badge.fury.io/py/skyborn.svg)](https://badge.fury.io/py/skyborn)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/skyborn)](https://pypi.org/project/skyborn/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/skyborn)](https://pypi.org/project/skyborn/)
[![License](https://img.shields.io/github/license/skyborn-org/Skyborn)](https://github.com/skyborn-org/Skyborn/blob/main/LICENSE)
[![Tests](https://github.com/skyborn-org/Skyborn/actions/workflows/stable-ci.yml/badge.svg)](https://github.com/skyborn-org/Skyborn/actions/workflows/stable-ci.yml)
[![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-1D4E89)](https://github.com/skyborn-org/Skyborn)
[![Code style](https://img.shields.io/badge/code%20style-black-blue.svg)](https://github.com/psf/black)
[![Build Status](https://github.com/skyborn-org/Skyborn/actions/workflows/test-coverage.yml/badge.svg?branch=main)](https://github.com/skyborn-org/Skyborn/actions/workflows/test-coverage.yml?query=branch%3Amain)
[![Documentation](https://img.shields.io/badge/docs-Read%20the%20Docs-1B9E77)](https://skyborn.readthedocs.io/en/latest/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.18075252.svg)](https://doi.org/10.5281/zenodo.18075252)

## Architecture & Platform Support

**Skyborn** is a pure-Python orchestration toolkit (`py3-none-any` wheel, built with `hatchling`) powered by self-contained **Pure-Rust** compiled backend packages:

| Package | Latest | Role | Key Capabilities |
| :--- | :---: | :--- | :--- |
| **[`skyborn-backend`](https://github.com/skyborn-org/skyborn-backend)** | [![PyPI](https://img.shields.io/pypi/v/skyborn-backend)](https://pypi.org/project/skyborn-backend/) | Computational kernels (`_backend_rs`, PyO3 + Rayon) | Mann-Kendall &amp; Theil-Sen batch, GPI / CAPE / DCAPE / SRH, Poisson &amp; `SphericalPlan` gridfill, hybrid-to-pressure &amp; bilinear/conservative regridding, Eady growth rate, Lanczos filter, Liang/Granger causality |
| **[`skyborn-spharm`](https://github.com/skyborn-org/skyborn-spharm)** | [![PyPI](https://img.shields.io/pypi/v/skyborn-spharm)](https://pypi.org/project/skyborn-spharm/) | Spherical harmonic transforms (`_spharm_rs`, `faer` + `rustfft`) | Zero-copy C-order &amp; South-to-North (`S2N`) transforms, native `float32`/`float64`, ultra-high-res `F480` (`960×1920`), packed reduced Gaussian grids (`O80`–`O1280`), drop-in `pyspharm` &amp; `VectorWind` compatibility |
| **[`skyborn-plot`](https://github.com/skyborn-org/skyborn-plot)** | [![PyPI](https://img.shields.io/pypi/v/skyborn-plot)](https://pypi.org/project/skyborn-plot/) | Vector &amp; contour plotting (`_plot_rs`) | NCL-style `curly_vector` integration, batched glyph tracing &amp; candidate thinning, swept &amp; open contour arrow heads, `ref_length_px` cross-panel key scaling |
| **[`skyborn-cdo`](https://github.com/skyborn-org/Skyborn-cdo)** *(optional `[cdo]`)* | [![PyPI](https://img.shields.io/pypi/v/skyborn-cdo)](https://pypi.org/project/skyborn-cdo/) | Bundled CDO CLI wrapper | Pre-compiled Climate Data Operators (`cdo`) binary &amp; shared libraries |

<p align="center">
  <img src="assets/skyborn_architecture.svg" alt="Skyborn Pure-Python and Pure-Rust Ecosystem Architecture" width="880"/>
</p>

- **Cross-Platform First-Class Support**: Linux (`manylinux2014` `x86_64`), macOS (`arm64` / `x86_64`), and Windows (`win_amd64`), across **Python 3.9+**.
- **Zero Compiler or Fortran Runtime Dependencies**: Installing `skyborn` requires no `gfortran`, `libgfortran`, `Cython`, or `Meson` toolchain.

## Installation

Install `skyborn` and its Pure-Rust backends via `pip`:

```bash
pip install skyborn
```

To also install the optional bundled CDO binary (`skyborn-cdo`, supported on Linux `x86_64`, macOS `arm64`, and Windows `AMD64`):

```bash
pip install "skyborn[cdo]"
```

For GRIB support (`cfgrib` + `eccodes`):

```bash
pip install "skyborn[grib]"
```

## Documentation

**Full documentation is available at: [Documentation](https://skyborn.readthedocs.io/en/latest/)**

## Key Features & Submodules

### Spatial Trend Analysis & Climate Index Regression

Skyborn provides high-throughput spatial trend calculation, multidimensional Mann-Kendall testing, and climate index regression analysis for atmospheric datasets:

![Precipitation Trends Comparison](https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/images/precipitation_trends_comparison_1979_2014.png)

**Key Capabilities:**
- **Multidimensional Mann-Kendall & Theil-Sen Batch Kernels**: Supports original, Yue-Wang, Hamed-Rao, seasonal, correlated seasonal, grouped multivariate, regional, correlated multivariate, and partial Mann-Kendall workflows across `(time, lat, lon)` and `(time, level, lat, lon)` NumPy, xarray, and Dask arrays.
- **Linear Trend & Climate Index Regression**: Vectorized slope, correlation, and significance testing with NINO 3.4, PDO, NAO, and AMO indices.

### Skyborn Windspharm & Spharm Submodules

`skyborn.spharm` and `skyborn.windspharm` delegate directly to `skyborn-spharm` (`_spharm_rs`), delivering zero-copy C-order and `S2N` transforms for global rotational/divergent wind diagnostics (**streamfunction**, **velocity potential**, vorticity, divergence, Rossby wave source):

![Streamfunction and Velocity Potential](https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/images/windspharm_sfvp_analysis.png)

### Skyborn Gridfill Submodule

`skyborn.gridfill` provides physically consistent Poisson and spectral spherical-harmonic (`SphericalPlan`) gap filling for gridded atmospheric and oceanic datasets:

![Gridfill Missing Data Interpolation](https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/images/gridfill_demo_result_readme.png)

### Curly Vector Plotting

`skyborn.plot.curly_vector` provides an NCL-like curved-vector renderer for Matplotlib and Cartopy axes across regular lat-lon, curvilinear (WRF), and vertical latitude-pressure cross-sections:

![Curly Vector WRF Example](https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/images/wrf_curly_vector_integration_direction_density08_ref10.png)

![Curly Vector Vertical Profile Example](https://raw.githubusercontent.com/skyborn-org/Skyborn/main/docs/source/images/hadley_msf_v_omega_ncl_curly.png)

```python
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from skyborn.plot import curly_vector

fig = plt.figure(figsize=(12, 6))
ax = plt.axes(projection=ccrs.Robinson(central_longitude=180))

curly_vector(
    ds,
    x="longitude",
    y="latitude",
    u="u",
    v="v",
    ax=ax,
    transform=ccrs.PlateCarree(),
    density=0.9,
    color="black",
    arrowstyle="->",
    linewidth=1.2,
    arrowsize=1.2,
    zorder=3,
    integration_direction="both",
    ref_magnitude=30.0,
    ref_length=0.1,
)
ax.coastlines()
ax.set_global()
```

## Pure-Rust Performance Highlights

*Measured on Apple M5 (`arm64`, 10 CPU, 32 GB RAM) comparing Pure-Rust releases against legacy Fortran/C/Cython and external Python libraries (`pymannkendall`, `tcpyPI`):*

<p align="center">
  <img src="assets/skyborn_benchmarks.svg" alt="Skyborn Pure-Rust Ecosystem Performance Benchmarks" width="880"/>
</p>

- **Climate Trend & Causality (`skyborn-backend`)**: Up to **633.3×** faster Mann–Kendall Hamed–Rao and **566.9×** faster Original MK than `pymannkendall` with exact `tau`/`z` parity (`0.0` diff), plus **19.73×** faster Sen's slope batches and **9.77×** faster Poisson `gridfill` than legacy Cython.
- **Tropical Cyclone Intensity & Thermo (`skyborn-backend`)**: **11.22×** faster gridded GPI than `tcpyPI` (`2.33 ms` vs `26.18 ms` on `2,048` profiles) with Emanuel `JMIN` numerical parity (`1.57e-4 m/s` max `vmax` diff), sustaining **533,941 profiles/s** on global `2.5°` grids.
- **Spherical Harmonics & Plotting (`skyborn-spharm` / `skyborn-plot`)**: Sub-millisecond to few-millisecond `S2N` C-order transforms supporting `F480` (`960×1920`) and `O80`–`O1280` reduced Gaussian grids, paired with up to **24.80×** faster contour/curly-vector geometry kernels.

## Citation

If you use Skyborn in your research, please cite it using the following format:

```bibtex
@software{su2025skyborn,
  author = {Su, Qianye},
  title = {Skyborn: Climate Data Analysis Toolkit},
  year = {2025},
  doi = {10.5281/zenodo.18075252},
  url = {https://doi.org/10.5281/zenodo.18075252}
}
```

Or in text:
> Su, Q. (2025). Skyborn: Climate Data Analysis Toolkit. Zenodo. https://doi.org/10.5281/zenodo.18075252
