Skip to content

[Option Appraisal Module] [Package 1: Measures] Split 3: Adds new base Measure class#1279

Draft
spjuhel wants to merge 55 commits intodevelopfrom
feature/option-appraisal-new-measure-base
Draft

[Option Appraisal Module] [Package 1: Measures] Split 3: Adds new base Measure class#1279
spjuhel wants to merge 55 commits intodevelopfrom
feature/option-appraisal-new-measure-base

Conversation

@spjuhel
Copy link
Copy Markdown
Collaborator

@spjuhel spjuhel commented Apr 8, 2026

Changes proposed in this PR:

This PR brings the basis of the refactored Measure class, using closures (functions that return a function) to define the effects of a measure.

Important points:

  • Effects are separated by effects on Exposures, effects on Impfset, and on Hazard
  • The closures need to accept keyword arguments to enable effects that rely on something else than what the effect is applied on (i.e. year, other part of risk, etc...)
  • We always pass the Exposures, Impfset and Hazard objects as kwargs to the closures by default
  • We pass user-defined function through an allow_kwargs to make sure closures always accept kwargs.
  • Measure instances optionally have a _config attribute that contains a MeasureConfig if the measure was defined from such an object (and is therefore serializable).

PR Author Checklist

PR Reviewer Checklist

spjuhel added 30 commits April 2, 2026 11:45
Cleans-up, Docstringfies

Better to_dict, color parser, and post_inits

Removes duplicate docstring
…MADA-project/climada_python into feature/option-appraisal-dataclasses
spjuhel added 25 commits April 9, 2026 14:55
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