Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3ab39f7
docs: correct the development setup instructions
blalterman Nov 5, 2026
23115cd
docs(missing_data): name every quantity that takes a species total
blalterman Nov 5, 2026
5cd02de
docs: remove the documentation review plan page
blalterman Nov 5, 2026
023bd14
docs(conf): require the Sphinx the docs extra declares
blalterman Nov 5, 2026
6cade84
docs(quickstart): walk the example plasma from load to fit
blalterman Nov 5, 2026
93cf14a
ci(docs): publish the documentation on Read the Docs only
blalterman Nov 5, 2026
10ab52c
docs: scope the species-total and import-test wording
blalterman Nov 5, 2026
cd2ac64
docs: remove the quarterly documentation review process
blalterman Nov 5, 2026
2a9b008
docs(quickstart): answer a fresh reader's open questions
blalterman Nov 5, 2026
d42e15d
docs: state the fit uncertainty rule and the supported Python range
blalterman Nov 5, 2026
219ce1b
docs(missing-data): keep one worked table and name the section for it
blalterman Nov 5, 2026
ed9ae99
docs(usage): list the Plasma columns one tuple per line
blalterman Nov 5, 2026
02178ec
docs(quickstart): print the fit results tables and say how to read them
blalterman Nov 5, 2026
8703b4c
docs(usage): add a Make a Plot section with build-time figures
blalterman Nov 5, 2026
86f6dac
docs: copy examples without their prompts
blalterman Nov 5, 2026
127a722
test(docs): run rst examples under fixed pandas display options
blalterman Nov 5, 2026
9685ed0
docs: show pandas output instead of lists in the examples
blalterman Nov 5, 2026
2c31186
docs(api): title API pages and sections by their short names
blalterman Nov 5, 2026
a89338c
docs(quickstart): show the measurement level as its Index
blalterman Nov 5, 2026
a42c52a
docs(api): qualify repeated API page titles by their package path
blalterman Nov 5, 2026
793259c
docs(usage): show plot paths, filled and overlaid contours, fit labels
blalterman Nov 5, 2026
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
6 changes: 3 additions & 3 deletions .claude/docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ print(f\"Classifiers: {', '.join([c for c in data['info']['classifiers'] if 'Pro
**Expected Output**:
```
Version: X.Y.Z
Python: <4,>=3.11
Classifiers: Python :: 3.11, Python :: 3.12, Python :: 3.13
Python: <4,>=3.12
Classifiers: Programming Language :: Python :: 3, Programming Language :: Python :: 3.12, Programming Language :: Python :: 3.13, Programming Language :: Python :: 3.14
```

### 8. Enhance GitHub Release Notes (Optional)
Expand Down Expand Up @@ -385,7 +385,7 @@ After PR merge (2-4 hours for package build):

```bash
# Create test environment
conda create -n test-solarwindpy-release python=3.11 -y
conda create -n test-solarwindpy-release python=3.12 -y
conda activate test-solarwindpy-release

# Install from conda-forge
Expand Down
15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE/documentation_review.md

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,3 @@ jobs:
docs/build/coverage/
docs/build/linkcheck/
retention-days: 90

deploy:
needs: build
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-python@v7
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# Install pytables separately if needed by the package
pip install --verbose tables
pip install -e ".[docs]"

- name: Build documentation for deployment
working-directory: docs
run: |
make clean
make html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
cname: solarwindpy.github.io # If you have a custom domain
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- A quickstart page that runs end to end on `solarwindpy.examples.load_plasma`: the
`M`/`C`/`S` columns, derived quantities with their units, an `"a+p1"` total, a `Hist2D`
and a `Line` fit's `results`. It replaces the tutorial stub.
- A "Make a Plot" section in the Usage guide: when to use `Hist1D`, `Hist2D`, `SpiralPlot2D`
and `Scatter`, their bins, `axnorm` normalizations, contour smoothing, distribution edges and
`TeXlabel` labels, with figures drawn at build time by the code shown beside them. A test
runs each of those code blocks on its own.

### Changed

- `pre-commit install` now installs the commit-message hook as well as the pre-commit hook
(`default_install_hook_types` in `.pre-commit-config.yaml`), so the conventional-commit
check runs without a separate `pre-commit install --hook-type commit-msg`.
- Read the Docs (https://solarwindpy.readthedocs.io) is the only documentation host. The
package metadata lists it as the `Documentation` URL.

### Removed

- The GitHub Pages deployment of the documentation (the `deploy` job in
`.github/workflows/docs.yml`). The workflow still builds the docs with warnings as errors on
every push and pull request.

## [0.4.0] - 2026-11-05

Expand Down
40 changes: 10 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Thank you for considering contributing to SolarWindPy.
```bash
conda env create -f solarwindpy.yml
conda activate solarwindpy
pip install -e .
pip install -e ".[dev]"
```

2. Format code with `ruff format` and lint with `ruff check` (includes the pydocstyle rules).
Expand Down Expand Up @@ -80,22 +80,21 @@ pytest --doctest-glob='*.rst' docs/source -q
```

**Troubleshooting Common Issues:**
- **Import errors**: Ensure `pip install -e .` was run in development environment
- **Import errors**: Ensure `pip install -e ".[dev]"` was run in the development environment
- **Physics calculation failures**: Check units and verify against known results
- **Timeout issues**: Simplify examples or split into smaller components
- **Package import issues**: Use relative imports within solarwindpy modules

### Validation Framework Usage

**Framework Design Philosophy:**
- **Proportional complexity**: Tools match package scope (47 examples, not enterprise-scale)
- **Proportional complexity**: Tools match the package's scope
- **Essential focus**: Physics correctness over comprehensive metrics
- **Sustainable maintenance**: Appropriate for research package team capacity
- **User-friendly**: Simple workflow for researchers and contributors

**Full vs. Minimal Validation:**
- **Targeted validation** (`--targeted`): Focuses on core physics modules - use for most contributions
- **Full validation**: Tests all modules - use when making extensive changes
**Local vs. CI Validation:**
- **Local validation**: The two commands under "Local Testing Commands" above
- **CI validation**: Automated essential checks - runs on all pull requests

## Dependency Management
Expand Down Expand Up @@ -129,50 +128,31 @@ run the suite.
- **Version constraints**: Use lower bounds for compatibility, upper bounds for breaking changes
- **NumPy 2.0**: Ensure all dependencies support NumPy >=1.26,<3.0

## Documentation reviews

Documentation should be reviewed quarterly. Open an issue using the
"Documentation Review" template under `.github/ISSUE_TEMPLATE` to track the
review.

**Sustainable Review Process:**
- Focus on scientific accuracy of physics examples
- Verify core functionality examples still work
- Update validation approach if package scope changes significantly
- Annual assessment of validation framework appropriateness for current needs

## Validation Framework Maintenance

### Framework Sustainability Metrics
The validation framework has been right-sized for SolarWindPy's scope:
- **Framework size**: 570 lines (83% reduction from over-engineered 3,349 lines)
- **Execution time**: <5 minutes for full validation
- **Maintenance complexity**: Low (appropriate for research package team)
- **Example coverage**: 47 documentation examples (proportional tooling)

### Annual Framework Assessment
Review framework appropriateness annually:
1. **Scope verification**: Are we still at ~47 examples?
1. **Scope verification**: Is the tooling still proportional to the number of examples?
2. **Performance check**: Is validation completing in <5 minutes?
3. **Maintenance burden**: Can current team sustain framework complexity?
4. **Enhancement justification**: Are proposed additions necessary for current scope?

### Troubleshooting Validation Issues
**Common issues and solutions:**
- **Import errors**: Ensure `pip install -e .` in development environment
- **Import errors**: Ensure `pip install -e ".[dev]"` was run in the development environment
- **Physics calculation failures**: Check units and verify against known results
- **Timeout issues**: Use `--targeted` flag for faster critical module validation
- **Timeout issues**: Simplify examples or split into smaller components
- **Matplotlib compatibility**: Some doctest failures may be due to version differences (acceptable)

### Framework Enhancement Guidelines
Before adding complexity to validation framework:
1. **Justification**: Document why enhancement is needed for 47 examples
1. **Justification**: Document why the enhancement is needed for the current examples
2. **Proportionality**: Will enhancement maintain appropriate complexity level?
3. **Sustainability**: Can research team maintain enhanced framework?
4. **Alternative**: Could issue be addressed through simpler means?

**Enhancement approval criteria:**
- Addresses actual problem with current 47 examples
- Addresses an actual problem with the current examples
- Maintains <5 minute execution time
- Complexity remains appropriate for research package
- Team can sustain maintenance burden
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ After installation, import the package and create a plasma object with sample da
>>> 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.
See the `documentation <https://solarwindpy.readthedocs.io>`_ for the
quickstart, usage examples and the API reference.

Installation
============
Expand Down Expand Up @@ -93,7 +94,7 @@ Development

conda env create -f solarwindpy.yml
conda activate solarwindpy
pip install -e .
pip install -e ".[dev]"

3. Run the test suite with ``pytest``:

Expand All @@ -109,14 +110,19 @@ Development

pre-commit install

This will run ``ruff check`` and ``ruff format`` automatically when committing.
Each commit then runs ``ruff check``, ``ruff format`` and whitespace,
merge-conflict and large-file checks on staged Python files, ``doc8`` on
staged ``.rst``, ``.md`` and ``.py`` files, and the conventional-commit check
on the message. A commit that stages a ``.py`` file also runs the full test
suite with a coverage floor (``.claude/hooks/pre-commit-tests.sh``), and one
that stages a Python file under ``src/solarwindpy`` runs an import test.

5. Build the documentation and fail on warnings:

.. code-block:: bash

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


License
Expand Down
57 changes: 56 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@

Docstring examples that need a ``Plasma`` build one with
``solarwindpy.examples.load_plasma()``; no fixture injects one.

Every example, doctest or Sybil, runs under pandas' display defaults for a
session without a terminal (``PANDAS_DISPLAY``), so a printed Series or
DataFrame does not depend on the width of the terminal running pytest, and a
reader who copies an example sees the output it shows. Whitespace in an
expected output of an rst example is normalized, under Sybil and under the
doctest plugin alike; docstring examples keep exact whitespace.
"""

import doctest
from pathlib import Path

import pandas as pd
import pytest

# Doctest node id -> reason. Each entry names the defect that retires it.
Expand All @@ -42,6 +51,30 @@
"docs/source/tutorial/quickstart.rst",
"docs/source/installation.rst",
]

# pandas' own defaults when output is not a terminal, set explicitly so an
# example's printed table never follows the terminal pytest runs in.
PANDAS_DISPLAY = {
"display.width": 80,
"display.max_columns": 20,
"display.max_rows": 60,
"display.precision": 6,
}
_pandas_display_contexts = []


def _enter_pandas_display():
"""Apply ``PANDAS_DISPLAY`` until the matching ``_exit_pandas_display``."""
context = pd.option_context(*(x for item in PANDAS_DISPLAY.items() for x in item))
context.__enter__()
_pandas_display_contexts.append(context)


def _exit_pandas_display():
"""Restore the pandas options ``_enter_pandas_display`` replaced."""
_pandas_display_contexts.pop().__exit__(None, None, None)


_SYBIL_PATHS = {
Path(__file__).resolve().parent / document for document in SYBIL_DOCUMENTS
}
Expand All @@ -57,11 +90,30 @@
from sybil.parsers.rest import DocTestParser, PythonCodeBlockParser, SkipParser

pytest_collect_file = Sybil(
parsers=[DocTestParser(), PythonCodeBlockParser(), SkipParser()],
parsers=[
DocTestParser(optionflags=doctest.NORMALIZE_WHITESPACE),
PythonCodeBlockParser(),
SkipParser(),
],
patterns=SYBIL_DOCUMENTS,
setup=lambda namespace: _enter_pandas_display(),
teardown=lambda namespace: _exit_pandas_display(),
).pytest()


@pytest.fixture(autouse=True)
def _pandas_display_defaults(request):
"""Run each doctest under ``PANDAS_DISPLAY``; Sybil sets it per document."""
if not isinstance(request.node, pytest.DoctestItem):
yield
return
_enter_pandas_display()
try:
yield
finally:
_exit_pandas_display()


def _restore_document_order(items):
"""Put Sybil examples back in document line order, in their own slots."""
# Sorts the Sybil items by (path, line), so within each document the
Expand Down Expand Up @@ -93,6 +145,9 @@ def _deselect_doctest_duplicates(config, items):

def pytest_collection_modifyitems(config, items):
for item in items:
if isinstance(item, pytest.DoctestItem) and item.path.suffix == ".rst":
# One runner serves a file's examples, so this sets the file's flag.
item.runner.optionflags |= doctest.NORMALIZE_WHITESPACE
reason = DOCTEST_XFAIL.get(item.nodeid)
if reason is not None:
item.add_marker(pytest.mark.xfail(strict=True, reason=reason))
Expand Down
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ gitignored, and `make clean` removes it.

## Deployment

Documentation is automatically built and deployed to GitHub Pages via the `.github/workflows/docs.yml` workflow when changes are pushed to the `master` branch.
Read the Docs builds and hosts the documentation at https://solarwindpy.readthedocs.io,
configured by `.readthedocs.yaml`. The `.github/workflows/docs.yml` workflow builds the docs
with warnings as errors on every push and pull request; it does not deploy them.
11 changes: 11 additions & 0 deletions docs/source/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% if fullname in repeated_titles -%}
{{ fullname.split(".", 1)[1] | escape | underline }}
{%- else -%}
{{ objname | escape | underline }}
{%- endif %}

``from {{ module }} import {{ objname }}``

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}
8 changes: 7 additions & 1 deletion docs/source/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{ fullname | escape | underline}}
{% if fullname in repeated_titles -%}
{{ fullname.split(".", 1)[1] | escape | underline }}
{%- else -%}
{{ objname | escape | underline }}
{%- endif %}

``from {{ module }} import {{ objname }}``

.. currentmodule:: {{ module }}

Expand Down
10 changes: 8 additions & 2 deletions docs/source/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{ fullname | escape | underline}}
{% if fullname in repeated_titles -%}
{{ fullname.split(".", 1)[1] | escape | underline }}
{%- else -%}
{{ name | escape | underline }}
{%- endif %}

``import {{ fullname }}``

.. automodule:: {{ fullname }}
:no-members:
Expand Down Expand Up @@ -65,7 +71,7 @@
:recursive:

{% for item in modules %}
{{ item }}
~{{ item }}
{%- endfor %}

{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_templates/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h3>Quick Navigation</h3>
<ul class="sidebar-nav-list">
<li><a href="{{ pathto('installation') }}">Installation</a></li>
<li><a href="{{ pathto('usage') }}">Usage Guide</a></li>
<li><a href="{{ pathto('tutorial') }}">Tutorial</a></li>
<li><a href="{{ pathto('tutorial/quickstart') }}">Quickstart</a></li>
<li><a href="{{ pathto('api_reference') }}">API Reference</a></li>
</ul>
</div>
Expand Down
Loading
Loading