Skip to content

v1.0.2#358

Merged
aaTman merged 77 commits into
mainfrom
develop
Apr 30, 2026
Merged

v1.0.2#358
aaTman merged 77 commits into
mainfrom
develop

Conversation

@aaTman
Copy link
Copy Markdown
Collaborator

@aaTman aaTman commented Apr 10, 2026

What's Changed

New Contributors

Full Changelog: v1.0.1...v1.0.2

aaTman and others added 30 commits January 11, 2026 15:41
* update duration with handling spatial dims, remove compute, fix sparse lead time dim generation

* update name on metric in tests

* add docstring for time res arg
* move function out of run, move cache mkdir to init

* add tests for new func

* ruff

* update parallel_config passthrough and tests
* implements a new Forecast object that can wrap existing xarray datasets

* Revise per copilot review
* update docstrings and var namings

* rename vars, add test

* ruff
…305)

* update naming

* default preprocess for applied_tc

* ruff

* ruff
* remove cases top level of yaml and fix code to handle this

* remove old load events yaml function

* update validation precommit and formatting
* dependencies and generate store file started

* in-flight, added and cleaned filter funcs

* add icechunk + obstore and cira icechunk generation script

* remove cira gen script no longer used

* code cleanup

* add icechunk datatree forecast class object

* uv lock

* add documentation, group helper func, and add repository kwargs passthrough

* remove icechunk forecast object

* typo

* ruff
* update all references to IndividualCaseCollection and convert dicts/ "cases": keys to lists

* update template

* make questions bold

* add whitespace

* remove indent error and typo from evaluate_cli

* make load_individual_cases include passthrough for existing dataclasses

* ruff

* add comment for clarification on list comp

* ruff (again)

* remove all references to collection, replace with list

* ruff

* rename collection -> list

* ruff
* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes
* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos
* move cache dir creation to init, rename funcs, add parallel/serial check function, update test names

* update naming

* add run method for backwards compatibility

* update tests

* add tests and cover if serial and parallel_config is not None

* feat: redesign public API with hierarchical namespace submodules

- Add ewb.evaluation() as main entry point (alias for ExtremeWeatherBench)
- Create namespace submodules: ewb.targets, ewb.forecasts, ewb.metrics,
  ewb.derived, ewb.regions, ewb.cases, ewb.defaults
- Expose all classes at top level for convenience (ewb.ERA5, etc.)
- Add ewb.load_cases() convenience alias
- Update all example files to use new import pattern
- Update usage.md documentation
- Maintain backward compatibility with existing imports

* ruff/linting. add utils to init

* add test coverage for module loading patterns

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* update defaults var refs
* first pass for gt test infra + yaml

* use shapefile for severe convection and catch latitude swap

* add ignore for golden test when running pytest by default

* ruff

* move pytest addopts and markers to pyproject.toml

