eflips-depot 1.1.1__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of eflips-depot might be problematic. Click here for more details.
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/PKG-INFO +1 -1
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/api/__init__.py +29 -27
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/pyproject.toml +1 -1
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/LICENSE.md +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/README.md +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/__init__.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/api/defaults/default_settings.json +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/api/private.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/configuration.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/depot.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/evaluation.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/filters.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/input_epex_power_price.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/__init__.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/doc/__init__.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/doc/direct_details.pdf +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/evaluation.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/__init__.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/crossover.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/fitness_util.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/init.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/mutation.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/optimize_c_urfd.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/packing.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/settings.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/template_creation.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/util.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/plots.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/processes.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/rating.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/resources.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/settings_config.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/simple_vehicle.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/simulation.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/smart_charging.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/standalone.py +0 -0
- {eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/validation.py +0 -0
|
@@ -55,37 +55,40 @@ def create_session(
|
|
|
55
55
|
:param scenario:
|
|
56
56
|
:return: Yield a Tuple of the session and the scenario.
|
|
57
57
|
"""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if database_url is None:
|
|
69
|
-
if "DATABASE_URL" in os.environ:
|
|
70
|
-
database_url = os.environ.get("DATABASE_URL")
|
|
58
|
+
managed_session = False
|
|
59
|
+
engine = None
|
|
60
|
+
session = None
|
|
61
|
+
try:
|
|
62
|
+
if isinstance(scenario, Scenario):
|
|
63
|
+
session = inspect(scenario).session
|
|
64
|
+
elif isinstance(scenario, int) or hasattr(scenario, "id"):
|
|
65
|
+
if isinstance(scenario, int):
|
|
66
|
+
scenario_id = scenario
|
|
71
67
|
else:
|
|
72
|
-
|
|
68
|
+
scenario_id = scenario.id
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"The scenario parameter must be either a Scenario object, an integer or an object with an 'id' attribute."
|
|
80
|
-
)
|
|
70
|
+
if database_url is None:
|
|
71
|
+
if "DATABASE_URL" in os.environ:
|
|
72
|
+
database_url = os.environ.get("DATABASE_URL")
|
|
73
|
+
else:
|
|
74
|
+
raise ValueError("No database URL specified.")
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
managed_session = True
|
|
77
|
+
engine = create_engine(database_url)
|
|
78
|
+
session = Session(engine)
|
|
79
|
+
scenario = session.query(Scenario).filter(Scenario.id == scenario_id).one()
|
|
80
|
+
else:
|
|
81
|
+
raise ValueError(
|
|
82
|
+
"The scenario parameter must be either a Scenario object, an integer or an object with an 'id' attribute."
|
|
83
|
+
)
|
|
83
84
|
yield session, scenario
|
|
84
85
|
finally:
|
|
85
|
-
if
|
|
86
|
-
session
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
if managed_session:
|
|
87
|
+
if session is not None:
|
|
88
|
+
session.commit()
|
|
89
|
+
session.close()
|
|
90
|
+
if engine is not None:
|
|
91
|
+
engine.dispose()
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
def _delete_depot(scenario: Scenario, session: Session):
|
|
@@ -147,7 +150,6 @@ def generate_depot_layout(
|
|
|
147
150
|
|
|
148
151
|
|
|
149
152
|
:param scenario: The scenario to be simulated
|
|
150
|
-
:param session: The database session
|
|
151
153
|
:param charging_power: the charging power of the charging area in kW
|
|
152
154
|
:param delete_existing_depot: if there is already a depot existing in this scenario, set True to delete this
|
|
153
155
|
existing depot. Set to False and a ValueError will be raised if there is a depot in this scenario.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eflips_depot-1.1.1 → eflips_depot-1.1.2}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|