Skip to content

EBM base class and EBM0D & EBM1D variants#17

Merged
jordanplanders merged 5 commits into
mainfrom
ebm
May 26, 2026
Merged

EBM base class and EBM0D & EBM1D variants#17
jordanplanders merged 5 commits into
mainfrom
ebm

Conversation

@jordanplanders

Copy link
Copy Markdown
Collaborator

This pull request makes several significant changes to the codebase related to energy balance models (EBMs). The main updates include removing the legacy latitudinal_ebm model, consolidating all EBM functionality under the ebm module, and adding comprehensive tests and an example notebook for the new EBM implementations. These changes streamline the codebase, improve maintainability, and enhance test coverage.

EBM Model Refactoring and Cleanup

  • Removed the legacy LatitudinalEBM class and its module: The file paleobeasts/signal_models/latitudinal_ebm.py and all references to the old class have been deleted, ensuring only the new EBM implementations are used. [1] [2]

Documentation and Examples

  • Added a comprehensive quickstart Jupyter notebook: The new notebooks/model_demos/ebm_quickstart.ipynb provides a detailed walkthrough of the EBM0D and EBM1DLat models, including usage examples, parameter explanations, and visualizations.

Testing Improvements

These changes collectively modernize the EBM code, improve clarity for users, and ensure robust test coverage for both zero-dimensional and latitudinal EBM variants.

jordanplanders and others added 5 commits May 25, 2026 22:14
Split the previous monolithic EBM into a small hierarchy: EBMBase plus EBM0D (0D global-mean) and EBM1DLat (diffusive latitudinal) variants. Introduced module-level physics helpers (OLR_func, albedo_func, albedo_func1D) and moved latitudinal implementation into ebm.py, removing the separate latitudinal_ebm.py file and exporting the new classes from the package. Adjusted PBModel integrations and parameter resolution (get_param_value) and improved array/grid handling, diagnostics, and initial-state validation for the 1D model. Updated tests to use EBM0D, added new tests for EBM1DLat, and removed the old latitudinal_ebm tests.
Clarify and expand documentation across paleobeasts.signal_models.ebm: rewrite and enrich docstrings for OLR and albedo callables (including parameter and return descriptions and units), add explanatory notes and examples to EBMBase, EBM0D and EBM1DLat class docstrings, and document method behaviour for validate_initial_state, dydt, calc_albedo, calc_OLR, annual_mean_insolation, calc_diffusion, calc_global_mean, calc_ice_line_lat and populate_diagnostics_from_history. Adds default values, optional/return semantics, and implementation notes for parameter callables/Forcing objects. These are documentation-only changes intended to improve developer ergonomics and API clarity; no functional behavior was altered.
Force albedo_func and albedo_func1D to accept climate parameters as keyword-only (added '*' to signatures) to prevent accidental positional use and improve clarity. Also adjusted EBM0D.__init__ parameter order to place var_name earlier and move state/diagnostic variables after it. These are small API changes that may require updating callers that relied on the previous positional argument order.
Add notebooks/model_demos/ebm_quickstart.ipynb: a hands-on walkthrough for paleobeasts.signal_models.ebm demonstrating EBM0D and EBM1DLat. Documents class hierarchy and key parameters (forcing, OLR, C, albedo), shows minimal instantiation and integration examples, compares constant vs. temperature-dependent albedo (including bistability), provides a custom albedo example, and demonstrates EBM1DLat usage, diagnostics, and plotting. Intended as a usage/demo notebook (not a scientific analysis).
Merges origin/main (PR #16 forcing_fixes) into the ebm branch.
Conflict in test_signal_models_ebm.py resolved by keeping the
rewritten version from this branch. EBM0D.dydt updated to use
self.resolve_forcing(t) per the new PBModel convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jordanplanders jordanplanders linked an issue May 26, 2026 that may be closed by this pull request
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jordanplanders jordanplanders merged commit f2d77b2 into main May 26, 2026
2 checks passed
@jordanplanders jordanplanders linked an issue May 28, 2026 that may be closed by this pull request
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.

Update 0D EBM for new base class architecture Centralize EBM infrastructure

1 participant