hazimp.templates

HazImp Templates Module

Templates convert a YAML template configuration file to jobs and calcs.

Submodules

Package Contents

Functions

add_job(jobs, new_job, atts=None)

Given a list of jobs, add a new job and it's att's to the job.

_earthquake_v1_reader(config: dict) → list

Build a job list from earthquake configuration.

_flood_fabric_v2_reader(config: dict) → list

This function does two things:

_flood_contents_v2_reader(config: dict) → list

This function does two things:

_wind_v3_reader(config: dict) → list

DEPRECATED

_wind_v4_reader(config: dict) → list

From a wind configuration list build the job list.

_wind_v5_reader(config: dict) → list

Build a job list from a wind configuration list.

_wind_nc_reader(config: dict) → list

Build a job list from a wind configuration list for netcdf files.

_reader2(config: dict) → list

From an untemplated configuration list build the job list.

Attributes

DEFAULT

WINDV3

WINDV4

WINDV5

WINDNC

EARTHQUAKEV1

FLOODFABRICV2

FLOODCONTENTSV2

REP_VAL_NAME

TEMPLATE

SAVE

SAVEAGG

LOADWINDTCRM

HAZARDRASTER

CALCSTRUCTLOSS

CALCCONTLOSS

PERMUTATION

VULNFILE

VULNSET

VULNMETHOD

AGGREGATION

AGGREGATE

TABULATE

READERS

hazimp.templates.add_job(jobs, new_job, atts=None)

Given a list of jobs, add a new job and it’s att’s to the job.

Parameters:
  • jobs – A list of jobs.

  • new_job – The new job, as a string.

  • atts – The attributes of the new job.

hazimp.templates._earthquake_v1_reader(config: dict) list

Build a job list from earthquake configuration.

Parameters:

config – A dict describing the simulation

Returns:

A list of jobs to process over

hazimp.templates._flood_fabric_v2_reader(config: dict) list

This function does two things:

* From a flood fabric template v2 configuration dictionary
build the job list.
* Set up the attributes of the jobs and calc's specifically
for a flood study.
Parameters:

config_list – A list describing the simulation.

Returns:

A list of jobs to process over.

hazimp.templates._flood_contents_v2_reader(config: dict) list

This function does two things:

* From a flood contents template v2 configuration dictionary
build the job list.
* Set up the attributes of the jobs and calc's specifically
for a flood study.
Parameters:

config_list – A list describing the simulation.

Returns:

A list of jobs to process over.

hazimp.templates._wind_v3_reader(config: dict) list

DEPRECATED From a wind configuration list build the job list.

Parameters:

config_list – A list describing the simulation.

Returns:

A list of jobs to process over.

hazimp.templates._wind_v4_reader(config: dict) list

From a wind configuration list build the job list.

Parameters:

config_list – A list describing the simulation.

Returns:

A list of jobs to process over.

hazimp.templates._wind_v5_reader(config: dict) list

Build a job list from a wind configuration list.

Parameters:

config_list – A list describing the simulation

Returns:

A list of jobs to process over

hazimp.templates._wind_nc_reader(config: dict) list

Build a job list from a wind configuration list for netcdf files.

Parameters:

config_list – A list describing the simulation

Returns:

A list of jobs to process over

hazimp.templates.DEFAULT = default
hazimp.templates.WINDV3 = wind_v3
hazimp.templates.WINDV4 = wind_v4
hazimp.templates.WINDV5 = wind_v5
hazimp.templates.WINDNC = wind_nc
hazimp.templates.EARTHQUAKEV1 = earthquake_v1
hazimp.templates.FLOODFABRICV2 = flood_fabric_v2
hazimp.templates.FLOODCONTENTSV2 = flood_contents_v2
hazimp.templates.REP_VAL_NAME = replacement_value_label
hazimp.templates.TEMPLATE = template
hazimp.templates.SAVE = save
hazimp.templates.SAVEAGG = save_agg
hazimp.templates.LOADWINDTCRM = load_wind
hazimp.templates.HAZARDRASTER = hazard_raster
hazimp.templates.CALCSTRUCTLOSS = calc_struct_loss
hazimp.templates.CALCCONTLOSS = calc_cont_loss
hazimp.templates.PERMUTATION = exposure_permutation
hazimp.templates.VULNFILE = vulnerability
hazimp.templates.VULNSET = vulnerability_set
hazimp.templates.VULNMETHOD = vulnerability_method
hazimp.templates.AGGREGATION = aggregation
hazimp.templates.AGGREGATE = aggregate
hazimp.templates.TABULATE = tabulate
hazimp.templates._reader2(config: dict) list

From an untemplated configuration list build the job list.

Parameters:

config_list – A list describing the simulation.

Returns:

A list of jobs to process over.

hazimp.templates.READERS