sfsimodels package

Submodules

sfsimodels.build_model_descriptions module

sfsimodels.build_model_descriptions.all_descriptions()[source]

Generates a list of descriptions of all the models

Returns:
sfsimodels.build_model_descriptions.build_parameter_descriptions(obj, user_p=None, output='csv', show_none=True, ignore=None, plist=None)[source]

Creates a list of the decription of all the inputs of an object

Parameters:
  • obj – object, that has parameters
  • user_p – dict, user defined parameter descriptions
  • show_none – if false, only shows descriptions of parameters that are not None
  • ignore – list of parameters to not build
Returns:

sfsimodels.checking_tools module

sfsimodels.checking_tools.isclose(a, b, rel_tol=1e-09, abs_tol=0.0)[source]

To check equality of floats

Parameters:
  • a
  • b
  • rel_tol
  • abs_tol
Returns:

sfsimodels.exceptions module

exception sfsimodels.exceptions.AnalysisError[source]

Bases: exceptions.Exception

exception sfsimodels.exceptions.DesignError[source]

Bases: exceptions.Exception

exception sfsimodels.exceptions.ModelError[source]

Bases: exceptions.Exception

exception sfsimodels.exceptions.ModelWarning[source]

Bases: exceptions.Warning

sfsimodels.exceptions.deprecation(message)[source]

sfsimodels.files module

class sfsimodels.files.Output[source]

Bases: object

add_to_dict(an_object, extras=None)[source]

Convert models to json serialisable output

Parameters:
  • an_object – An instance of a model object
  • extras – A dictionary of extra variables that should be
Returns:

add_to_output(mtype, m_id, serialisable_dict)[source]

Can add additional objects or dictionaries to output file that don’t conform to standard objects.

Parameters:
  • mtype
  • m_id
  • serialisable_dict
Returns:

comments = ''
compression = True
doi = ''
models

Unhashed

name = ''
static parameters()[source]
sfsimodels_version = ''
to_dict()[source]
units = ''
sfsimodels.files.dicts_to_objects(data, verbose=0)[source]

Deprecated. Use ecp_dict_to_objects

sfsimodels.files.ecp_dict_to_objects(ecp_dict, custom_map=None, verbose=0)[source]

Given an ecp dictionary, build a dictionary of sfsi objects

Parameters:
  • ecp_dict – dict, engineering consistency project dictionary
  • custom – dict, used to load custom objects, {model type: custom object}
  • verbose – int, console output
Returns:

dict

sfsimodels.files.load_json(ffp, custom=None, verbose=0)[source]

Given a json file it creates a dictionary of sfsi objects

Parameters:
  • ffp – str, Full file path to json file
  • custom – dict, used to load custom objects, {model type: custom object}
  • verbose – int, console output
Returns:

dict

sfsimodels.files.load_json_and_meta(ffp, custom=None, verbose=0)[source]
sfsimodels.files.loads_json(p_str, custom=None, meta=False, verbose=0)[source]

Given a json string it creates a dictionary of sfsi objects

Parameters:
  • ffp – str, Full file path to json file
  • custom – dict, used to load custom objects, {model type: custom object}
  • meta – bool, if true then also return all ecp meta data in separate dict
  • verbose – int, console output
Returns:

dict

sfsimodels.files.migrate_ecp(in_ffp, out_ffp)[source]

Migrates and ECP file to the current version of sfsimodels

sfsimodels.files.unhash_dict(pdict)[source]

sfsimodels.functions module

sfsimodels.functions.add_to_obj(obj, dictionary, objs=None, exceptions=None, verbose=0)[source]

Cycles through a dictionary and adds the key-value pairs to an object.

Parameters:
  • obj
  • dictionary
  • exceptions
  • verbose
Returns:

sfsimodels.functions.clean_float(value)[source]
sfsimodels.functions.collect_serial_value(value)[source]
sfsimodels.functions.convert_stress_to_mass(q, width, length, gravity)[source]

Converts a foundation stress to an equivalent mass.

Parameters:
  • q – applied stress [Pa]
  • width – foundation width [m]
  • length – foundation length [m]
  • gravity – applied gravitational acceleration [m/s2]
Returns:

sfsimodels.functions.get_key_value(value, objs, key=None)[source]
sfsimodels.functions.get_value_of_a_get_method(obj, method, extras=None)[source]

sfsimodels.loader module

sfsimodels.loader.add_inputs_to_object(obj, values)[source]

A generic function to load object parameters based on a dictionary list. :param obj: Object :param values: Dictionary :return:

sfsimodels.loader.load_building_sample_data(bd)[source]

Sample data for the Building object :param bd: :return:

sfsimodels.loader.load_foundation_sample_data(fd)[source]

Sample data for the Foundation object :param fd: Foundation Object :return:

sfsimodels.loader.load_frame_building_sample_data()[source]

Sample data for the BuildingFrame object

Returns:
sfsimodels.loader.load_hazard_sample_data(hz)[source]

Sample data for the Hazard object :param hz: Hazard Object :return:

sfsimodels.loader.load_sample_data(sss)[source]

Sample data for the SoilStructureSystem object :param sss: :return:

sfsimodels.loader.load_soil_sample_data(sp)[source]

Sample data for the Soil object :param sp: Soil Object :return:

sfsimodels.loader.load_structure_sample_data(st)[source]

Sample data for the Structure object :param st: Structure Object :return:

sfsimodels.make_migrations module

sfsimodels.output module

sfsimodels.output.add_table_ends(para, oformat='latex', caption='caption-text', label='table')[source]

Adds the latex table ends

Parameters:
  • para
  • oformat
  • caption
  • label
Returns:

sfsimodels.output.format_name(name)[source]

format parameter names for output

Parameters:name – Cleans a name for output
Returns:
sfsimodels.output.format_value(value, sf=3)[source]

convert a parameter value into a formatted string with certain significant figures

Parameters:
  • value – the value to be formatted
  • sf – number of significant figures
Returns:

str

sfsimodels.output.output_to_table(obj, olist='inputs', oformat='latex', table_ends=False, prefix='')[source]

Compile the properties to a table.

Parameters:
  • olist – list, Names of the parameters to be in the output table
  • oformat – str, The type of table to be output
  • table_ends – bool, Add ends to the table
  • prefix – str, A string to be added to the start of each parameter name
Returns:

para, str, table as a string

sfsimodels.properties module

sfsimodels.scores module

sfsimodels.scores.lc_score(value)[source]

Evaluates the accuracy of a predictive measure (e.g. r-squared)

Parameters:value – float, between 0.0 and 1.0.
Returns:

Module contents