oasislmf.computation.generate.keys¶
Classes¶
Generates keys from a model lookup, and write Oasis keys and keys error files. |
|
"Abstract" Class for all Computation Step (ExposurePreAnalysis, GulCalc, ...) |
Module Contents¶
- class oasislmf.computation.generate.keys.GenerateKeys(**kwargs)[source]¶
Bases:
KeyComputationStep
Generates keys from a model lookup, and write Oasis keys and keys error files.
The model lookup, which is normally independently implemented by the model supplier, should generate keys as dicts with the following format
{ "id": <loc. ID>, "peril_id": <OED sub-peril ID>, "coverage_type": <OED coverage type ID>, "area_peril_id": <area peril ID>, "vulnerability_id": <vulnerability ID>, "message": <loc. lookup status message>, "status": <loc. lookup status flag indicating success, failure or no-match> }
The keys generation command can generate these dicts, and write them to file. It can also be used to write these to an Oasis keys file (which is a requirement for model execution), which has the following format.:
LocID,PerilID,CoverageTypeID,AreaPerilID,VulnerabilityID .. ..
This file only lists the locations for which there has been a successful lookup. The keys errors file lists all the locations with failing or non-matching lookups and has the following format:
LocID,PerilID,CoverageTypeID,Message .. ..
- class oasislmf.computation.generate.keys.GenerateKeysDeterministic(**kwargs)[source]¶
Bases:
KeyComputationStep
“Abstract” Class for all Computation Step (ExposurePreAnalysis, GulCalc, …) initialise the object with all specified param un step_param and sub- ComputationStep provide a generic interface to get the all those parameter definitions (get_params)
the Run method must be implemented and contain le business execution logic.