Skip to content

Commit

Permalink
deleting runlocal and oedbtest marker because of db implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
joda9 committed Sep 18, 2024
1 parent 4be9e74 commit 5aaeb18
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 38 deletions.
2 changes: 1 addition & 1 deletion edisgo/io/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def engine(path: Path | str, ssh: bool = False) -> Engine:

if not ssh:
return create_engine(
"postgresql+oedialect//@toep.iks.cs.ovgu.de",
"postgresql+oedialect://:@toep.iks.cs.ovgu.de",
echo=False,
)

Expand Down
3 changes: 0 additions & 3 deletions tests/io/test_dsm_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class TestDSMImport:
@pytest.mark.local
def test_oedb(self):
# test without industrial load
edisgo_object = EDisGo(
Expand Down Expand Up @@ -40,7 +39,6 @@ def test_oedb(self):
assert (dsm_profiles["p_max"] >= 0.0).all().all()
assert (dsm_profiles["e_max"] >= 0.0).all().all()

@pytest.mark.local
def test_get_profiles_per_industrial_load(self):
dsm_profiles = dsm_import.get_profiles_per_industrial_load(
load_ids=[15388, 241, 1], scenario="eGon2035", engine=pytest.engine
Expand All @@ -58,7 +56,6 @@ def test_get_profiles_per_industrial_load(self):
)
assert dsm_profiles["p_min"].empty

@pytest.mark.local
def test_get_profile_cts(self):
edisgo = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down
3 changes: 0 additions & 3 deletions tests/io/test_electromobility_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def test_integrate_charging_parks(self):

assert edisgo_ids_cp == edisgo_ids_topology

@pytest.mark.local
def test_simbev_config_from_oedb(self):
config_df = electromobility_import.simbev_config_from_oedb(
engine=pytest.engine, scenario="eGon2035"
Expand All @@ -201,7 +200,6 @@ def test_simbev_config_from_oedb(self):
assert config_df["stepsize"][0] == 15
assert config_df["days"][0] == 365

@pytest.mark.local
def test_potential_charging_parks_from_oedb(self):
edisgo_obj = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand All @@ -215,7 +213,6 @@ def test_potential_charging_parks_from_oedb(self):
assert all(potential_parks_df.geom.iloc[10].within(grid_gdf.geometry))
assert all(potential_parks_df.geom.iloc[100].within(grid_gdf.geometry))

@pytest.mark.local
def test_charging_processes_from_oedb(self):
edisgo_obj = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down
5 changes: 0 additions & 5 deletions tests/io/test_generators_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ class TestGeneratorsImportOEDB:
"""

@pytest.mark.slow
@pytest.mark.oedbtest
def test_oedb_legacy_without_timeseries(self):
edisgo = EDisGo(
ding0_grid=pytest.ding0_test_network_2_path,
Expand All @@ -498,7 +497,6 @@ def test_oedb_legacy_without_timeseries(self):
assert np.isclose(edisgo.topology.generators_df.p_nom.sum(), 20.18783)

@pytest.mark.slow
@pytest.mark.oedbtest
def test_oedb_legacy_with_worst_case_timeseries(self):
edisgo = EDisGo(ding0_grid=pytest.ding0_test_network_2_path)
edisgo.set_time_series_worst_case_analysis()
Expand Down Expand Up @@ -570,7 +568,6 @@ def test_oedb_legacy_with_worst_case_timeseries(self):
# :, new_solar_gen.name] / new_solar_gen.p_nom).all()

@pytest.mark.slow
@pytest.mark.oedbtest
def test_oedb_legacy_with_timeseries_by_technology(self):
timeindex = pd.date_range("1/1/2012", periods=3, freq="H")
ts_gen_dispatchable = pd.DataFrame(
Expand Down Expand Up @@ -650,7 +647,6 @@ def test_oedb_legacy_with_timeseries_by_technology(self):
# :, new_solar_gen.name] / new_solar_gen.p_nom).all()

@pytest.mark.slow
@pytest.mark.oedbtest
def test_target_capacity(self):
edisgo = EDisGo(
ding0_grid=pytest.ding0_test_network_2_path,
Expand Down Expand Up @@ -710,7 +706,6 @@ def test_target_capacity(self):
p_biomass_before * 1.0,
)

@pytest.mark.local
def test_oedb(self):
edisgo = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down
3 changes: 1 addition & 2 deletions tests/io/test_heat_pump_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def setup_resistive_heater_data_dh(self):
)
return hp_df

@pytest.mark.local
@pytest.mark.oedbtest
def test_oedb(self, caplog):
with caplog.at_level(logging.DEBUG):
heat_pump_import.oedb(
Expand Down Expand Up @@ -196,7 +196,6 @@ def test__grid_integration(self, caplog):
bus_rh = hp_df[hp_df.p_set == 0.17].bus[0]
assert determine_bus_voltage_level(self.edisgo, bus_rh) == 6

@pytest.mark.local
def test_efficiency_resistive_heaters_oedb(self):
eta_dict = heat_pump_import.efficiency_resistive_heaters_oedb(
scenario="eGon2035", engine=pytest.engine
Expand Down
1 change: 0 additions & 1 deletion tests/io/test_storage_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def setup_home_batteries_data(self):
)
return df

@pytest.mark.local
def test_oedb(self, caplog):
# test without new PV rooftop plants
with caplog.at_level(logging.DEBUG):
Expand Down
11 changes: 0 additions & 11 deletions tests/io/test_timeseries_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def test__timeindex_helper_func(self):
assert_index_equal(ind, given_index)
assert_index_equal(ind_full, timeindex)

@pytest.mark.oedbtest
def test_feedin_oedb_legacy(self):
edisgo = EDisGo(ding0_grid=pytest.ding0_test_network_path)
timeindex = pd.date_range("1/1/2010", periods=3000, freq="H")
Expand All @@ -73,7 +72,6 @@ def test_feedin_oedb_legacy(self):
assert np.isclose(feedin["solar"][1122075][timeindex[61]], 0.423823)
assert np.isclose(feedin["wind"][1122075][timeindex[1356]], 0.106361)

@pytest.mark.local
def test_feedin_oedb(self):
edisgo_object = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down Expand Up @@ -104,7 +102,6 @@ def test_load_time_series_demandlib(self):
assert np.isclose(load.sum()["agricultural"], 1.0)
assert np.isclose(load.sum()["industrial"], 1.0)

@pytest.mark.local
def test_cop_oedb(self):
edisgo = EDisGo(ding0_grid=pytest.ding0_test_network_path)
cop_df = timeseries_import.cop_oedb(
Expand Down Expand Up @@ -140,7 +137,6 @@ def setup_egon_heat_pump_data(self):
)
return hp_df

@pytest.mark.local
def test_heat_demand_oedb(self, caplog):
edisgo_object = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down Expand Up @@ -169,7 +165,6 @@ def test_heat_demand_oedb(self, caplog):

# ToDo add further tests

@pytest.mark.local
def test_electricity_demand_oedb(self, caplog):
# test with one load each and without year
edisgo_object = EDisGo(
Expand Down Expand Up @@ -216,23 +211,20 @@ def test_electricity_demand_oedb(self, caplog):

# ToDo add further tests to check values

@pytest.mark.local
def test_get_residential_heat_profiles_per_building(self):
df = timeseries_import.get_residential_heat_profiles_per_building(
[442081, 430859], "eGon2035", pytest.engine
)
assert df.shape == (8760, 2)
# ToDo add further tests

@pytest.mark.local
def test_get_district_heating_heat_demand_profiles(self):
df = timeseries_import.get_district_heating_heat_demand_profiles(
[6], "eGon2035", pytest.engine
)
assert df.shape == (8760, 1)
# ToDo add further tests

@pytest.mark.local
def test_get_cts_profiles_per_building(self):
edisgo_object = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand All @@ -253,7 +245,6 @@ def test_get_cts_profiles_per_building(self):
assert df.shape == (8760, len(cts_loads))
# ToDo add further tests

@pytest.mark.local
def test_get_cts_profiles_per_grid(self):
df = timeseries_import.get_cts_profiles_per_grid(
33535, "eGon2035", "heat", pytest.engine
Expand All @@ -265,7 +256,6 @@ def test_get_cts_profiles_per_grid(self):
assert df.shape == (8760, 85)
# ToDo add further tests

@pytest.mark.local
def test_get_residential_electricity_profiles_per_building(self):
df = timeseries_import.get_residential_electricity_profiles_per_building(
[-1, 442081], "eGon2035", pytest.engine
Expand All @@ -280,7 +270,6 @@ def test_get_residential_electricity_profiles_per_building(self):
assert df.shape == (8760, 1)
assert np.isclose(df.loc[:, 442081].sum(), 4.288845, atol=1e-3)

@pytest.mark.local
def test_get_industrial_electricity_profiles_per_site(self):
# test with one site and one OSM area
df = timeseries_import.get_industrial_electricity_profiles_per_site(
Expand Down
2 changes: 0 additions & 2 deletions tests/network/test_heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def test_set_cop(self):
check_freq=False,
)

@pytest.mark.local
def test_set_cop_oedb(self, caplog):
# ################### test with oedb ###################
edisgo_object = EDisGo(
Expand Down Expand Up @@ -209,7 +208,6 @@ def test_set_heat_demand(self):
check_freq=False,
)

@pytest.mark.local
def test_set_heat_demand_oedb(self):
# test with oedb
edisgo_object = EDisGo(
Expand Down
2 changes: 0 additions & 2 deletions tests/network/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,6 @@ def test_worst_case_storage_units(self):
)

@pytest.mark.slow
@pytest.mark.oedbtest
def test_predefined_fluctuating_generators_by_technology(self):
timeindex = pd.date_range("1/1/2011 12:00", periods=2, freq="H")
self.edisgo.timeseries.timeindex = timeindex
Expand Down Expand Up @@ -1404,7 +1403,6 @@ def test_predefined_fluctuating_generators_by_technology(self):
)
# fmt: on

@pytest.mark.local
def test_predefined_fluctuating_generators_by_technology_oedb(self):
edisgo_object = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down
5 changes: 1 addition & 4 deletions tests/test_edisgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ def test_set_time_series_active_power_predefined(self, caplog):
assert self.edisgo.timeseries.storage_units_active_power.shape == (2, 0)
assert self.edisgo.timeseries.storage_units_reactive_power.shape == (2, 0)

@pytest.mark.local
def test_set_time_series_active_power_predefined_oedb(self):
# test conventional_loads_ts="oedb" for all loads in grid
edisgo_object = EDisGo(
Expand Down Expand Up @@ -382,7 +381,6 @@ def test_to_graph(self):
)

@pytest.mark.slow
@pytest.mark.oedbtest
def test_generator_import(self):
edisgo = EDisGo(ding0_grid=pytest.ding0_test_network_2_path)
edisgo.import_generators("nep2035")
Expand Down Expand Up @@ -1296,7 +1294,6 @@ def test_import_electromobility(self):
)
# fmt: on

@pytest.mark.local
def test_import_electromobility_oedb(self):
"""
Test import from oedb.
Expand Down Expand Up @@ -1354,7 +1351,7 @@ def test_import_electromobility_oedb(self):
)
# fmt: on

@pytest.mark.local
@pytest.mark.oedbtest
def test_import_heat_pumps(self):
edisgo_object = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down
2 changes: 0 additions & 2 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def test_plot_example_ipynb(self):
assert result.exec_error is None

@pytest.mark.slow
@pytest.mark.oedbtest
def test_electromobility_example_ipynb(self):
path = os.path.join(self.examples_dir_path, "electromobility_example.ipynb")
notebook = pytest_notebook.notebook.load_notebook(path=path)
Expand All @@ -40,7 +39,6 @@ def test_electromobility_example_ipynb(self):
assert result.exec_error is None

@pytest.mark.slow
@pytest.mark.oedbtest
def test_edisgo_simple_example_ipynb(self):
path = os.path.join(self.examples_dir_path, "edisgo_simple_example.ipynb")
notebook = pytest_notebook.notebook.load_notebook(path=path)
Expand Down
2 changes: 0 additions & 2 deletions tests/tools/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ def test_determine_bus_voltage_level(self):
assert tools.determine_bus_voltage_level(self.edisgo, bus_voltage_level_6) == 6
assert tools.determine_bus_voltage_level(self.edisgo, bus_voltage_level_7) == 7

@pytest.mark.oedbtest
def test_get_weather_cells_intersecting_with_grid_district(self):
weather_cells = tools.get_weather_cells_intersecting_with_grid_district(
self.edisgo
Expand All @@ -445,7 +444,6 @@ def test_get_weather_cells_intersecting_with_grid_district(self):
# for some reason..
assert 1122074 in weather_cells

@pytest.mark.local
def test_get_weather_cells_intersecting_with_grid_district_egon(self):
edisgo_obj = EDisGo(
ding0_grid=pytest.ding0_test_network_3_path, legacy_ding0_grids=False
Expand Down

0 comments on commit 5aaeb18

Please sign in to comment.