Skip to content

Commit

Permalink
Al/import fix (#62)
Browse files Browse the repository at this point in the history
* import fixes
* catalog system import fix
* version bump
  • Loading branch information
AadilLatif authored Dec 6, 2024
1 parent 42c89b9 commit 7fefba2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/gdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,7 @@
from gdm.distribution.curve import Curve, TimeCurrentCurve

from gdm.distribution.network.reducer import reduce_to_three_phase_system
from gdm.distribution.components.distribution_inverter import (
DistributionInverter,
)
from gdm.distribution.catalog_system import CatalogSystem
8 changes: 4 additions & 4 deletions src/gdm/distribution/components/distribution_inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
)


class DistrbutionInverter(DistributionComponentBase):
class DistributionInverter(DistributionComponentBase):
controller: Annotated[
InverterControllerBase,
Field(
...,
PowerfactorInverterController.example(),
description="The controller which is used for the PV array.",
),
]
Expand All @@ -27,10 +27,10 @@ class DistrbutionInverter(DistributionComponentBase):
]

@classmethod
def example(cls) -> "DistrbutionInverter":
def example(cls) -> "DistributionInverter":
"""Example of a Distribution Inverter with a predefined controller and equipment."""

return DistrbutionInverter(
return DistributionInverter(
name="inverter1",
controller=PowerfactorInverterController.example(),
equipment=InverterEquipment.example(),
Expand Down
8 changes: 4 additions & 4 deletions src/gdm/distribution/components/distribution_solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import Field

from gdm.distribution.components.distribution_inverter import DistrbutionInverter
from gdm.distribution.components.distribution_inverter import DistributionInverter
from gdm.distribution.components.distribution_feeder import DistributionFeeder
from gdm.distribution.components.base.distribution_component_base import (
DistributionComponentBase,
Expand Down Expand Up @@ -42,7 +42,7 @@ class DistributionSolar(DistributionComponentBase):
),
]
inverter: Annotated[
DistrbutionInverter,
DistributionInverter,
Field(
...,
description="Inverter model for the Distribution Solar PV system.",
Expand Down Expand Up @@ -86,7 +86,7 @@ def aggregate(
for inst in instances
),
),
inverter=DistrbutionInverter(
inverter=DistributionInverter(
name=f"{name}_inverter",
equipment=InverterEquipment(
capacity=sum(inst.inverter.equipment.capacity for inst in instances)
Expand Down Expand Up @@ -122,5 +122,5 @@ def example(cls) -> "DistributionSolar":
feeder=DistributionFeeder.example(),
phases=[Phase.A, Phase.B, Phase.C],
equipment=SolarEquipment.example(),
inverter=DistrbutionInverter.example(),
inverter=DistributionInverter.example(),
)
2 changes: 1 addition & 1 deletion src/gdm/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import platform
import sys

VERSION = "1.3.1"
VERSION = "1.3.2"


def is_git_repo(dir: Path) -> bool:
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from datetime import datetime, timedelta
from uuid import uuid4

from gdm.distribution.components.distribution_inverter import DistrbutionInverter
from gdm.distribution.equipment.inverter_equipment import InverterEquipment
from gdm.distribution.equipment.solar_equipment import SolarEquipment
from gdm.distribution.controllers.distribution_inverter_controller import (
Expand All @@ -17,6 +16,7 @@
MatrixImpedanceBranch,
PositiveReactivePower,
PositiveApparentPower,
DistributionInverter,
PositiveActivePower,
CapacitancePULength,
DistributionSystem,
Expand Down Expand Up @@ -87,7 +87,7 @@ def build_distribution_solar(bus: DistributionBus, bus_number: int):
"uuid": uuid4(),
"name": f"solar_{bus_number}",
"bus": bus,
"inverter": DistrbutionInverter.example().model_copy(
"inverter": DistributionInverter.example().model_copy(
update={
"uuid": uuid4(),
"name": f"inverter_{bus_number}",
Expand Down Expand Up @@ -323,7 +323,7 @@ def build_split_phase_solar(bus: DistributionBus, bus_number: int):
resistance=1,
reactance=1,
),
inverter=DistrbutionInverter(
inverter=DistributionInverter(
name=f"pv_inverter_{bus_number}",
controller=PowerfactorInverterController.example(),
equipment=InverterEquipment(
Expand Down

0 comments on commit 7fefba2

Please sign in to comment.