Spawn¶
- class geojson_modelica_translator.model_connectors.load_connectors.spawn.Spawn(system_parameters, geojson_load)¶
Bases:
LoadBase
- __init__(system_parameters, geojson_load)¶
Base class for load connectors.
- Parameters:
system_parameters – SystemParameter object, the entire system parameter file which will be used to generate this load.
geojson_load – dict, the GeoJSON portion of the load to be added (a single feature).
Methods
__init__
(system_parameters, geojson_load)Base class for load connectors.
add_building
(urbanopt_building[, mapper])Add building to the load to be translated.
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
get_modelica_type
(scaffold)post_process
(scaffold[, keep_original_models])Cleanup the export of Spawn files into a format suitable for the district-based analysis.
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)to_modelica
(scaffold[, keep_original_models])Create spawn models based on the data in the buildings and geojsons
Attributes
building_name
instance_template_path
model_name
simple_gmt_type
- add_building(urbanopt_building, mapper=None)¶
Add building to the load to be translated. This is simply a helper method.
- Parameters:
urbanopt_building – an urbanopt_building (also known as a geojson_load)
mapper – placeholder object for mapping between urbanopt_building and load_connector building.
- 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
- post_process(scaffold, keep_original_models=False)¶
Cleanup the export of Spawn files into a format suitable for the district-based analysis. This includes the following:
Add a Loads project
Add a project level project
- Parameters:
scaffold – Scaffold object, Scaffold of the entire directory of the project.
keep_original_models – boolean, # TODO
- Returns:
None
- 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
- to_modelica(scaffold, keep_original_models=False)¶
Create spawn models based on the data in the buildings and geojsons
- Parameters:
scaffold – Scaffold object, Scaffold of the entire directory of the project.