NetworkBase

class geojson_modelica_translator.model_connectors.networks.network_base.NetworkBase(system_parameters)

Bases: ModelBase

Base class of the network connectors.

__init__(system_parameters)

Base initializer

Parameters:

system_parameters – SystemParameters object

Methods

__init__(system_parameters)

Base initializer

copy_required_mo_files(dest_folder[, within])

Copy any required_mo_files to the destination and update the within clause if defined.

ft2_to_m2(area_in_ft2)

Converts square feet to square meters

render_instance(template_params)

Templates the *_Instance file for the model. The templated result will be inserted into the final District Energy System model in order to instantiate/define the model instance.

run_template(template, save_file_name[, ...])

Helper method to create the file from Jinja2's templating framework.

to_dict(scaffold)

Attributes

instance_template_path

model_name

simple_gmt_type

copy_required_mo_files(dest_folder, within=None)

Copy any required_mo_files to the destination and update the within clause if defined. The required mo files need to be added as full paths to the required_mo_files member variable in the connectors derived classes.

Parameters:
  • dest_folder – String, folder to copy the resulting MO files into.

  • within – String, within clause to be replaced in the .mo file. Note that the original MO file needs to

have a within clause defined to be replaced.

ft2_to_m2(area_in_ft2: float) float

Converts square feet to square meters

Parameters:

area_in_ft2 – Area in square feet to be converted to square meters

render_instance(template_params)

Templates the *_Instance file for the model. The templated result will be inserted into the final District Energy System model in order to instantiate/define the model instance.

Parameters:

template_params – dict, parameters for the template

Returns:

tuple (str, str), the templated result followed by the name of the file used for templating

run_template(template, save_file_name, do_not_add_to_list=False, **kwargs)

Helper method to create the file from Jinja2’s templating framework.

Parameters:
  • template – object, Jinja template from the template_env.get_template() command.

  • save_file_name – string, fully qualified path to save the rendered template to.

  • do_not_add_to_list – boolean, set to true if you do not want the file to be added to the package.order

  • kwargs – These are the arguments that need to be passed to the template.

Returns:

None