Feature/add thermal building model #1169
6 errors
Black found 6 errors
Annotations
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/examples/thermal_building_model/calculate_gain_by_Sun.py#L68-L80
"Albedo",
"liq_precip_depth_mm",
"liq_precip_rate_Hour",
]
self.weather_data = pd.read_csv(
- epwfile_path, skiprows=8, header=None, names=epw_labels,
- encoding='ISO-8859-1', engine='python').drop('datasource', axis=1)
+ epwfile_path,
+ skiprows=8,
+ header=None,
+ names=epw_labels,
+ encoding="ISO-8859-1",
+ engine="python",
+ ).drop("datasource", axis=1)
def calc_sun_position(self, latitude_deg, longitude_deg, year, hoy):
"""
Calculates the Sun Position for a specific hour and location
:param latitude_deg: Geographical Latitude in Degrees
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/examples/thermal_building_model/tabula_reader.py#L187-L203
self.u_window = {
"u_window_1": float(row["U_" + str(t_b) + "Window_1"].values[0]),
"u_window_2": float(row["U_" + str(t_b) + "Window_2"].values[0]),
}
self.g_gl_n_window = {
- "g_gl_n_window_1": float(
- row["g_gl_n_Window_1"].values[0]
- ),
- "g_gl_n_window_2": float(
- row["g_gl_n_Window_2"].values[0]
- ),
+ "g_gl_n_window_1": float(row["g_gl_n_Window_1"].values[0]),
+ "g_gl_n_window_2": float(row["g_gl_n_Window_2"].values[0]),
}
self.floor_area = float(row["A_C_Ref"].values[0])
self.heat_transfer_coefficient_ventilation = float(
row["h_Ventilation"].values[0]
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/src/oemof/solph/components/experimental/__init__.py#L9-L20
from ._generic_caes import GenericCAES
from ._piecewise_linear_converter import PiecewiseLinearConverter
from ._sink_dsm import SinkDSM
from ._generic_building import GenericBuilding
+
__all__ = [
"GenericCAES",
"PiecewiseLinearConverter",
"SinkDSM",
- "GenericBuilding"
+ "GenericBuilding",
]
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_generic_building/test_generic_building.py#L56-L82
energysystem = solph.EnergySystem(
timeindex=tindex,
infer_last_interval=False,
)
-solar_gains = [3000, 4000, 1000 ,300, 300, 200, 100, 50]
+solar_gains = [3000, 4000, 1000, 300, 300, 200, 100, 50]
internal_gains = [100, 100, 100, 100, 100, 100, 100, 100]
t_outside = [22, 19, 16, 15, 14, 10, 7, 4]
building_config = SimpleNamespace(
- total_internal_area=499.95,
- h_ve=55.55,
- h_tr_w=51.52,
- h_tr_em=412.05866346891787,
- h_tr_is=1724.8275,
- mass_area=277.75,
- h_tr_ms=2527.525,
- c_m=18331500.0,
- floor_area=111.1,
- heat_transfer_coefficient_ventilation=0.51,
- total_air_change_rate=0.6
- )
+ total_internal_area=499.95,
+ h_ve=55.55,
+ h_tr_w=51.52,
+ h_tr_em=412.05866346891787,
+ h_tr_is=1724.8275,
+ mass_area=277.75,
+ h_tr_ms=2527.525,
+ c_m=18331500.0,
+ floor_area=111.1,
+ heat_transfer_coefficient_ventilation=0.51,
+ total_air_change_rate=0.6,
+)
##########################################################################
# Create oemof objects
##########################################################################
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_generic_building/test_generic_building.py#L96-L114
solph.components.Source(
label="elect_from_grid",
outputs={b_elect: solph.flows.Flow(variable_costs=30)},
)
)
-'''
+"""
energysystem.add(
solph.components.Sink(
label="elect_into_grid",
inputs={b_elect: solph.flows.Flow(variable_costs=10)},
)
)
-'''
+"""
# create electrical heating and cooling device
energysystem.add(
solph.components.Transformer(
label="ElectricalHeater",
inputs={b_elect: solph.flows.Flow()},
github-actions / Black
/home/runner/work/oemof-solph/oemof-solph/tests/test_scripts/test_solph/test_generic_building/test_generic_building.py#L168-L178
results = energysystem.results["main"]
custom_building = views.node(results, "GenericBuilding")
print(2)
+
def test_storage_input():
assert flows["electricity-storage"][0] == pytest.approx(
(first_input - 0.99 * init_soc) / 0.9
)
assert flows["electricity-storage"][1] == 0