Skip to main content

SolarWindPy

Build Status Docs Status Ruff

PyPI Conda

Python License Zenodo

Python data analysis tools for solar wind measurements.

Quick Start

After installation, import the package and create a plasma object with sample data:

>>> import pandas as pd
>>> from solarwindpy.core.plasma import Plasma
>>> # Create sample solar wind data (3 time points)
>>> epoch = pd.date_range('2023-01-01', periods=3, freq='1h')
>>> columns = pd.MultiIndex.from_tuples([
...     ('n', '', 'p1'), ('n', '', 'a'),           # Number density
...     ('v', 'x', 'p1'), ('v', 'x', 'a'),         # Velocity components
...     ('v', 'y', 'p1'), ('v', 'y', 'a'),
...     ('v', 'z', 'p1'), ('v', 'z', 'a'),
...     ('w', 'par', 'p1'), ('w', 'par', 'a'),     # Thermal speeds
...     ('w', 'per', 'p1'), ('w', 'per', 'a'),
...     ('b', 'x', ''), ('b', 'y', ''), ('b', 'z', '')  # Magnetic field
... ], names=['M', 'C', 'S'])
>>> # Realistic solar wind values
>>> data = pd.DataFrame([
...     [5.0, 0.25, 400, 380, 10, 5, -20, -15, 30, 15, 25, 12, 3.5, -1.2, 0.8],
...     [8.0, 0.40, 450, 420, 15, 8, -25, -18, 35, 18, 28, 14, 4.1, -1.5, 1.2],
...     [7.1, 0.30, 420, 400, 12, 6, -22, -16, 32, 16, 26, 13, 3.8, -1.3, 0.9],
... ], index=epoch, columns=columns)
>>> # Create plasma object with protons and alphas
>>> plasma = Plasma(data, 'p1', 'a')
>>> # Access ion species
>>> print(plasma.species)
('a', 'p1')
>>> # Mean proton density: (5.0 + 8.0 + 7.1) / 3 = 6.7
>>> print(f"Proton density: {plasma.p1.n.mean():.1f} cm⁻³")
Proton density: 6.7 cm⁻³

See the documentation for the quickstart, usage examples and the API reference.

Installation

The supported Python versions and dependency ranges are declared in pyproject.toml (requires-python and dependencies); the PyPI page shows them for each published release.

SolarWindPy is available via PyPI and conda-forge:

User

Install from PyPI:

pip install solarwindpy

Or install from conda-forge:

conda install -c conda-forge solarwindpy

Development

  1. Fork the repository and clone your fork.

  2. Install development dependencies:

    git clone https://github.com/YOUR-USERNAME/SolarWindPy.git
    cd SolarWindPy
    pip install -e ".[dev]"  # Includes all dev tools

    Alternative (Conda environment):

    conda env create -f solarwindpy.yml
    conda activate solarwindpy
    pip install -e ".[dev]"
  3. Run the test suite with pytest:

    pytest -q

Note: pyproject.toml is the only dependency declaration; there are no lockfiles.

  1. Optionally install the pre-commit hooks:

    pre-commit install

    Each commit then runs the hooks that .pre-commit-config.yaml lists, and that file is the full list. Expect a commit that stages a .py file to run the full test suite.

  2. Build the documentation and fail on warnings:

    cd docs
    make html SPHINXOPTS="-W --keep-going -n"

License

SolarWindPy is licensed under a standard 3-clause BSD license. See LICENSE.

Acknowledging and Citing SolarWindPy

See CITATION.rst for instructions on citing SolarWindPy.

Metadata

Release files for solarwindpy 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solarwindpy 0.4.1
File Size Uploaded Provenance Actions
solarwindpy-0.4.1.tar.gz 751.5 kB Without provenance Details for solarwindpy-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for solarwindpy 0.4.1
File Interpreter ABI Platform Actions
solarwindpy-0.4.1-py3-none-any.whl Python 3 none any Details for solarwindpy-0.4.1-py3-none-any.whl

Total release size: 989.9 kB

Release files / solarwindpy-0.4.1.tar.gz

Download URL solarwindpy-0.4.1.tar.gz
Size 751.5 kB
Tags Source
SHA-256 checksum
How to use checksums
82b725800a30a1281ebdf4434d118df114f383433410a58cd0c0af93771c39af
BLAKE2b-256 checksum
How to use checksums
fe7c85b53526688feb6df741e67c80abf70c2fa8488d39286f2def17d1923c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / solarwindpy-0.4.1-py3-none-any.whl

Download URL solarwindpy-0.4.1-py3-none-any.whl
Size 238.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7304593cb93359b8db3f575f1e727128355e56d3f10505ac5e7c1a7482513b6f
BLAKE2b-256 checksum
How to use checksums
e1e95048b210bc8b9a2a69824bd7a59753652a78635ca463f312001cefbc1b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for solarwindpy 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page