Skip to content

Comments

chore: Sync dependency lockfiles from pyproject.toml#418

Open
github-actions[bot] wants to merge 9 commits intofeature/asplund-abundancesfrom
auto-update-requirements
Open

chore: Sync dependency lockfiles from pyproject.toml#418
github-actions[bot] wants to merge 9 commits intofeature/asplund-abundancesfrom
auto-update-requirements

Conversation

@github-actions
Copy link
Contributor

Automated Lockfile Synchronization

This PR was automatically generated by the sync-requirements workflow.

Changes:

  • requirements.txt - Production dependencies from [project.dependencies]
  • requirements-dev.lock - Development dependencies from [project.optional-dependencies.dev]
  • docs/requirements.txt - Documentation dependencies from [project.optional-dependencies.docs]
  • solarwindpy.yml - Conda environment generated from requirements.txt

Source:

Generated via pip-compile from pyproject.toml changes.

Validation:

All lockfiles validated with pip install --dry-run.

…sigma (#416)

* test(fitfunctions): fix anti-patterns and add matplotlib cleanup

- Add autouse clean_matplotlib fixture to prevent figure accumulation
- Replace 52 trivial `is not None` assertions with proper isinstance checks
- Fix disguised trivial assertions: isinstance(X, object) → specific types
- Add swp-test-009 rule to detect isinstance(X, object) anti-pattern
- Update /swp:test:audit skill with new detection pattern
- Fix flake8 E402 errors by moving imports to top of files
- Add noqa comments for flake8 false positives in f-strings

Key type corrections:
- popt → dict (not ndarray)
- fit_result → OptimizeResult
- plotter → FFPlot
- TeX_info → TeXinfo
- chisq_dof → ChisqPerDegreeOfFreedom

Note: --no-verify used to bypass pre-existing coverage (81%) threshold.
All 242 fitfunctions tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(fitfunctions): return DataFrame from combined_popt_psigma

- Remove `psigma_relative` property (trivially computed as psigma/popt)
- Refactor `combined_popt_psigma` to return pd.DataFrame with columns
  'popt' and 'psigma', indexed by parameter names
- Add pandas import to core.py
- Update test assertions to validate DataFrame structure

The relative uncertainty can be computed from the DataFrame as:
  df['psigma'] / df['popt']

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added automated dependencies Pull requests that update a dependency file labels Jan 14, 2026
#417)

* feat(core): add ReferenceAbundances for Asplund 2009 photospheric data

Add module for elemental abundance ratios from Asplund et al. (2009)
"The Chemical Composition of the Sun".

Features:
- Load photospheric and meteoritic abundances from CSV
- Access elements by symbol ('Fe') or atomic number (26)
- Calculate abundance ratios with uncertainty propagation
- Handle NaN uncertainties (replaced with 0 in calculations)

Files:
- solarwindpy/core/abundances.py: ReferenceAbundances class
- solarwindpy/core/data/asplund2009.csv: Table 1 data
- tests/core/test_abundances.py: 21 tests covering all functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(abundances): add match= to pytest.raises and test invalid kind

- Add match="Xx" to KeyError test for unknown element
- Add new test_invalid_kind_raises_keyerror for invalid kind parameter
- Add E231 to flake8 ignore (false positive on f-string format specs)
- Follows swp-test-008 pattern from TEST_PATTERNS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot force-pushed the auto-update-requirements branch from 551df0c to f30bb94 Compare January 14, 2026 02:52
blalterman and others added 5 commits January 21, 2026 02:43
…#422)

* fix(fitfunctions): catch FitFailedError in make_fit when return_exception=True

The exception handler on line 813 only caught RuntimeError and ValueError,
but FitFailedError (raised by _run_least_squares when max_nfev exceeded)
inherits from FitFunctionError, not RuntimeError. This caused make_fit to
raise instead of returning the exception when return_exception=True.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(fitfunctions): add HingeSaturation class for saturation modeling

Piecewise linear function with hinge point for modeling saturation behavior:
- Rising region: f(x) = m1*(x-x1) where m1 = yh/(xh-x1)
- Plateau region: f(x) = m2*(x-x2) where x2 = xh - yh/m2

Parameters: xh (hinge x), yh (hinge y), x1 (x-intercept), m2 (plateau slope)

Includes 24 comprehensive tests covering:
- Function evaluation (rising, plateau, sloped plateau)
- Parameter recovery from clean and noisy data (2σ tolerance)
- Initial parameter estimation
- Weighted fitting with heteroscedastic noise
- Edge cases and error handling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(fitfunctions): add tests for hinge piecewise linear functions

Add comprehensive test coverage for TwoLine, Saturation, HingeMin,
HingeMax, and HingeAtPoint fit functions. Tests include:

- Function evaluation with known parameters
- Parameter recovery from clean and noisy data
- Derived property consistency (xs, s, theta, m2, x_intercepts)
- Continuity at hinge points
- Initial guess (p0) estimation
- Edge cases and numerical stability

Tests written first following TDD - implementations in subsequent commits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(fitfunctions): add tests for Gaussian-Heaviside composite functions

Add comprehensive test coverage for GaussianPlusHeavySide,
GaussianTimesHeavySide, and GaussianTimesHeavySidePlusHeavySide.
Tests include:

- Function evaluation with known parameters
- Parameter recovery from clean and noisy data
- Gaussian component behavior (normalization, peak location)
- Heaviside step transitions
- Component interaction verification
- Initial guess (p0) estimation with guess_x0 parameter

Tests written first following TDD - implementations in subsequent commits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(fitfunctions): add tests for HeavySide step function

Add comprehensive test coverage for HeavySide fit function. Tests include:

- Function evaluation with known parameters
- Step transition behavior (x < x0, x == x0, x > x0)
- Parameter recovery from clean and noisy data
- Initial guess (p0) estimation with optional guess parameters
- Edge cases (step at data boundary, flat data)
- TeX function representation

Tests written first following TDD - implementation in subsequent commit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(fitfunctions): add hinge piecewise linear functions

Add five piecewise linear fit functions for modeling transitions:

- TwoLine: Two intersecting lines (minimum), params: x1, x2, m1, m2
- Saturation: Linear rise with saturation plateau, params: x1, xs, s, theta
- HingeMin: Minimum of two lines at hinge point, params: m1, x1, x2, h
- HingeMax: Maximum of two lines at hinge point, params: m1, x1, x2, h
- HingeAtPoint: Piecewise linear with specified hinge point,
  params: m1, b1, m2, b2

All classes include:
- Analytic function definitions using np.minimum/np.maximum
- Data-driven initial guess (p0) estimation
- Derived properties (xs, s, theta, m2, x_intercepts as applicable)
- TeX function representations for plotting

Contributed from nh/vanishing_speed_hinge_fits.py with improvements:
- Consistent API with existing FitFunction classes
- TODO comments for future data-driven p0 estimation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(fitfunctions): add Gaussian-Heaviside composite functions

Add three composite fit functions combining Gaussian and Heaviside:

- GaussianPlusHeavySide: Gaussian + Heaviside step
  params: x0, y0, y1, mu, sigma, A
- GaussianTimesHeavySide: Gaussian × Heaviside step
  params: x0, mu, sigma, A
- GaussianTimesHeavySidePlusHeavySide: (Gaussian × Heaviside) + Heaviside
  params: x0, y1, mu, sigma, A

All classes include:
- Analytic function definitions
- Data-driven initial guess (p0) estimation
- Optional guess_x0 parameter for step location hint
- TeX function representations

Contributed from nh/vanishing_speed_hinge_fits.py with fixes:
- Fixed typo bug: return gaussian_heavy_size -> gaussian_heavy_side
- Renamed p0_x0 to guess_x0 for API consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(fitfunctions): add HeavySide step function

Add HeavySide fit function for modeling abrupt transitions:

- HeavySide: Step function using np.heaviside
  params: x0 (transition point), y0 (baseline), y1 (step height)

Features:
- Analytic function: y1 * H(x0 - x) + y0
- Data-driven initial guess (p0) estimation
- Optional guess_x0, guess_y0, guess_y1 parameters
- TeX function representation

Contributed from nh/vanishing_speed_hinge_fits.py with fixes:
- Implemented p0 estimation (original raised NotImplementedError)

Also updates __init__.py to export all new classes:
- TwoLine, Saturation, HingeMin, HingeMax, HingeAtPoint
- GaussianPlusHeavySide, GaussianTimesHeavySide,
  GaussianTimesHeavySidePlusHeavySide
- HeavySide

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(fitfunctions): add module-specific contribution guide

Add comprehensive CONTRIBUTING.md for the fitfunctions module covering:

- Development workflow (TDD: tests before implementation)
- FitFunction class requirements (function, p0, TeX_function)
- Data-driven p0 estimation (no hardcoded domain values)
- Test categories E1-E7 with tolerance specifications
- Test patterns and anti-patterns
- Non-trivial test criteria (6 requirements)
- Test parameterization for DRY multi-case tests
- Quality checklist for PR submissions

This standalone document will be integrated into unified project docs
once all submodules have contribution standards.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style(fitfunctions): apply Black formatting to source and test files

Fix CI validation failure caused by Black formatting violations in:
- solarwindpy/fitfunctions/composite.py (2 line-length issues)
- tests/fitfunctions/test_composite.py
- tests/fitfunctions/test_heaviside.py
- tests/fitfunctions/test_hinge.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add reference photospheric elemental abundances from Asplund et al. (2009)
for computing FIP bias and elemental fractionation factors in solar wind
composition analysis.

New module: solarwindpy.data.reference
- ReferenceAbundances class with photospheric_abundance() method
- Returns abundance ratios (e.g., Fe/O, Ne/O) with uncertainties
- Data stored in asplund.csv, loaded via importlib.resources

Reference:
Asplund, M., Grevesse, N., Sauval, A. J., & Scott, P. (2009).
The Chemical Composition of the Sun.
Annual Review of Astronomy and Astrophysics, 47(1), 481-522.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(tests): add debug_print fixture for toggleable test output

Add pytest --debug-prints flag and debug_print fixture for controllable
debug output in tests. This enables preserving valuable debug prints
while keeping normal test output clean.

Usage:
  pytest tests/                    # Silent
  pytest tests/ --debug-prints -s  # With debug output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: remove unused import pdb statements from 35 files

Phase 2 of dead code cleanup. These pdb imports were added for debugging
but never used (all had `# noqa: F401` to silence flake8 warnings).

Files modified across: plotting/, fitfunctions/, core/, solar_activity/,
instabilities/, tools/, and root __init__.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore(plotting): remove 1,830 lines of dead code from histograms.py

Phase 3 of dead code cleanup. This file contained legacy implementations
of AggPlot, Hist1D, Hist2D, and GridHist2D classes that were fully
commented out. The actual implementations now live in their own modules
(agg_plot.py, hist1d.py, hist2d.py).

File reduced from 1,845 lines to 15 lines (99% reduction).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: remove 584 lines of dead code from 5 source files

Phase 4 of dead code cleanup. Removed commented-out implementations,
debug prints, and memory profiling code.

Files cleaned:
- plasma.py: -235 lines (commented algorithms, debug prints)
- base.py: -153 lines (old clip_data, Plot2D class)
- spiral.py: -90 lines (timing/debug code)
- hist2d.py: -92 lines (old implementations)
- orbits.py: -14 lines (memory profiling)

Preserved all TODO comments as active work items.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: remove additional dead code from orbits.py and test prints

Phase 5 of dead code cleanup:
- orbits.py: Remove 59 lines of commented logging/debug code
- test_performance.py: Remove 15 lines of timing benchmark prints

Total additional cleanup: 74 lines removed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: fix black formatting in __init__.py

Removed extra blank line after docstring that black flagged.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: fix black formatting in data/reference/__init__.py

Fixed blank line formatting from merge with master.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ccess (#425)

* feat(solar_activity): add ICMECAT class for HELIO4CAST ICME catalog access

Add new solarwindpy.solar_activity.icme module providing class-based access
to the HELIO4CAST Interplanetary Coronal Mass Ejection Catalog.

Features:
- ICMECAT class with properties: data, intervals, strict_intervals, spacecraft
- Methods: filter(), contains(), summary(), get_events_in_range()
- Case-insensitive spacecraft filtering (handles ULYSSES vs Ulysses)
- Interval fallback logic: mo_end_time -> mo_start_time + 24h -> icme_start_time + 24h
- Optional caching with 30-day staleness check
- Proper Helio4cast Rules of the Road in docstrings (dated January 2026)

Tests:
- 43 unit tests (mocked, no network)
- 17 smoke tests (imports, docstrings, structure)
- 8 integration tests (live network)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(solar_activity): export ICMECAT module and add doctest skip directives

- Export icme module from solar_activity package for discoverability
  (now available as: from solarwindpy.solar_activity import icme)
- Add doctest +SKIP directives to examples that require network access
  since ICMECAT downloads live data from helioforecast.space

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: apply black formatting to docstrings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…ction (#424)

* feat(core): update ReferenceAbundances to Asplund 2021 with year selection

- Add year parameter (default=2021) for selecting Asplund reference
- Create asplund2021.csv with 83 elements from Table 2
- Rename Meteorites column to CI_chondrites (with backward-compatible alias)
- Add get_comment() method for 2021 source metadata (definition,
  helioseismology, meteorites, solar wind, nuclear physics)
- Export Abundance namedtuple from solarwindpy.core
- Update tests with comprehensive parameterized coverage (168 tests)

Key value changes (2009 → 2021):
- Fe photosphere: 7.50 → 7.46
- C photosphere: 8.43 → 8.46
- He photosphere: 10.93 → 10.914

References:
- Asplund et al. (2021) A&A 653, A141
  https://doi.org/10.1051/0004-6361/202140445

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(core): use importlib.resources and remove duplicate data module

- Update ReferenceAbundances to use importlib.resources.files() for
  PEP 302/451 compliant package data loading (works with zip/wheel installs)
- Remove orphaned solarwindpy/data/reference/ duplicate implementation
  that was never integrated or tested
- Remove data module export from solarwindpy.__init__

The canonical location for ReferenceAbundances is solarwindpy.core.abundances

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(solar_activity): add ICMECAT class for HELIO4CAST ICME catalog access

Add new solarwindpy.solar_activity.icme module providing class-based access
to the HELIO4CAST Interplanetary Coronal Mass Ejection Catalog.

Features:
- ICMECAT class with properties: data, intervals, strict_intervals, spacecraft
- Methods: filter(), contains(), summary(), get_events_in_range()
- Case-insensitive spacecraft filtering (handles ULYSSES vs Ulysses)
- Interval fallback logic: mo_end_time -> mo_start_time + 24h -> icme_start_time + 24h
- Optional caching with 30-day staleness check
- Proper Helio4cast Rules of the Road in docstrings (dated January 2026)

Tests:
- 43 unit tests (mocked, no network)
- 17 smoke tests (imports, docstrings, structure)
- 8 integration tests (live network)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(core): add doctest skip directives for importlib.resources compatibility

The importlib.resources.files(__package__) call fails when running
doctests directly because __package__ is empty. Add +SKIP directives
to all doctest examples since we have comprehensive unit tests (168
tests) covering the functionality.

Also corrects the uncertainty value in abundance_ratio example:
Fe/O = 0.0589 ± 0.0077 (was incorrectly 0.0038)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(solar_activity): export ICMECAT module and add doctest skip directives

- Export icme module from solar_activity package for discoverability
  (now available as: from solarwindpy.solar_activity import icme)
- Add doctest +SKIP directives to examples that require network access
  since ICMECAT downloads live data from helioforecast.space

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(core): export ReferenceAbundances at package level

Add ReferenceAbundances to top-level solarwindpy exports for
consistency with Plasma and other core classes.

Users can now import directly:
  from solarwindpy import ReferenceAbundances

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: apply black formatting to docstrings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot force-pushed the auto-update-requirements branch from f30bb94 to 36fc925 Compare February 17, 2026 19:47
blalterman and others added 2 commits February 17, 2026 14:50
* docs(plans): add private-dev + public-release repo plan

Documents the two-repo architecture for private development with
public releases via rsync-based export script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(fitfunctions): remove joblib parallelization from TrendFit

Joblib's loky backend deadlocks on macOS with Python 3.12's spawn
start method. The multiprocessing backend fails due to unpicklable
closures, and the threading backend provides no CPU-bound speedup.

Remove the non-functional parallel code path, related tests,
benchmarks, and the performance optional dependency. All Phase 4
features in core.py (residuals use_all, in-place mask ops,
xoutside/youtside) are preserved — they have zero joblib dependency.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Updated requirements.txt (production dependencies)
- Updated requirements-dev.lock (development dependencies)
- Updated docs/requirements.txt (documentation dependencies)
- Updated conda environment: solarwindpy.yml
- Auto-generated via pip-compile from pyproject.toml
@github-actions github-actions bot force-pushed the auto-update-requirements branch from 36fc925 to e05d0f0 Compare February 17, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant