Skip to content

Release 0.3.2#45

Merged
Str4vinci merged 19 commits into
mainfrom
release/0.3.2
Jun 26, 2026
Merged

Release 0.3.2#45
Str4vinci merged 19 commits into
mainfrom
release/0.3.2

Conversation

@Str4vinci

@Str4vinci Str4vinci commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Release 0.3.2 into main.

Release metadata changes in this branch

  • pyproject.toml version 0.3.10.3.2
  • uv.lock breos version → 0.3.2
  • CHANGELOG.md [Unreleased][0.3.2] - 2026-06-26
  • CITATION.cff0.3.2 / 2026-06-26 (was left stale at 0.3.0 during the 0.3.1 release)

Changes

  • Removed the nrel-pysam runtime dependency, replaced by the pure-scipy/pvlib breos.cec_fit.fit_cec_params (Dobos 2012). Unblocks Python 3.14 and drops the temporary <3.14 pin; reproduces the SAM fit to within 0.03% on max power and 0.004% on annual energy (validated against the nrel-pysam oracle).
  • Added configurable sky-diffusion (transposition) models with ground reflectance (albedo/surface_type) and Perez coefficient inputs, plus matching CLI flags and per-array overrides. Default isotropic reproduces prior results bit-for-bit.
  • Added strict config validation: unknown top-level keys now raise instead of silently defaulting; resolve_pv_system no longer mutates the caller's input config.

Pre-release gates (run locally, all green)

  • ruff check + ruff format --check — clean
  • pytest tests/ — 236 passed
  • tools/verify_release_artifacts.py — wheel + sdist build, installed-wheel import, packaged data present

Not yet run: sphinx-build docs gate.

Remaining (post-merge, intentionally not done here)

  • Merge this PR into main
  • Tag v0.3.2 on the merge commit and let the Publish workflow push to PyPI
  • Create the GitHub Release
  • Back-merge maindevelop

Str4vinci added 19 commits June 24, 2026 00:18
Refresh 0.3.0 onboarding and CLI discovery
- Strict config validation with unknown-key rejection (silent-typo guard)
- Declarative config schema to remove four-places-per-parameter drift
- Parameter sweeps / batch runs for many-config research workflows
Thread a transposition_model option through the PV production functions
(calculate_pv_production_dc, the tracking and multi-array variants, and the
TMY/AC wrappers), the App config surface, and the CLI (--transposition-model
/ --sky-model). Supports the isotropic baseline plus the klucher, haydavies,
reindl, king, perez, and perez-driesse models from pvlib's
get_total_irradiance.

The extra inputs the anisotropic models need (extraterrestrial DNI and
relative airmass) are derived internally from the time index and solar
position, so no new weather columns are required. Passing them does not
change the isotropic result, which stays the default and is reproduced
bit-for-bit. Per-array overrides are supported in pv_arrays, and config
validation rejects unknown model names early.

Targets the 0.3.1 roadmap item.
Add an allowed-key check to validate_config so a misspelled top-level key
(e.g. batery_kwh) raises listing the offending key instead of being silently
dropped by merge_defaults and defaulting — a footgun for batch/parametric
studies that returned plausible-but-wrong numbers. The allowed set is derived
from DEFAULTS plus the required inputs and the optional montecarlo section, so
it stays in sync as config keys are added.

Also stop resolve_pv_system from writing the derived n_modules back into the
merged config in place. It now returns the resolved count and resolve_app_config
materialises it into a fresh dict, so the dict wrapped by the frozen
ResolvedAppConfig is built once and the caller's input dict is left untouched.

Targets the 0.3.1 roadmap config-validation items.
The transposition work enabled all seven pvlib sky-diffusion models, but their
site-specific inputs were hardcoded. Add three optional, validated parameters
threaded the same way as transposition_model:

- albedo (0-1) or a named surface_type (snow, sea, grass, ...) sets the
  ground reflectance for the ground-diffuse component, which every model uses;
  previously fixed at pvlib's 0.25 default. The two are mutually exclusive.
- model_perez selects the Perez coefficient set, used only by the perez model.

All three are App config keys with matching --albedo / --surface-type /
--perez-model CLI flags and per-array overrides in pv_arrays. Validation is
consolidated in app_config._validate_sky_settings (shared by the top level and
each array) and in solar's runtime helpers. Not setting them leaves results
bit-for-bit unchanged.

Validated against pvlib's surface-albedo and Perez coefficient tables.
nrel-pysam was only reached transitively, via pvlib's fit_cec_sam, to fit
the CEC single-diode parameters on the default PV path. It publishes no
Python 3.14 wheel or sdist and was the sole 3.14 blocker.

Add breos/cec_fit.py: a pure-scipy/pvlib implementation of the CEC
6-parameter coefficient calculator (Dobos 2012, DOI:10.1115/1.4005759),
a drop-in for fit_cec_sam. solar._get_cec_params now calls it; the cache
and public API are unchanged. Across every bundled module it reproduces
the SAM fit to within 0.03% on Pmp over a T x G grid and 0.004% on annual
energy, validated against the nrel-pysam oracle by tools/validate_cec_fit.py.

Also:
- Replace the two placeholder Generic catalog modules with realistic
  mono-PERC specs (their made-up values fit cleanly under SAM only via an
  internal Isc heuristic); nameplate power and keys are unchanged.
- Add Python 3.14 to the classifiers and CI matrix.
- Add tests/test_cec_fit.py; update CHANGELOG, ATTRIBUTIONS, and the
  third-party-wrapping architecture note.
Back-merge 0.3.1 release into develop
Remove nrel-pysam: pure-scipy CEC 6-parameter fit (py3.14 unblock)
Reject unknown config keys; stop mutating the input config during resolution
Configurable sky-diffusion transposition model, ground albedo, and Perez coefficients
…, strict config validation

Finalize the [Unreleased] changelog section as [0.3.2], bump pyproject and
uv.lock to 0.3.2, and update the stale CITATION.cff (was left at 0.3.0 in the
0.3.1 release).

Release content over 0.3.1 (all already on develop): removal of the nrel-pysam
runtime dependency via the pure-scipy/pvlib breos.cec_fit CEC fit (unblocks
Python 3.14, drops the <3.14 pin); configurable sky-diffusion transposition
models with ground reflectance and Perez coefficients; config validation that
rejects unknown keys and no longer mutates the input config.
Point citation tools at the journal article (Rodrigues, Delgado, Mendes,
Guimarães), currently under submission, via a CFF preferred-citation block.
Co-authors listed with the initials provided; expand to full names once known.
@Str4vinci Str4vinci marked this pull request as ready for review June 26, 2026 14:24
@Str4vinci Str4vinci merged commit 7529900 into main Jun 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant