Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_save_use_conditions(self):
"""Test of save_use_conditions, no parameter checking."""
try:
os.remove(os.path.join(utilities.get_default_path(), "UseCondUT.json"))
except OSError:
pass
path = os.path.join(utilities.get_default_path(), "UseCondUT.json")
prj.data.path_uc = path
prj.data.load_uc_binding()
use_cond = prj.buildings[-1].thermal_zones[-1].use_conditions
use_cond.save_use_conditions(data_class=prj.data)
def test_delete_type_element(self):
"""test of save_type_element, no parameter checking"""
import os
# test load function
therm_zone = prj.buildings[-1].thermal_zones[-1]
path = os.path.join(utilities.get_default_path(),
'unitTestTB.xml')
prj.data.path_tb = path
prj.data.load_tb_binding()
therm_zone.outer_walls[0].delete_type_element(data_class=prj.data)
therm_zone.inner_walls[0].delete_type_element(data_class=prj.data)
therm_zone.windows[0].delete_type_element(data_class=prj.data)
prj.used_library_calc = 'IBPSA'
prj.calc_all_buildings()
prj.export_ibpsa(library='AixLib')
prj.export_ibpsa(library='Buildings')
prj.export_ibpsa(library='BuildingSystems')
prj.export_ibpsa(library='IDEAS')
prj.number_of_elements_calc = 4
prj.merge_windows_calc = False
prj.used_library_calc = 'IBPSA'
prj.calc_all_buildings()
prj.export_ibpsa(internal_id=prj.buildings[-1].internal_id)
prj.number_of_elements_calc = 4
prj.merge_windows_calc = False
prj.used_library_calc = 'IBPSA'
prj.calc_all_buildings()
prj.export_ibpsa(path=utilities.get_default_path())
prj.set_default()
prj.calc_all_buildings()
prj.export_aixlib(building_model="Test",
zone_model="Test",
corG="Test")
prj.number_of_elements_calc = 4
prj.merge_windows_calc = False
prj.used_library_calc = 'AixLib'
prj.calc_all_buildings()
prj.buildings.append(prj.buildings[-1])
prj.number_of_elements_calc = 4
prj.merge_windows_calc = False
prj.used_library_calc = 'AixLib'
prj.calc_all_buildings()
prj.export_aixlib(path=utilities.get_default_path())
----------
file_name : string
name of the new file
path : string
if the Files should not be stored in OutputData, an alternative
can be specified
"""
if file_name is None:
name = self.name
else:
name = file_name
if path is None:
new_path = os.path.join(utilities.get_default_path(), name)
else:
new_path = os.path.join(path, name)
utilities.create_path(utilities.get_full_path(path))
citygml_out.save_gml(self, new_path)
def from_scratch(
number_of_elements,
save=False,
path=utilities.get_default_path()):
"""This function creates the test room from scratch.
Notes: The standard defines an solar absorption coefficient for interior
surfaces of 0.6. We do not consider this, but we could by multiplying
the solar radiation after the window by 0.6.
Parameters
----------
number_of_elements: int
Number of elements of model
path: str (optional)
Path where Project should be stored as .teaserXML
save: bool (optional)
True if Project should be stored as .teaserXML at path
Returns
3,6,9,... Column : profile_machines
4,7,10,... Column : profile_lighting
Note
----------
When time line is created, we need to add a 0 to first element of
all boundaries. This is due to to expected format in Modelica.
Parameters
----------
path : str
optional path, when matfile is exported separately
"""
if path is None:
path = utilities.get_default_path()
else:
pass
utilities.create_path(path)
path = os.path.join(path, self.file_internal_gains)
export = pd.DataFrame(
index=pd.date_range("2019-01-01 00:00:00", periods=8760, freq="H")
.to_series()
.dt.strftime("%m-%d %H:%M:%S")
)
for zone_count in self.parent.thermal_zones:
export[
"person_{}".format(zone_count.name)
] = zone_count.use_conditions.schedules["persons_profile"]
def from_scratch(
number_of_elements,
save=False,
path=utilities.get_default_path()):
"""This function creates the test room from scratch.
Notes: The standard defines an solar absorption coefficient for interior
surfaces of 0.6. We do not consider this, but we could by multiplying
the solar radiation after the window by 0.6.
Parameters
----------
number_of_elements: int
Number of elements of model
path: str (optional)
Path where Project should be stored as .teaserXML
save: bool (optional)
True if Project should be stored as .teaserXML at path
Returns
def from_scratch(
number_of_elements,
save=False,
path=utilities.get_default_path()):
"""This function creates the test room from scratch.
Notes: The standard defines an solar absorption coefficient for interior
surfaces of 0.6. We do not consider this, but we could by multiplying
the solar radiation after the window by 0.6.
Parameters
----------
number_of_elements: int
Number of elements of model
path: str (optional)
Path where Project should be stored as .teaserXML
save: bool (optional)
True if Project should be stored as .teaserXML at path
Returns
def modelica_set_temp(self, path=None):
"""Create .txt file for set temperatures for heating.
This function creates a txt for set temperatures of each
zone, that are all saved into one matrix.
Parameters
----------
path : str
optional path, when matfile is exported separately
"""
if path is None:
path = utilities.get_default_path()
else:
pass
utilities.create_path(path)
path = os.path.join(path, self.file_set_t_heat)
export = pd.DataFrame(
index=pd.date_range("2019-01-01 00:00:00", periods=8760, freq="H")
.to_series()
.dt.strftime("%m-%d %H:%M:%S"),
columns=[zone.name for zone in self.parent.thermal_zones],
)
for zone_count in self.parent.thermal_zones:
export[zone_count.name] = zone_count.use_conditions.schedules[
"heating_profile"