zepben.ewb 1.1.0b13__py3-none-any.whl → 1.1.0b14__py3-none-any.whl
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.
- zepben/ewb/model/cim/iec61970/base/core/identified_object.py +5 -2
- zepben/ewb/model/cim/iec61970/base/wires/regulating_cond_eq.py +2 -1
- zepben/ewb/services/common/translator/base_proto2cim.py +1 -1
- zepben/ewb/services/network/network_extensions.py +5 -5
- zepben/ewb/util.py +3 -9
- {zepben_ewb-1.1.0b13.dist-info → zepben_ewb-1.1.0b14.dist-info}/METADATA +1 -1
- {zepben_ewb-1.1.0b13.dist-info → zepben_ewb-1.1.0b14.dist-info}/RECORD +10 -10
- {zepben_ewb-1.1.0b13.dist-info → zepben_ewb-1.1.0b14.dist-info}/WHEEL +0 -0
- {zepben_ewb-1.1.0b13.dist-info → zepben_ewb-1.1.0b14.dist-info}/licenses/LICENSE +0 -0
- {zepben_ewb-1.1.0b13.dist-info → zepben_ewb-1.1.0b14.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,7 @@ from typing import Callable, Any, List, Generator, Optional, overload, TypeVar
|
|
|
14
14
|
from zepben.ewb.dataclassy import dataclass
|
|
15
15
|
from zepben.ewb.model.cim.iec61970.base.core.name import Name
|
|
16
16
|
from zepben.ewb.model.cim.iec61970.base.core.name_type import NameType
|
|
17
|
-
from zepben.ewb.util import require,
|
|
17
|
+
from zepben.ewb.util import require, nlen, ngen, safe_remove
|
|
18
18
|
|
|
19
19
|
logger = logging.getLogger(__name__)
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ class IdentifiedObject(object, metaclass=ABCMeta):
|
|
|
30
30
|
relation, however must be in snake case to keep the phases PEP compliant.
|
|
31
31
|
"""
|
|
32
32
|
|
|
33
|
-
mrid: str
|
|
33
|
+
mrid: str
|
|
34
34
|
"""Master resource identifier issued by a model authority. The mRID is unique within an exchange context.
|
|
35
35
|
Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended."""
|
|
36
36
|
|
|
@@ -46,6 +46,9 @@ class IdentifiedObject(object, metaclass=ABCMeta):
|
|
|
46
46
|
|
|
47
47
|
def __init__(self, names: Optional[List[Name]] = None, **kwargs):
|
|
48
48
|
super(IdentifiedObject, self).__init__(**kwargs)
|
|
49
|
+
if not self.mrid or not self.mrid.strip():
|
|
50
|
+
raise ValueError("You must provide an mRID for this object.")
|
|
51
|
+
|
|
49
52
|
if names:
|
|
50
53
|
for name in names:
|
|
51
54
|
self.add_name(name.type, name.name)
|
|
@@ -28,7 +28,8 @@ class RegulatingCondEq(EnergyConnection):
|
|
|
28
28
|
|
|
29
29
|
def __init__(self, regulating_control: Optional[RegulatingControl] = None, **kwargs):
|
|
30
30
|
super(RegulatingCondEq, self).__init__(**kwargs)
|
|
31
|
-
|
|
31
|
+
if regulating_control:
|
|
32
|
+
self.regulating_control = regulating_control
|
|
32
33
|
|
|
33
34
|
@property
|
|
34
35
|
def regulating_control(self):
|
|
@@ -79,7 +79,7 @@ def document_to_cim(pb: PBDocument, cim: Document, service: BaseService):
|
|
|
79
79
|
@bind_to_cim
|
|
80
80
|
@add_to_network_or_none
|
|
81
81
|
def organisation_to_cim(pb: PBOrganisation, service: BaseService) -> Optional[Organisation]:
|
|
82
|
-
cim = Organisation()
|
|
82
|
+
cim = Organisation(mrid=pb.mrid())
|
|
83
83
|
|
|
84
84
|
identified_object_to_cim(pb.io, cim, service)
|
|
85
85
|
return cim
|
|
@@ -18,7 +18,7 @@ from zepben.ewb.model.cim.iec61970.base.wires.junction import Junction
|
|
|
18
18
|
from zepben.ewb.model.cim.iec61970.base.wires.power_transformer import PowerTransformer
|
|
19
19
|
from zepben.ewb.model.cim.iec61970.base.wires.power_transformer_end import PowerTransformerEnd
|
|
20
20
|
from zepben.ewb.services.network.network_service import NetworkService
|
|
21
|
-
from zepben.ewb.util import
|
|
21
|
+
from zepben.ewb.util import generate_id
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
# !! WARNING !! #
|
|
@@ -39,7 +39,7 @@ def create_two_winding_power_transformer(network_service: NetworkService, cn1: C
|
|
|
39
39
|
_connect_two_terminal_conducting_equipment(network_service=network_service, ce=power_transformer, cn1=cn1, cn2=cn2)
|
|
40
40
|
# TODO: How to associated PowerTransformerEndInfo to a PowerTransformerInfo
|
|
41
41
|
for i in range(1, 2):
|
|
42
|
-
end = PowerTransformerEnd(power_transformer=power_transformer)
|
|
42
|
+
end = PowerTransformerEnd(f"{power_transformer.mrid}-pte{i}", power_transformer=power_transformer)
|
|
43
43
|
power_transformer.add_end(end)
|
|
44
44
|
end.terminal = power_transformer.get_terminal_by_sn(i)
|
|
45
45
|
return power_transformer
|
|
@@ -69,7 +69,7 @@ def create_breaker(network_service: NetworkService, cn1: ConnectivityNode, cn2:
|
|
|
69
69
|
def create_bus(network_service: NetworkService, **kwargs) -> Junction:
|
|
70
70
|
bus = Junction(**kwargs)
|
|
71
71
|
if 'mrid' not in kwargs:
|
|
72
|
-
bus.mrid =
|
|
72
|
+
bus.mrid = generate_id()
|
|
73
73
|
network_service.add(bus)
|
|
74
74
|
_create_terminals(ce=bus, network=network_service)
|
|
75
75
|
# TODO: Figure out how to add Voltage to Buses - Looks like we need to add topologicalNode to support the
|
|
@@ -79,7 +79,7 @@ def create_bus(network_service: NetworkService, **kwargs) -> Junction:
|
|
|
79
79
|
|
|
80
80
|
def _create_two_terminal_conducting_equipment(network_service: NetworkService, ce: ConductingEquipment, **kwargs):
|
|
81
81
|
if 'mrid' not in kwargs:
|
|
82
|
-
ce.mrid =
|
|
82
|
+
ce.mrid = generate_id()
|
|
83
83
|
network_service.add(ce)
|
|
84
84
|
_create_terminals(ce=ce, num_terms=2, network=network_service)
|
|
85
85
|
|
|
@@ -92,7 +92,7 @@ def _connect_two_terminal_conducting_equipment(network_service: NetworkService,
|
|
|
92
92
|
|
|
93
93
|
def _create_single_terminal_conducting_equipment(network_service: NetworkService, ce: ConductingEquipment, **kwargs):
|
|
94
94
|
if 'mrid' not in kwargs:
|
|
95
|
-
ce.mrid =
|
|
95
|
+
ce.mrid = generate_id()
|
|
96
96
|
network_service.add(ce)
|
|
97
97
|
_create_terminals(ce=ce, network=network_service)
|
|
98
98
|
|
zepben/ewb/util.py
CHANGED
|
@@ -15,7 +15,7 @@ __all__ = [
|
|
|
15
15
|
"is_none_or_empty",
|
|
16
16
|
"require",
|
|
17
17
|
"pb_or_none",
|
|
18
|
-
"
|
|
18
|
+
"generate_id",
|
|
19
19
|
"datetime_to_timestamp",
|
|
20
20
|
"none",
|
|
21
21
|
"classproperty",
|
|
@@ -170,14 +170,8 @@ def none(collection: Collection):
|
|
|
170
170
|
raise ValueError("none() only supports collection types")
|
|
171
171
|
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
def __init__(self):
|
|
176
|
-
super().__init__(bytes=os.urandom(16), version=4)
|
|
177
|
-
|
|
178
|
-
@staticmethod
|
|
179
|
-
def copy():
|
|
180
|
-
return str(UUID(bytes=os.urandom(16), version=4))
|
|
173
|
+
def generate_id() -> str:
|
|
174
|
+
return str(UUID(bytes=os.urandom(16), version=4))
|
|
181
175
|
|
|
182
176
|
|
|
183
177
|
class classproperty(property):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zepben.ewb
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.0b14
|
|
4
4
|
Summary: Python SDK for interacting with the Energy Workbench platform
|
|
5
5
|
Author-email: Kurt Greaves <kurt.greaves@zepben.com>, Max Chesterfield <max.chesterfield@zepben.com>
|
|
6
6
|
License-Expression: MPL-2.0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
zepben/ewb/__init__.py,sha256=nPkN55KJGBRGRk7fLZAFmzaxu9Z7RR7gGAAwFWdy3lY,40580
|
|
2
2
|
zepben/ewb/exceptions.py,sha256=KLR6_5U-K4_VtKQZkKBlbOF7wlKnajQuhSiGeeNAo9U,1384
|
|
3
3
|
zepben/ewb/types.py,sha256=067jjQX6eCbgaEtlQPdSBi_w4_16unbP1f_g5NrVj_w,627
|
|
4
|
-
zepben/ewb/util.py,sha256=
|
|
4
|
+
zepben/ewb/util.py,sha256=JAa6epASTcxbu6gISzYJPjCGhckIugMd6tnVRMlSlMc,5605
|
|
5
5
|
zepben/ewb/auth/__init__.py,sha256=DUsi8JWvKMQt4xEUCHbCVPjGkEfr2MRu2JIvobYTB-M,406
|
|
6
6
|
zepben/ewb/auth/client/__init__.py,sha256=nFdcikJb3FegBko35m1xxmjMmC3cZCaqr8ohypQJQIQ,245
|
|
7
7
|
zepben/ewb/auth/client/zepben_token_fetcher.py,sha256=q1-co2LSWPwuSzzUZmNLYmjsQaCIrfSu4tOxwS_TMMk,12201
|
|
@@ -396,7 +396,7 @@ zepben/ewb/model/cim/iec61970/base/core/equipment.py,sha256=y5qhryMlYmcJfMQYc4wF
|
|
|
396
396
|
zepben/ewb/model/cim/iec61970/base/core/equipment_container.py,sha256=1GjHcISjQlh9OqgIJ3Sy5VguQvoJ1Ts_lYCkdkVnLHQ,8116
|
|
397
397
|
zepben/ewb/model/cim/iec61970/base/core/feeder.py,sha256=5gG8KopIsp1z9D3r9sCUc5y2I7oiTgJ7LF-DRhm2PT4,11368
|
|
398
398
|
zepben/ewb/model/cim/iec61970/base/core/geographical_region.py,sha256=LsOfVHuWL32zjPvgylpqiTsP9uvOeREVKgvKYMgZOOQ,3852
|
|
399
|
-
zepben/ewb/model/cim/iec61970/base/core/identified_object.py,sha256=
|
|
399
|
+
zepben/ewb/model/cim/iec61970/base/core/identified_object.py,sha256=TwY7M6zpd-Wvb8LxyHAUFJq6-lkioUtSVqxh0P689Gc,9928
|
|
400
400
|
zepben/ewb/model/cim/iec61970/base/core/name.py,sha256=Jgq664dfkYxVgYt4ThJM6g5NaJg40GW5ePZg4nVRC8Q,1285
|
|
401
401
|
zepben/ewb/model/cim/iec61970/base/core/name_type.py,sha256=N-ZCjV_ihvq4iTVBSrVYuew4Uc9gtFSJq1qElcK9jmI,7888
|
|
402
402
|
zepben/ewb/model/cim/iec61970/base/core/phase_code.py,sha256=8PWCBOSDniP_921sD8Qh30RVUTdWfWur0NvdeZLXlTI,7049
|
|
@@ -478,7 +478,7 @@ zepben/ewb/model/cim/iec61970/base/wires/protected_switch.py,sha256=yMn2MMvbViXL
|
|
|
478
478
|
zepben/ewb/model/cim/iec61970/base/wires/ratio_tap_changer.py,sha256=iYrZd8rjFfuPC-wGuYFKfNRBuHuA2Ss9ad_Gnt7qj_o,1161
|
|
479
479
|
zepben/ewb/model/cim/iec61970/base/wires/reactive_capability_curve.py,sha256=RvnW7HjAxsl3DNM9ABgzBqaoOSnbPBVwdvoIWwCMMj8,824
|
|
480
480
|
zepben/ewb/model/cim/iec61970/base/wires/recloser.py,sha256=UmL-qht9TL_VDZMUdWQ_4HeCG6dZLl_1G1ggro802VY,541
|
|
481
|
-
zepben/ewb/model/cim/iec61970/base/wires/regulating_cond_eq.py,sha256=
|
|
481
|
+
zepben/ewb/model/cim/iec61970/base/wires/regulating_cond_eq.py,sha256=ead_d22h_GieSz2soOfBhaUq_B1q3zie1lKVK9uQs_s,1827
|
|
482
482
|
zepben/ewb/model/cim/iec61970/base/wires/regulating_control.py,sha256=tyYfQHj_Fo4WJyyOglkvxg5D_D4zeB1kniH3EvcmHsk,9343
|
|
483
483
|
zepben/ewb/model/cim/iec61970/base/wires/regulating_control_mode_kind.py,sha256=qzxns3WLPo_bICQgctvPuz_667RB2gG0s51i7JXKH98,1203
|
|
484
484
|
zepben/ewb/model/cim/iec61970/base/wires/rotating_machine.py,sha256=pn8V5O5TPIhmWWX1hri27INs_iOEvQePukvjEN4A8HY,1513
|
|
@@ -514,7 +514,7 @@ zepben/ewb/services/common/meta/metadata_translations.py,sha256=O8tW3YVrogmKEAOE
|
|
|
514
514
|
zepben/ewb/services/common/meta/service_info.py,sha256=EX1iwDv6ENS4la-hs9XQXjfKv10bM-P_WYx48xW42ik,609
|
|
515
515
|
zepben/ewb/services/common/translator/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
|
|
516
516
|
zepben/ewb/services/common/translator/base_cim2proto.py,sha256=OxlXiFiZGxdinqBgbmHSOEnOZNKhJgmvg_jswDSgKkw,3860
|
|
517
|
-
zepben/ewb/services/common/translator/base_proto2cim.py,sha256=
|
|
517
|
+
zepben/ewb/services/common/translator/base_proto2cim.py,sha256=afGTsUnax3fvZTfAm014OM5dZiIlZwxLJxxGxgU02_Q,5217
|
|
518
518
|
zepben/ewb/services/common/translator/service_differences.py,sha256=ZFbGFMxTTnT4zt4zIt2BK_ikg_71vGkkmH8JhII2bMc,2913
|
|
519
519
|
zepben/ewb/services/common/translator/util.py,sha256=C7KGB5B7I3j2uSlDLtKUeQUNSFqLCqz4u9vA-TKKE34,2292
|
|
520
520
|
zepben/ewb/services/customer/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
|
|
@@ -537,7 +537,7 @@ zepben/ewb/services/measurement/translator/__init__.py,sha256=IoQHJ-CYDhqiYL6WKK
|
|
|
537
537
|
zepben/ewb/services/measurement/translator/measurement_cim2proto.py,sha256=syPJC3FtXyNrJNRDc4oCLZUL0kzgyXRI7CsRmrbznhI,2114
|
|
538
538
|
zepben/ewb/services/measurement/translator/measurement_proto2cim.py,sha256=fsRXt_txPzUWDrFreZ1C1LcizUZQ-qlFq2aGADo9Q_E,2326
|
|
539
539
|
zepben/ewb/services/network/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
|
|
540
|
-
zepben/ewb/services/network/network_extensions.py,sha256=
|
|
540
|
+
zepben/ewb/services/network/network_extensions.py,sha256=PGkeW2z5WNpQ8MeQIfCpTUL7ukne2uHO9R-PlBKEWyg,6127
|
|
541
541
|
zepben/ewb/services/network/network_service.py,sha256=tfmafoAK36bv_aMPL0zCagd3-RjUwGJX1MUeF5xZup4,12574
|
|
542
542
|
zepben/ewb/services/network/network_service_comparator.py,sha256=sxbseccB4l_K399rJVJxnmaOT6m4QGKlNbdTtBGbBfs,61978
|
|
543
543
|
zepben/ewb/services/network/network_state.py,sha256=PQo1xm6p4WGHzLtd4zy3nYMJ6miR3ypj7hSQx_dRgXY,837
|
|
@@ -635,8 +635,8 @@ zepben/ewb/streaming/mutations/update_network_state_client.py,sha256=e0Oma5PRT8m
|
|
|
635
635
|
zepben/ewb/streaming/mutations/update_network_state_service.py,sha256=irR-TO67QXRyBmK8PU8SzM31NKSSefZt_nQGHi5IhT8,3260
|
|
636
636
|
zepben/ewb/testing/__init__.py,sha256=waADXEvfUG9wAN4STx5uIUHOv0UnpZLH2qU1LXgaDBc,243
|
|
637
637
|
zepben/ewb/testing/test_network_builder.py,sha256=KG0o2ZHUswx3xClu-JnLs_pYIYbQ5jjtvtyZ7LI6IZ8,38092
|
|
638
|
-
zepben_ewb-1.1.
|
|
639
|
-
zepben_ewb-1.1.
|
|
640
|
-
zepben_ewb-1.1.
|
|
641
|
-
zepben_ewb-1.1.
|
|
642
|
-
zepben_ewb-1.1.
|
|
638
|
+
zepben_ewb-1.1.0b14.dist-info/licenses/LICENSE,sha256=aAHD66h6PQIETpkJDvg5yEObyFvXUED8u7S8dlh6K0Y,16725
|
|
639
|
+
zepben_ewb-1.1.0b14.dist-info/METADATA,sha256=VSIGJM4iXIDCoFijeZWfaAHCuVCfc8hx9zmVoHYeAHE,3233
|
|
640
|
+
zepben_ewb-1.1.0b14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
641
|
+
zepben_ewb-1.1.0b14.dist-info/top_level.txt,sha256=eVLDJiO6FGjL_Z7KdmFE-R8uf1Q07aaVLGe9Ee4kmBw,7
|
|
642
|
+
zepben_ewb-1.1.0b14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|