Conversation
|
Excellent idea! |
Cleans-up, Docstringfies Better to_dict, color parser, and post_inits Removes duplicate docstring
…MADA-project/climada_python into feature/option-appraisal-dataclasses
MeasureConfig dataclasses for serializable measure configuration.MeasureConfig dataclasses for serializable measure configuration.
|
Question: Should measures (defined by Currently, they are specific (thus configs require you to provide I see how you could want modifications of impact function to be for multiple hazards Any opinion on that? |
|
This PR is officially open for review! Review is advised after #1274 is merged. Actual changes to be reviewed are in:
|
Good question. I would then to keep it hazard type specific. But maybe best is to ask core users of the model :). |
…e/option-appraisal-dataclasses
This reverts commit 775c621.
Changes proposed in this PR:
This PR introduces a new module defining a family of dataclasses that encode adaptation measure parameters in a serializable, declarative form. This is a preparatory step for the broader
Measure/MeasureSetrework.The objective is to retain the possibility to define measures from modifiers in addition to the upcoming system that will use python functions directly, and provide a (better) user interface for this.
no existing code is changed.
New dataclasses:
MeasureConfigtop-level configuration for a single measure, aggregating all modifier configs below.ImpfsetModifierConfigparameters for modifying impact functions (intensity, MDD, PAA scaling, optional replacement)HazardModifierConfigparameters for modifying hazard (intensity scaling, frequency cutoff, optional replacement)ExposuresModifierConfigparameters for modifying exposures (impact function remapping, zeroing regions, optional replacement)CostIncomeConfigserializable representation of cost/income cash flow parametersAll configs inherit from the abstract
_ModifierConfigbase, which provides sharedto_dict/from_dictand a__repr__that highlights non-default fields.MeasureConfigsupports full serialization to/from dict, YAML, and legacy Excel rows (from_row), which will serve as the migration path for the existing file-based I/O inMeasureSet.PR Author Checklist
develop)PR Reviewer Checklist