oasislmf.computation.generate.losses

Classes

GenerateLossesDir

Prepare the loss generation directory

GenerateLossesPartial

Runs a single analysis event chunk

GenerateLossesOutput

Runs the output reports generation on a set of event chunks

GenerateLosses

Runs the GenerateLosses workflow as a single bash script (Default for the MDK)

GenerateLossesDeterministic

"Abstract" Class for all Computation Step (ExposurePreAnalysis, GulCalc, ...)

GenerateLossesDummyModel

Generates dummy model and Oasis GUL input files + optionally the IL/FM

Module Contents

class oasislmf.computation.generate.losses.GenerateLossesDir(**kwargs)[source]

Bases: GenerateLossesBase

Prepare the loss generation directory

  • converts input csv files to ktools binary types

  • links model data to the static directory to the run locations

  • Validates and updates the analysis_settings.json

  • Stores the analysis_settings.json in the output directory

Returns:

(dict) Updated analysis_settings

step_params[source]
run()[source]
class oasislmf.computation.generate.losses.GenerateLossesPartial(**kwargs)[source]

Bases: GenerateLossesDir

Runs a single analysis event chunk

step_params[source]
run()[source]
class oasislmf.computation.generate.losses.GenerateLossesOutput(**kwargs)[source]

Bases: GenerateLossesDir

Runs the output reports generation on a set of event chunks

step_params[source]
run()[source]
class oasislmf.computation.generate.losses.GenerateLosses(**kwargs)[source]

Bases: GenerateLossesDir

Runs the GenerateLosses workflow as a single bash script (Default for the MDK)

Generates losses using the installed ktools framework given Oasis files, model analysis settings JSON file, model data and model package data.

The command line arguments can be supplied in the configuration file (oasislmf.json by default or specified with the --config flag). Run oasislmf config --help for more information.

The script creates a time-stamped folder in the model run directory and sets that as the new model run directory, copies the analysis settings JSON file into the run directory and creates the following folder structure

|-- analysis_settings.json
|-- fifo
|-- input
    |-- RI_1
|-- output
|-- ri_layers.json
|-- run_ktools.sh
|-- static
`-- work

Depending on the OS type the model data is symlinked (Linux, Darwin) or copied (Cygwin, Windows) into the static subfolder. The input files are kept in the input subfolder and the losses are generated as CSV files in the output subfolder.

step_params[source]
run()[source]
class oasislmf.computation.generate.losses.GenerateLossesDeterministic(**kwargs)[source]

Bases: oasislmf.computation.base.ComputationStep

“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.

step_params[source]
run()[source]
class oasislmf.computation.generate.losses.GenerateLossesDummyModel(**kwargs)[source]

Bases: oasislmf.computation.generate.files.GenerateDummyOasisFiles

Generates dummy model and Oasis GUL input files + optionally the IL/FM input files.

step_params[source]
chained_commands[source]
run()[source]