-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated to fix a bug associated with longer time for sim, added other…
… results to nodal hosting capacity analysis
- Loading branch information
EC2 Default User
committed
Mar 14, 2024
1 parent
aeb6995
commit a60038f
Showing
26 changed files
with
296 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
""" | ||
Command line utility for EMeRGE | ||
""" | ||
"""Command line utility for EMeRGE.""" | ||
|
||
from pathlib import Path | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
from typing import Optional | ||
from pathlib import Path | ||
from datetime import datetime | ||
|
||
from sqlmodel import Field, SQLModel, create_engine | ||
|
||
|
||
class HostingCapacityReport(SQLModel, table=True): | ||
id: Optional[int] = Field(default=None, primary_key=True) | ||
node_name: str | ||
hosting_capacity_kw: float | ||
sardi_voltage: float | ||
sardi_line: float | ||
sardi_transformer: float | ||
sardi_aggregated: float | ||
|
||
|
||
class SimulationConvergenceReport(SQLModel, table=True): | ||
id: Optional[int] = Field(default=None, primary_key=True) | ||
capacity_kw: float | ||
node_name: str | ||
convergence: bool | ||
timestamp: datetime | ||
|
||
|
||
class TotalEnergyReport(SQLModel, table=True): | ||
id: Optional[int] = Field(default=None, primary_key=True) | ||
node_name: str | ||
pv_capacity_kw: float | ||
pv_energy_mwh: float | ||
circuit_energy_mwh: float | ||
|
||
class OverloadedLinesReport(SQLModel, table=True): | ||
id: Optional[int] = Field(default=None, primary_key=True) | ||
start_time: datetime | ||
resolution_min: int | ||
node_name: str | ||
line_name: str | ||
loadings: str | ||
|
||
class OverloadedTransformersReport(SQLModel, table=True): | ||
id: Optional[int] = Field(default=None, primary_key=True) | ||
start_time: datetime | ||
resolution_min: int | ||
node_name: str | ||
xfmr_name: str | ||
loadings: str | ||
|
||
def get_engine(sqlite_file: Path): | ||
return create_engine(f"sqlite:///{str(sqlite_file)}") | ||
|
||
def create_table(sqlite_file: Path): | ||
""" Function to create sqlite table.""" | ||
|
||
engine = create_engine(f"sqlite:///{str(sqlite_file)}") | ||
SQLModel.metadata.create_all(engine) | ||
return engine |
Oops, something went wrong.