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 detailed usage examples and 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 .
  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

    This will run ruff check and ruff format automatically when committing.

  2. Build the documentation and fail on warnings:

    cd docs
    make html SPHINXOPTS=-W

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.0

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.0
File Size Uploaded Provenance Actions
solarwindpy-0.4.0.tar.gz 739.5 kB Without provenance Details for solarwindpy-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 977.8 kB

Release files / solarwindpy-0.4.0.tar.gz

Download URL solarwindpy-0.4.0.tar.gz
Size 739.5 kB
Tags Source
SHA-256 checksum
How to use checksums
93d4195128ec704438187e5ac099e9a8b6cfa3266217ba42da0f9ad7bf6e2ab9
BLAKE2b-256 checksum
How to use checksums
8f28e6a382cf4cb25d0ce09eff8590e46dbe18717d9c5bd57b39949c58a5c24d
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.0-py3-none-any.whl

Download URL solarwindpy-0.4.0-py3-none-any.whl
Size 238.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
804c6e05dc77100ec2543615068a036ac97790a493d3a1cd32623fe093f4b29f
BLAKE2b-256 checksum
How to use checksums
860c4eecff7952c8089aef6dd52f4d65cb1e5c144c06dfd8187b9b8d7364f347
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.0

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