Release 0.3.2#45
Merged
Merged
Conversation
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
# Conflicts: # CHANGELOG.md
Remove nrel-pysam: pure-scipy CEC 6-parameter fit (py3.14 unblock)
…idation # Conflicts: # CHANGELOG.md
Reject unknown config keys; stop mutating the input config during resolution
…ion-models # Conflicts: # CHANGELOG.md
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 0.3.2 into
main.Release metadata changes in this branch
pyproject.tomlversion0.3.1→0.3.2uv.lockbreos version →0.3.2CHANGELOG.md[Unreleased]→[0.3.2] - 2026-06-26CITATION.cff→0.3.2/2026-06-26(was left stale at0.3.0during the 0.3.1 release)Changes
nrel-pysamruntime dependency, replaced by the pure-scipy/pvlibbreos.cec_fit.fit_cec_params(Dobos 2012). Unblocks Python 3.14 and drops the temporary<3.14pin; reproduces the SAM fit to within 0.03% on max power and 0.004% on annual energy (validated against the nrel-pysam oracle).albedo/surface_type) and Perez coefficient inputs, plus matching CLI flags and per-array overrides. Defaultisotropicreproduces prior results bit-for-bit.resolve_pv_systemno longer mutates the caller's input config.Pre-release gates (run locally, all green)
ruff check+ruff format --check— cleanpytest tests/— 236 passedtools/verify_release_artifacts.py— wheel + sdist build, installed-wheel import, packaged data presentNot yet run:
sphinx-builddocs gate.Remaining (post-merge, intentionally not done here)
mainv0.3.2on the merge commit and let the Publish workflow push to PyPImain→develop