Skip to content

Use protected _validate_initial_state hook#19

Open
jordanplanders wants to merge 1 commit into
mainfrom
ebm
Open

Use protected _validate_initial_state hook#19
jordanplanders wants to merge 1 commit into
mainfrom
ebm

Conversation

@jordanplanders

Copy link
Copy Markdown
Collaborator

Rename PBModel.validate_initial_state to a protected hook _validate_initial_state and update its caller in integrate(). Update docstrings to describe the protected hook and that subclasses should override it; base implementation still delegates to the utils/solver helper.

In EBM1DLat, switch the override to _validate_initial_state, update docs to reference the new hook, add a numerical-stability note (explicit RK4 diffusion CFL-like limit; with default params use dt ≤ 0.1) and change the example integration dt to 0.1. Also add a guard in the hemisphere-edge detection to propagate NaN (append NaN and continue) when the temperature slice contains NaNs from a diverged integration.

Rename PBModel.validate_initial_state to a protected hook _validate_initial_state and update its caller in integrate(). Update docstrings to describe the protected hook and that subclasses should override it; base implementation still delegates to the utils/solver helper.

In EBM1DLat, switch the override to _validate_initial_state, update docs to reference the new hook, add a numerical-stability note (explicit RK4 diffusion CFL-like limit; with default params use dt ≤ 0.1) and change the example integration dt to 0.1. Also add a guard in the hemisphere-edge detection to propagate NaN (append NaN and continue) when the temperature slice contains NaNs from a diverged integration.
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