diff --git a/teaser/Logic/BuildingObjects/Building.py b/teaser/Logic/BuildingObjects/Building.py index 37efea141..6cac42114 100644 --- a/teaser/Logic/BuildingObjects/Building.py +++ b/teaser/Logic/BuildingObjects/Building.py @@ -645,13 +645,13 @@ def name(self): def name(self, value): if isinstance(value, str): - - self.__name = value + + self.__name = value.replace(" ", "") else: try: value = str(value) - self.__name = value - + self.__name = value.replace(" ", "") + except ValueError: print("Can't convert name to string") diff --git a/teaser/Logic/BuildingObjects/BuildingPhysics/BuildingElement.py b/teaser/Logic/BuildingObjects/BuildingPhysics/BuildingElement.py index a6bbc9e5c..df817fd48 100644 --- a/teaser/Logic/BuildingObjects/BuildingPhysics/BuildingElement.py +++ b/teaser/Logic/BuildingObjects/BuildingPhysics/BuildingElement.py @@ -638,6 +638,23 @@ def set_calc_default(self): self.r_outer_rad = 0.0 self.r_outer_comb = 0.0 + @property + def name(self): + return self._name + + @name.setter + def name(self, value): + if isinstance(value, str): + + self._name = value.replace(" ", "") + else: + try: + value = str(value) + self._name = value.replace(" ", "") + + except ValueError: + print("Can't convert name to string") + @property def parent(self): return self.__parent diff --git a/teaser/Logic/BuildingObjects/ThermalZone.py b/teaser/Logic/BuildingObjects/ThermalZone.py index 6f1297d40..37fdf50c6 100644 --- a/teaser/Logic/BuildingObjects/ThermalZone.py +++ b/teaser/Logic/BuildingObjects/ThermalZone.py @@ -5,7 +5,6 @@ import collections import random import warnings -import numpy as np class ThermalZone(object): '''This class represents a Thermal Zone in a building @@ -771,6 +770,23 @@ def parent(self, value): self.__parent.thermal_zones.append(self) + @property + def name(self): + return self._name + + @name.setter + def name(self, value): + if isinstance(value, str): + + self._name = value.replace(" ", "") + else: + try: + value = str(value) + self._name = value.replace(" ", "") + + except ValueError: + print("Can't convert name to string") + @property def outer_walls(self): return self._outer_walls