oasislmf.pytools.fm.financial_structure

Functions

load_static(static_path)

Load the raw financial data from static_path as numpy ndarray

extract_financial_structure(allocation_rule, ...)

create_financial_structure(allocation_rule, static_path)

load_financial_structure(allocation_rule, static_path)

Module Contents

oasislmf.pytools.fm.financial_structure.load_static(static_path)[source]

Load the raw financial data from static_path as numpy ndarray first check if .bin file is present then try .cvs try loading profile_step before falling back to normal profile,

Parameters:

static_path – str static_path

Returns:

programme : link between nodes policytc : info on layer profile : policy profile can be profile_step or profile xref : node to output_id items : items (item_id and coverage_id mapping) coverages : Tiv value for each coverage id

Raise:

FileNotFoundError if one of the static is missing

oasislmf.pytools.fm.financial_structure.extract_financial_structure(allocation_rule, fm_programme, fm_policytc, fm_profile, stepped, fm_xref, items, coverages)[source]
Parameters:
  • allocation_rule – option to indicate out the loss are allocated to the output

  • fm_programme – structure of the levels

  • fm_policytc – structure of the layers and policy_id to apply

  • fm_profile – definition of the policy_id

  • fm_xref – mapping between the output of the allocation and output item_id

Returns:

compute_infos: nodes_array: node_parents_array: node_profiles_array: output_array:

oasislmf.pytools.fm.financial_structure.create_financial_structure(allocation_rule, static_path)[source]
Parameters:
  • allocation_rule – int back-allocation rule

  • static_path – string path to the static files

Returns:

compute_queue : the step of the computation to perform on each event node_indexes : map node to index of item in result array index_dependencies : map node to its dependent indexes node_profile : map node to profile output_item_index : list of item_id, index to put in the output

oasislmf.pytools.fm.financial_structure.load_financial_structure(allocation_rule, static_path)[source]