* Remove `IndividualCaseCollection` (#317)

* update all references to IndividualCaseCollection and convert dicts/ "cases": keys to lists

* update template

* make questions bold

* add whitespace

* remove indent error and typo from evaluate_cli

* make load_individual_cases include passthrough for existing dataclasses

* ruff

* add comment for clarification on list comp

* ruff (again)

* remove all references to collection, replace with list

* ruff

* rename collection -> list

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* Bump version from 0.2.0 to 0.3.0 (#324)

* Updated API (#321)

* move cache dir creation to init, rename funcs, add parallel/serial check function, update test names

* update naming

* add run method for backwards compatibility

* update tests

* add tests and cover if serial and parallel_config is not None

* feat: redesign public API with hierarchical namespace submodules

- Add ewb.evaluation() as main entry point (alias for ExtremeWeatherBench)
- Create namespace submodules: ewb.targets, ewb.forecasts, ewb.metrics,
  ewb.derived, ewb.regions, ewb.cases, ewb.defaults
- Expose all classes at top level for convenience (ewb.ERA5, etc.)
- Add ewb.load_cases() convenience alias
- Update all example files to use new import pattern
- Update usage.md documentation
- Maintain backward compatibility with existing imports

* ruff/linting. add utils to init

* add test coverage for module loading patterns

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* update defaults var refs

* remove to_csv
* update build-system and project

* update workflows, publish, and pyproject

* add justfile and twine

* update publish yaml

* change to python 3.10 as minimum requirement

* kerchunk needs 3.11, swapping pyproject and tests to remove 3.10

* change workflows to use version matrix

* align workflows

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* Bump version from 0.2.0 to 0.3.0 (#324)

* Updated API (#321)

* move cache dir creation to init, rename funcs, add parallel/serial check function, update test names

* update naming

* add run method for backwards compatibility

* update tests

* add tests and cover if serial and parallel_config is not None

* feat: redesign public API with hierarchical namespace submodules

- Add ewb.evaluation() as main entry point (alias for ExtremeWeatherBench)
- Create namespace submodules: ewb.targets, ewb.forecasts, ewb.metrics,
  ewb.derived, ewb.regions, ewb.cases, ewb.defaults
- Expose all classes at top level for convenience (ewb.ERA5, etc.)
- Add ewb.load_cases() convenience alias
- Update all example files to use new import pattern
- Update usage.md documentation
- Maintain backward compatibility with existing imports

* ruff/linting. add utils to init

* add test coverage for module loading patterns

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* update defaults var refs

* Golden tests (#323)

* first pass for gt test infra + yaml

* use shapefile for severe convection and catch latitude swap

* add ignore for golden test when running pytest by default

* ruff

* move pytest addopts and markers to pyproject.toml

* Remove `IndividualCaseCollection` (#317)

* update all references to IndividualCaseCollection and convert dicts/ "cases": keys to lists

* update template

* make questions bold

* add whitespace

* remove indent error and typo from evaluate_cli

* make load_individual_cases include passthrough for existing dataclasses

* ruff

* add comment for clarification on list comp

* ruff (again)

* remove all references to collection, replace with list

* ruff

* rename collection -> list

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* Bump version from 0.2.0 to 0.3.0 (#324)

* Updated API (#321)

* move cache dir creation to init, rename funcs, add parallel/serial check function, update test names

* update naming

* add run method for backwards compatibility

* update tests

* add tests and cover if serial and parallel_config is not None

* feat: redesign public API with hierarchical namespace submodules

- Add ewb.evaluation() as main entry point (alias for ExtremeWeatherBench)
- Create namespace submodules: ewb.targets, ewb.forecasts, ewb.metrics,
  ewb.derived, ewb.regions, ewb.cases, ewb.defaults
- Expose all classes at top level for convenience (ewb.ERA5, etc.)
- Add ewb.load_cases() convenience alias
- Update all example files to use new import pattern
- Update usage.md documentation
- Maintain backward compatibility with existing imports

* ruff/linting. add utils to init

* add test coverage for module loading patterns

* ruff

* Cleanup docstrings in repo (#318)

* update these docstrings

* remove docstring changes markdown

* update docstrings

* update other docstrings

* remove individualcasecollection reference, update based on develop changes

* add explanation for dim reqs (#320)

* Update `defaults` and `inputs` to include new CIRA icechunk store (#319)

* more explicit naming, add func and model names var

* add test coverage, ruff, linting

* update readme for new cira approach

* move cira func and model ref to inputs

* update docs

* module wasnt called for moved func

* update tests for moving func and var

* ruff

* fix mock typos

* update defaults var refs

* remove to_csv

* swap pyproject tools to hatch; add if and packages-dir to publish
* chore: remove duplicate function and fixtures

- Remove duplicate _parallel_serial_config_check function from evaluate.py
  (was defined twice at lines 189 and 982 with identical implementation)
- Remove duplicate runner fixture from test_evaluate_cli.py
  (already defined in conftest.py)
- Remove duplicate temp_config_dir fixture from test_evaluate_cli.py
  (already defined in conftest.py)
- Remove unused tempfile import from test_evaluate_cli.py

* ruff
* update ar calcs with improved parallelization

* ruff formatting

* update attr name

* remove diagnostic logging; ruff formatting; update ar bounds code to work, add zarr 3 warning catch, add optional time dimension str arg

* more ar_bounds work to get it moving, looks good here

* mypy

* mypy

* update time to valid_time to follow ewb conventions
aaTman and others added 29 commits April 2, 2026 15:12
* add preprocessors to defaults and include in applied_heatwave script

* add preprocess to remove ocean gridpoints

* don't need two functions doing the same thing
* add in all files, plots, and tests

* add ignore for test

* change file names, add plotting scripts, improve parallelization

* freeze -> cold

* update imports

* add min_gridpoints arg and return empty df

* remove tests for data prep

* update file names in comments

* remove old heat and cold bounds script

* manage longitude conversions

* longitude shenanigans
* add optional arg and conditional

* update with tests to confirm functionality

* update tests
* add scripts

* rename script, combine into one

* ruff
* update heat and cold bounds, update docstrings and methodology. add base_temp_events.yaml for reproducibility

* add defaults; remove top python line

* add lat min and max args

* ruff + mypy

* add restriction criteria and method

* add animation code

* simplify to include climatology bound(s), fix func names

* update animate

* ruff

* remove animate script

* rename

* update with rename
* first pass bounds updates

* second pass to expand bounds
* add new duration method

* update duration logic with consecutive pair logic

* adjust test to match new duration logic
* add some parallelism and stricter event criteria

* smaller batching

* update default batch

* update event bounds; case shift issue

* rename

* ruff
* modify criteria slightly

* make event_type heat_wave in marginal temp events

* update tracker to fill in-between lead time points for a valid track

* update defaults

* update  return next landfall logic to metric

* add neighborhood max wind func and add track gap filler

* update stitching criteria and tests

* add extra column allowance

* add a bunch of landfall methods

* add empty init time array method

* update landfall metrics methods and add metadata inclusion (small data increase. lots of value)

* ruff

* add landfall filter to within window of valid landfall

* cleanup
* add > 15 degree filter for ARs

* ruff
…364)

* refactor: consolidate temp data_prep scripts into temperature_events.py

Merges heat_cold_bounds_case.py, plot_temperature_events.py, and
temperature_bounds_global.py into a single temperature_events.py with
three subcommands (plot / case / global). Preserves develop behavior
exactly: original _wrap_periodically formula, no ndimage landmass
isolation, numpy-based detect_events / expand_event_bounds /
include_temps_with_events, and no --event-quantiles flag.

Made-with: Cursor

* ruff

* cleanup unused funcs and args

* consistent operators

* ruff
#367)

np.random.normal(500, 200) for orographic heights occasionally draws
extreme negative values (e.g. -320 m below sea level), which push the
barometric-formula surface pressure above the test's 105 000 Pa bound.
The failure was latent but surfaced on Python 3.13 due to a different
RNG initialisation state.

Replace all np.random.* calls in the fixture with a local seeded
np.random.default_rng(42) instance so generated data is bit-reproducible
across Python versions and the pressure range assertion holds reliably.
* fix: correct three CIN bugs in mixed-layer CAPE/CIN computation

Three bugs in _cape.py caused CIN to be unreliable (sign wrong, magnitude
wrong, and false-LFC suppression). Discovered by benchmarking against xcape
and atmos on 6,400 ERA5 profiles.

Bug 1 — Sign convention: compute_buoyancy_energy_inline returns negative
values below the LFC; the raw accumulation was returned without negation,
producing negative CIN where callers expect a positive inhibition energy
(matching MetPy and xcape conventions). Fixed by negating cin at both return
sites.

Bug 2 — Integration scope: the LFC branch accumulated all buoyancy energy
unconditionally (including positively-buoyant layers between surface and LFC),
reducing CIN when a parcel had brief near-surface positive buoyancy before
encountering a cap. Added `if energy < 0` guard to match the no-LFC branch
and the behaviour of reference implementations.

Bug 3 — Spurious LCL buoyancy (critical): insert_lcl_level set the inserted
level's environment temperature to t_lcl (the parcel's saturation temperature)
instead of interpolating the actual atmospheric temperature in log-pressure.
This made env_tv ≈ parcel_tv at the LCL, injecting a +1-2 K buoyancy spike
that was detected as an LFC, hiding the real capping inversion above and
driving CIN to near-zero for profiles with low LCLs and strong cap inversions.

Adds TestCINSignConvention, TestCINIntegrationScope, and
TestLCLTemperatureInterpolation test classes with profiles that specifically
exercise each bug path and will catch regressions.

* fix: address Bugbot review comments on CIN convention consistency

- Document CIN sign convention in compute_ml_cape_cin_from_profile docstring:
  returned as a non-negative inhibition magnitude matching MetPy/xcape.
- Negate MetPy's negative-signed CIN in the reference data generator so
  stored cin_reference values match the implementation's positive convention;
  update both era5_reference.npz and pathological_profiles.npz accordingly.
- Rename expected_cin_range to expected_cin_magnitude_range in TestKnownProfile
  to make the positive convention explicit at the call site.
- Strengthen TestCINIntegrationScope: replace the weak cin >= 0 assertion with
  a quantitative lower bound (>50 J/kg) that would catch the original bug
  where positive near-surface buoyancy cancelled cap-layer CIN.

* fix: remove pytest.mark.flaky (pytest-rerunfailures not in deps)
@aaTman aaTman merged commit 4c99664 into main Apr 30, 2026
8 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.

4 participants