Skip to content
2 changes: 1 addition & 1 deletion .idea/copyright/MPLv2.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* Added basic client method to run a hosting capacity calibration and method to query its status.
* Added basic client method to run a hosting capacity work package cost estimation.
* Added `FixedTimeLoadOverride` and `TimePeriodLoadOverride` class
* Added basic client method to run a opendss export, query its information and get a download url for the exported model.

### Enhancements
* Added work package config documentation.
Expand Down
343 changes: 343 additions & 0 deletions src/zepben/eas/client/eas_client.py

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions src/zepben/eas/client/hc_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,36 @@
"BASIC_RESULTS_CONFIG",
]

from zepben.eas import StoredResultsConfig, RawResultsConfig, MetricsResultsConfig, ResultsConfig
from build.lib.zepben.eas.client.work_package import ResultsConfig
from zepben.eas import StoredResultsConfig, RawResultsConfig, MetricsResultsConfig

STORED_RESULTS_CONFIG_STORE_NONE = StoredResultsConfig(
energy_meters_raw=False,
energy_meter_voltages_raw=False,
over_loads_raw=False,
overloads_raw=False,
voltage_exceptions_raw=False
)

STORED_RESULTS_CONFIG_STORE_ALL = StoredResultsConfig(
energy_meters_raw=True,
energy_meter_voltages_raw=True,
over_loads_raw=True,
overloads_raw=True,
voltage_exceptions_raw=True
)

RAW_RESULTS_CONFIG_ALL_RAW_VALUES = RawResultsConfig(
energy_meters_raw=True,
energy_meter_voltages_raw=True,
results_per_meter=True,
over_loads_raw=True,
overloads_raw=True,
voltage_exceptions_raw=True
)

RAW_RESULTS_CONFIG_STANDARD = RawResultsConfig(
energy_meters_raw=True,
energy_meter_voltages_raw=True,
results_per_meter=True,
over_loads_raw=True,
overloads_raw=True,
voltage_exceptions_raw=True
)

Expand All @@ -69,7 +70,7 @@
STANDARD_RESULTS_CONFIG = ResultsConfig(
raw_config=RAW_RESULTS_CONFIG_STANDARD,
metrics_config=METRICS_RESULTS_CONFIG_CALCULATE_PERFORMANCE_METRICS,
stored_results_config=StoredResultsConfig(voltage_exceptions_raw=True, over_loads_raw=True)
stored_results_config=StoredResultsConfig(voltage_exceptions_raw=True, overloads_raw=True)
)

BASIC_RESULTS_CONFIG = ResultsConfig(
Expand Down
61 changes: 61 additions & 0 deletions src/zepben/eas/client/opendss.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2025 Zeppelin Bend Pty Ltd
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from dataclasses import dataclass
from datetime import tzinfo
from enum import Enum
from typing import Union, Optional, List

from zepben.eas.client.work_package import GeneratorConfig, TimePeriod, FixedTime

__all__ = [
"OpenDssConfig",
"OpenDssModelState",
"GetOpenDssModelsFilterInput",
"Order",
"GetOpenDssModelsSortCriteriaInput"
]


@dataclass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unsure on the style guide for this repo, but generally you have 2 blank lines between module level class and function definitions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in f1f4c14

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unsure on the style guide for this repo, but generally you have 2 blank lines between module level class and function definitions

style should be whatever PEP dictated things come built into PyCharm/IntelliJ Idea

class OpenDssConfig:
""" A data class representing the configuration for an opendss export """
scenario: str
year: int
feeder: str
time_zone: tzinfo
load_time: Union[TimePeriod, FixedTime]
generator_config: Optional[GeneratorConfig] = None
model_name: Optional[str] = None
is_public: Optional[bool] = None


class OpenDssModelState(Enum):
COULD_NOT_START = "COULD_NOT_START"
CREATION = "CREATION"
COMPLETED = "COMPLETED"
FAILED = "FAILED"


@dataclass
class GetOpenDssModelsFilterInput:
""" A data class representing the filter to apply to the opendss export run paginated query """
name: Optional[str] = None
is_public: Optional[int] = None
state: Optional[List[OpenDssModelState]] = None


class Order(Enum):
ASC = "ASC"
DESC = "DESC"


@dataclass
class GetOpenDssModelsSortCriteriaInput:
""" A data class representing the sort criteria to apply to the opendss export run paginated query """
name: Optional[Order] = None
created_at: Optional[Order] = None
state: Optional[Order] = None
is_public: Optional[Order] = None
2 changes: 0 additions & 2 deletions src/zepben/eas/client/work_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class SwitchMeterPlacementConfig:

@dataclass
class FixedTimeLoadOverride:

load_watts: Optional[float]
"""
The reading to be used to override load watts
Expand All @@ -95,7 +94,6 @@ class FixedTimeLoadOverride:

@dataclass
class TimePeriodLoadOverride:

load_watts: Optional[List[float]]
"""
A list of readings to be used to override load watts.
Expand Down
Loading