Releases: zepben/ewb-sdk-python
v0.37.4
Notes
- Update to support requests up to version 3.0.0 (exclusive)
- Update to corresponding zepben.auth library for requests support
v0.40.0
Breaking Changes
- The database has been split into three databases, which will change the imports of most related classes:
- The existing database containing the network model (
*-network-model.sqlite) with classes in thenetworkpackage. - A new database containing the customer information (
*-customers.sqlite) with classes in thecustomerpackage. - A new database containing the diagrams (
*-diagrams.sqlite) with classes in thediagrampackage.
- The existing database containing the network model (
- The database split has resulted in the database classes also being split, e.g.
DatabaseReaderis nowNetworkDatabaseReader,CustomerDatabaseReaderandDiagramDatabaseReader. - Database table classes now return a
Generatorrather than aListor their index collections. This will have no impact if you are just looping over the
result, but it will have an impact if you have inherited your own tables. EquipmenttoEquipmentContainerlinks for LV feeders are no longer written to the database, they should never have been.- Converted the following classes to use
@dataclassfromdataclassesinstead ofdataclassy:PositionPointTownDetailStreetDetailStreetAddressNameDiagramObjectPointRelaySettingTransformerEndRatedSResistanceReactanceDataSource
- All private collections inside our CIM objects that index objects by mrid now raise
KeyErrorrather thanValueErrorif you try and remove an object from
an empty collection. - Rationalised accessors for the private collections inside our CIM objects, which has added and/or removed some functions. If you were using one of the removed
functions, there should be another that can give close/equivalent operation. The most notable change is the accessors should now be throwing exceptions
correctly, rather than returningNonein some circumstances and throwing in others.Location:get_pointnow throws when provided an invalidsequence_numberrather than returningNone.- Updated error message for providing an incorrect
sequence_numbertoinsert_point.
RelayInfo:get_delayandremove_delay_atnow throw when provided an invalidindexrather than returningNone.- Updated error message for providing an incorrect
indextoadd_delay.
Sensor:- Type information for
get_relay_functionhas been updated to indicate the return value is not optional, as the function throws if themridis unknown.
- Type information for
ConductingEquipment:- Updated error message for providing a
Terminalwith an incorrectsequence_numbertoadd_terminal.
- Updated error message for providing a
IdentifiedObject:get_namenow throws when provided an invalidname_typeornamerather than returningNone.get_namesnow throws when provided an invalidname_typerather than returningNoneif it had no names, or anEmptyListif it had names, but none
of the requested type.
DiagramObject:- Updated error message for providing an incorrect
sequence_numbertoinsert_point.
- Updated error message for providing an incorrect
ProtectionRelayFunction:- Updated error message for providing an incorrect
sequence_numbertoadd_threshold. - Type information for
get_thresholdhas been updated to indicate the return value is not optional, as the function throws if thesequence_numberis
unknown. - Type information for
remove_thresholdhas been updated to indicate thethresholdto remove is not optional. - Updated error message for providing an incorrect
indextoadd_time_limit. remove_time_limit_by_time_limitwas renamed toremove_time_limit.remove_time_limitwas renamed toremove_time_limit_atand now throws when provided an invalidindexrather than returningNone.- Type information for the following functions have been updated to indicate the return value is not optional, as the functions throw if the
mridis
unknown:get_sensorget_protected_switchget_scheme
- Updated error message for providing an incorrect
ProtectionRelayScheme:- Type information for
get_functionhas been updated to indicate the return value is not optional, as the function throws if themridis unknown.
- Type information for
ProtectionRelaySystem:- Type information for
get_schemehas been updated to indicate the return value is not optional, as the function throws if themridis unknown.
- Type information for
PowerTransformerEnd:- Updated error message for providing a
PowerTransformerEndwith an incorrectend_numbertoadd_end. get_rating_by_rated_shas been removed.get_rating_by_cooling_typehas been renamed toget_ratingand now throws when provided an invalidcooling_typerather than returningNone.- The parameters for
add_ratinghave been reordered, andcooling_typenow defaults toUNKNOWN_COOLING_TYPE. add_transformer_end_rated_snow takes a copy of the providedtransformer_end_rated_srather than adding the object directly into the collection.remove_rating_by_cooling_typenow throws when provided an invalidcooling_typerather than returningNone.
- Updated error message for providing a
ProtectedSwitch:- Type information for
get_relay_functionhas been updated to indicate the return value is not optional, as the function throws if themridis unknown.
- Type information for
RegulatingControl:- Type information for
get_regulating_cond_eqhas been updated to indicate the return value is not optional, as the function throws if themridis
unknown.
- Type information for
New Features
- Support zepben.auth 0.12.0 which brings support for auth against EWB servers backed by EntraID.
Enhancements
- Added the following accessors/helpers to our CIM objects:
Location.for_each_pointRelayInfo.for_each_pointIdentifiedObject.has_nameDiagramObject.for_each_pointDiagramObject.remove_point_by_sequence_numberProtectionRelayFunction.for_each_thresholdProtectionRelayFunction.remove_threshold_atProtectionRelayFunction.for_each_time_limit
- Added missing
num_controlsfield toPowerSystemResource.
Fixes
- Added missing type information to the following
NameTypefunctions:get_or_add_name,remove_nameandremove_names
Notes
- Updated to support zepben.protobuf 0.27.0. This has actually been supported since 0.38.0, however the released version was not captured in the dependencies.
v0.39.0
Breaking Changes
- None.
New Features
- Added
EwbDataFilePathsclass for working with the EWB various database files
Enhancements
- Added feature list to documentation.
Fixes
- Updated zepben.auth to 0.11.1 to fix incorrect audience processing when requesting tokens with Entra.
Notes
- None.
v0.38.0
Breaking Changes
- This is the last release using an artifact name of
zepben.evolve, future releases will be made aszepben.ewb. connect_with_secret()andconnect_with_password()will no longer create aZepbenTokenFetcherdirectly from kwargs.IdentifiedObject.addNamehas been refactored to take in astrand aNameType. This is doing the same thing under the hood as previousadd_name()
function,
but simplifies the input by lowering the amount of objects that needed to be created prior to adding names.
Example usage change:
obj.add_name(nameType, "name", obj))orobj.add_name(nameType.getOrAddName("name", obj))becomesobj.add_name("name", nameType)add_name()/remove_name()related function for bothIdentifiedObjectandNameTypewill now also perform the same function on the other object type.
i.e. Removing a name from the identified object will remove it from the name type and vice versa. Same interaction is also applied to adding a name.- Removed
ProtectionEquipment. - Change of inheritance:
CurrentRelay→ProtectionEquipment.
becomesCurrentRelay→ProtectionRelayFunction. - Removed symmetric relation
ProtectionEquipment↔ProtectedSwitch. - Renamed
CurrentRelayInfotoRelayInfo.- The override
CurrentRelay.relay_infohas been moved fromCurrentRelayto its new parent class,ProtectionRelayFunction. - Renamed
RelayInfo.remove_delaytoRelayInfo.remove_delay_at. The original method name has been repurposed to remove a delay by its value rather than its
index.
- The override
- Reworked values for enumerable type
ProtectionKind.
New Features
- Added support for passing the grpc channel configuration options to the
GrpcChannelBuilder. - Added
get_names(IdentifiedObject)toNameTypeto retrieve all names associated with theNameTypethat belongs to anIdentifiedObject. - Added
get_names(NameType)andget_names(String)toIdentifiedObjectso user can retrieve all names for a givenNameTypeof theIdentifiedObject - Added new classes and fields to support advanced modelling of protection relays:
SeriesCompensator: A series capacitor or reactor or an AC transmission line without charging susceptance.Ground: A point where the system is grounded used for connecting conducting equipment to ground.GroundDisconnector: A manually operated or motor operated mechanical switching device used for isolating a circuit
or equipment from ground.ProtectionRelayScheme: A scheme that a group of relay functions implement. For example, typically schemes are
primary and secondary, or main and failsafe.ProtectionRelayFunction: A function that a relay implements to protect equipment.ProtectionRelaySystem: A relay system for controllingProtectedSwitches.RelaySetting: The threshold settings for a given relay.VoltageRelay: A device that detects when the voltage in an AC circuit reaches a preset voltage.DistanceRelay: A protective device used in power systems that measures the impedance of a transmission line to
determine the distance to a fault, and initiates circuit breaker tripping to isolate the faulty
section and safeguard the power system.RelayInfo.reclose_fast: True if reclose_delays are associated with a fast Curve, False otherwise.RegulatingControl.rated_current: The rated current of associated CT in amps for a RegulatingControl.
Enhancements
GrpcChannelBuildertests the connectivity of newly created channels before returning them to the user. This is done by callinggetMetadata()against all
known services, the channel is returned after the first successful response. Any connectivity errors will be propagated to the user. If no connectivity errors
are encountered but no successful response is received from the known services, aGrpcConnectionExceptionis thrown.
Fixes
SetDirectionnow traces through non-substation transformers.Feeder.normal_head_terminalcan now be freely updated when theFeederhas no equipment assigned to it.PotentialTransformernow recognised as a valid identified object type when deserializing gRPC messages.
Notes
- Default grpc channel message size is now 20MB.
v0.37.3
Breaking Changes
- None.
New Features
- None.
Enhancements
- None.
Fixes
PotentialTransformernow recognised as a valid identified object type when deserializing gRPC messages.
Notes
- None.
v0.37.2
Breaking Changes
- None.
New Features
- Added support for passing the grpc channel configuration options to the
GrpcChannelBuilder.
Enhancements
- None.
Fixes
- None.
Notes
- Default grpc channel message size is now 20MB.
v0.37.1
Fixes
- Use zepben.auth 0.11.1.
v0.37.0
Zepben Python SDK
[0.37.0] - 2024-11-14
Breaking Changes
-
- Updated to evolve-grpc 0.26.0.
New Features
- PowerTransformerEnd now supports multiple ratings based on cooling types attached to the transformer. Use new
add_ratingandget_ratingmethods.- See notes section for deprecation information of
rated_s.
- See notes section for deprecation information of
- Added new classes:
- TapChangerControl
- EvChargingUnit
- RegulatingControl
- Added new fields:
- Equipment.commissioned_date
- UsagePoint
- rated_power
- approved_inverter_capacity
- ProtectionEquipment
- directable
- power_direction
- CurrentRelayInfo.reclose_delays
- DER register fields on PowerElectronicsConnection
- Added new enums
- PowerDirectionKind
- RegulatingControlModeKind
- TransformerCoolingType
Enhancements
- Update docusaurus and its configuration.
Fixes
- None.
Notes
- Setting PowerTransformerEnd.rated_s directly has been deprecated. You should now use
add_ratingandget_ratingto set arated_salongside a defined
TransformerCoolingTypeif one is known. By default thecoolingTypewill beUNKNOWN.
v0.36.0
Zepben Python SDK
[0.36.0] - UNRELEASED
Breaking Changes
- None.
New Features
- Support using Azure Entra ID as an auth provider
- Added support for connecting to EWB utilising Azure managed identities. Use the new function
connect_with_identity()
Enhancements
- None.
Fixes
- None.
Notes
- None.
v0.35.0
[0.35.0]
Breaking Changes
-
Renamed the module for
GrpcChannelBuilderfromchannel_buildertogrpc_channel_builder. -
GrpcChannelBuilder().make_securenow takes filenames instead of bytestrings.
The order of the parameters has also been changed:private_keynow comes aftercertificate_chain.- This changes also applies to any TLS parameters in
connect_*functions.
- This changes also applies to any TLS parameters in
-
GrpcChannelBuilder().socket_addresshas been renamed tofor_address. -
GrpcChannelBuilder().token_fetcherhas been renamed towith_token_fetcher. -
Refactored
AuthTokenPluginto a separate module. -
Removed deprecated
connectandconnect_asyncfunctions. They have been replaced with several simpler functions, e.g.connect_with_password. -
Changed
connect_with_secretandconnect_with_passwordparameters:- The address of the authentication config is now specified with a single parameter:
conf_address. - Added optional parameters
verify_confandverify_auth, which are passed through torequests.getandrequests.put
when fetching the authentication config and requesting access tokens respectively. cais replaced withca_filename, which can be set to the filename of a CA to use when verifying the certificate
of the gRPC service.
- The address of the authentication config is now specified with a single parameter:
-
Refactored
TreeNodeclass to its own submodule:zepben.evolve.services.network.tracing.tree.tree_node. -
Renamed
FeederDirection.hastoFeederDirection.__contains__, which can be used via its operator versionin. e.g.BOTH.has(DOWNSTREAM)can be replaced
withBOTH.__contains__(DOWNSTREAM)orDOWNSTREAM in BOTH -
Removed deprecated function
NetworkConsumerClient.get_feeder. -
Refactored the following
Switchdescendant classes to their own submodules inzepben.evolve.model.cim.iec61970.base.wires:Breakermoved tobreakerDisconnectormoved todisconnectorFusemoved tofuseJumpermoved tojumperLoadBreakSwitchmoved toload_break_switchProtectedSwitchmoved toprotected_switchReclosermoved torecloser
Note that
from zepben.evolve import <ClassName>will still work as usual for all of the above classes. -
DatabaseReader().loadis now an asynchronous function. -
The addition of the
mridandconnectivity_node_mridarguments to theTestNetworkBuilderfunctions has changed the position of theactionargument. If
you are using positional arguments you will need to addaction=before your actions if you do not specify your own mRIDs. -
SetDirection.run(NetworkService)will no longer set directions for feeders with a head terminal on an open switch. It is expected these feeders are either
placeholder feeders with no meaningful equipment, or are energised from another feeder which will set the directions from the other end.
New Features
- Added support for current transformers and power transformers with the following classes in
zepben.evolve.cim.*:- In
zepben.evolve.cim.iec61968.infiec61968.infassetinfo:CurrentTransformerInfo: Properties of current transformer asset.PotentialTransformerInfo: Properties of potential transformer asset.
- In
zepben.evolve.cim.iec61968.infiec61968.infcommon:Ratio: Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient.
- In
zepben.evolve.cim.iec61970.base.auxiliaryequipment:CurrentTransformer: Instrument transformer used to measure electrical qualities of the circuit that is being protected and/or monitored.PotentialTransformer: Instrument transformer (also known as Voltage Transformer) used to measure electrical qualities of the circuit that
is being protected and/or monitored.PotentialTransformerKind: The construction kind of the potential transformer. (Enum)Sensor: This class describes devices that transform a measured quantity into signals that can be presented at displays,
used in control or be recorded.
- In
- Added
PowerTransformer().get_end_by_terminal, which gets aPowerTransformerEndby theTerminalit's connected to. - Added the following functions to
connected_equipment_trace.pyfor creating traces that work onConductingEquipment, and ignore phase connectivity, instead
considering things to be connected if they share aConnectivityNode:new_normal_downstream_equipment_trace: Creates a trace that traverses in the downstream direction using the normal state of the network.new_normal_upstream_equipment_trace: Creates a trace that traverses in the upstream direction using the normal state of the network.new_current_downstream_equipment_trace: Creates a trace that traverses in the downstream direction using the current state of the network.new_current_upstream_equipment_trace: Creates a trace that traverses in the upstream direction using the current state of the network.
- Added support for protection equipment with the following classes, enums, and fields:
SwitchInfo: Switch datasheet information.ProtectionEquipment: An electrical device designed to respond to input conditions in a prescribed manner and after specified conditions are met to cause
contact operation or similar abrupt change in associated electric control circuits, or simply to display the detected condition.CurrentRelay: A device that checks current flow values in any direction or designated direction.CurrentRelayInfo: Current relay datasheet information.ProtectionKind: The kind of protection being provided by this protection equipment.ProtectedSwitch().breaking_capacity: The maximum fault current in amps a breaking device can break safely under prescribed conditions of use.ProtectedSwitch().operated_by_protection_equipment: The collection ofProtectionEquipmentoperating theProtectedSwitch.Switch().rated_current: The maximum continuous current carrying capacity in amps governed by the device material and construction.
The attribute shall be a positive value.Breaker().in_transit_time: The transition time from open to close in seconds.
- Added
getCustomersForContainertoCustomerConsumerClientwhich allows fetching all theCustomers for a givenEquipmentContainer - Added
getDiagramObjectstoDiagramConsumerClientwhich allows fetching all theDiagramObjects matching a given mRID. Traversalhas two new helper methods:if_not_stopping: Adds a step action that is only called if the traversal is not stopping on the item.if_stopping: Adds a step action that is only called if the traversal is stopping on the item.
Enhancements
trackeris now a field inTraversal, rather than its subclasses.- The constructor for
BranchRecursiveTraversalnow defaults theprocess_queuefield todepth_first(). TreeNodeis now more closely aligned with its Kotlin version:TreeNode().parentis now a read-only property.TreeNode().childrenhas been added as a read-only property that yields each child node.TreeNode().sort_weighthas been added as a read-only property that returns the sort weight of the node.
- All
Trackerclasses can now be copied using thecopymethod. - Added
FeederDirection.__not__operator function. - Performance enhancement for
connected_equipment_trace.pywhen traversing elements with single terminals. - Added support for LV2 transformers.
- Improved logging when saving a database.
- The
TestNetworkBuilderhas been enhanced with the following features:- You can now set the ID's without having to create a customer 'other' creator.
- Added Kotlin wrappers for
.fromOtherand.toOtherthat allow you to pass a class type rather than a creator. e.g..toOther<Fuse>()instead
of.toOther(::Fuse)or.toOther( { Fuse(it) } ). - Added inbuilt support for
PowerElectronicsConnectionandEnergyConsumer - The
to*andconnectfunctions can specify the connectivity node mRID to use. This will only be used if the terminals are not already connected.
- Added
+and-operators toPhaseCodeandSinglePhaseKind.
Fixes
StreetDetail.to_cimnow references the protobuf -> CIM translation function for theStreetDetailprotobuf type.PerLengthImpedance.to_cimnow references the protobuf -> CIM translation function for thePerLengthImpedanceprotobuf type.ZepbenTokenFetchernow includes the refresh token in token refresh requests.- Fixed connectivity traces.
- Fixed bug where running a limited connected equipment trace with
maximum_steps=1
included equipment two steps away from the starting equipment iffeeder_directionis set. - Each stop condition of a traversal is now checked on each step, regardless if a previous one in the internal list has returned
True. - Add
normal_upstream_trace,current_upstream_trace, andphase_inferrerto__all__inzepben.evolve.services.network.tracing.tracing. - Added missing
runmethod forDownstreamTree. - Added missing
TreeNodeTracker. - Classes in the
zepben.evolve.services.network.tracing.tree.*submodules may now be importedfrom zepben.evolve. - Add
normal_upstream_trace,current_upstream_trace, andphase_inferrerto__all__inzepben.evolve.services.network.tracing.tracing. - Stopped the NetworkConsumerClient from resolving the equipment of an EquipmentContainer when resolving references. Equipment for containers must always be
explicitly requested by the client. - Asking for the traced phases as a phase code when there are no nominal phases no longer throws.
- Feeder directions are now stopped at substation transformers in the same way as assigning equipment incase the feeder has no breaker, or the start point is
not inline.
Notes
- None.