zepben.ewb 1.0.0__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/__init__.py +601 -0
- zepben/ewb/auth/__init__.py +10 -0
- zepben/ewb/auth/client/__init__.py +5 -0
- zepben/ewb/auth/client/zepben_token_fetcher.py +273 -0
- zepben/ewb/auth/common/__init__.py +5 -0
- zepben/ewb/auth/common/auth_exception.py +16 -0
- zepben/ewb/auth/common/auth_method.py +28 -0
- zepben/ewb/auth/common/auth_provider_config.py +96 -0
- zepben/ewb/database/__init__.py +4 -0
- zepben/ewb/database/paths/__init__.py +4 -0
- zepben/ewb/database/paths/database_type.py +34 -0
- zepben/ewb/database/paths/ewb_data_file_paths.py +237 -0
- zepben/ewb/database/sql/__init__.py +4 -0
- zepben/ewb/database/sql/column.py +37 -0
- zepben/ewb/database/sql/sql_table.py +142 -0
- zepben/ewb/database/sqlite/__init__.py +4 -0
- zepben/ewb/database/sqlite/common/__init__.py +4 -0
- zepben/ewb/database/sqlite/common/base_cim_reader.py +212 -0
- zepben/ewb/database/sqlite/common/base_cim_writer.py +159 -0
- zepben/ewb/database/sqlite/common/base_collection_reader.py +96 -0
- zepben/ewb/database/sqlite/common/base_collection_writer.py +73 -0
- zepben/ewb/database/sqlite/common/base_database_reader.py +127 -0
- zepben/ewb/database/sqlite/common/base_database_tables.py +137 -0
- zepben/ewb/database/sqlite/common/base_database_writer.py +195 -0
- zepben/ewb/database/sqlite/common/base_entry_writer.py +34 -0
- zepben/ewb/database/sqlite/common/base_service_reader.py +50 -0
- zepben/ewb/database/sqlite/common/base_service_writer.py +104 -0
- zepben/ewb/database/sqlite/common/metadata_collection_reader.py +39 -0
- zepben/ewb/database/sqlite/common/metadata_collection_writer.py +38 -0
- zepben/ewb/database/sqlite/common/metadata_entry_reader.py +45 -0
- zepben/ewb/database/sqlite/common/metadata_entry_writer.py +41 -0
- zepben/ewb/database/sqlite/common/reader_exceptions.py +30 -0
- zepben/ewb/database/sqlite/customer/__init__.py +4 -0
- zepben/ewb/database/sqlite/customer/customer_cim_reader.py +169 -0
- zepben/ewb/database/sqlite/customer/customer_cim_writer.py +137 -0
- zepben/ewb/database/sqlite/customer/customer_database_reader.py +44 -0
- zepben/ewb/database/sqlite/customer/customer_database_tables.py +37 -0
- zepben/ewb/database/sqlite/customer/customer_database_writer.py +45 -0
- zepben/ewb/database/sqlite/customer/customer_service_reader.py +57 -0
- zepben/ewb/database/sqlite/customer/customer_service_writer.py +47 -0
- zepben/ewb/database/sqlite/diagram/__init__.py +4 -0
- zepben/ewb/database/sqlite/diagram/diagram_cim_reader.py +105 -0
- zepben/ewb/database/sqlite/diagram/diagram_cim_writer.py +81 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_reader.py +45 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_tables.py +29 -0
- zepben/ewb/database/sqlite/diagram/diagram_database_writer.py +44 -0
- zepben/ewb/database/sqlite/diagram/diagram_service_reader.py +49 -0
- zepben/ewb/database/sqlite/diagram/diagram_service_writer.py +41 -0
- zepben/ewb/database/sqlite/extensions/__init__.py +4 -0
- zepben/ewb/database/sqlite/extensions/prepared_statement.py +112 -0
- zepben/ewb/database/sqlite/extensions/result_set.py +153 -0
- zepben/ewb/database/sqlite/network/__init__.py +4 -0
- zepben/ewb/database/sqlite/network/network_cim_reader.py +3167 -0
- zepben/ewb/database/sqlite/network/network_cim_writer.py +2561 -0
- zepben/ewb/database/sqlite/network/network_database_reader.py +175 -0
- zepben/ewb/database/sqlite/network/network_database_tables.py +242 -0
- zepben/ewb/database/sqlite/network/network_database_writer.py +43 -0
- zepben/ewb/database/sqlite/network/network_service_reader.py +265 -0
- zepben/ewb/database/sqlite/network/network_service_writer.py +209 -0
- zepben/ewb/database/sqlite/tables/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/associations/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/associations/loop_substation_relationship.py +17 -0
- zepben/ewb/database/sqlite/tables/associations/table_asset_organisation_roles_assets.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_assets_power_system_resources.py +41 -0
- zepben/ewb/database/sqlite/tables/associations/table_battery_units_battery_controls.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_circuits_substations.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_circuits_terminals.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_customer_agreements_pricing_structures.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_end_devices_end_device_functions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_equipment_containers.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_operational_restrictions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_equipment_usage_points.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_loops_substations.py +43 -0
- zepben/ewb/database/sqlite/tables/associations/table_pricing_structures_tariffs.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_functions_protected_switches.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_functions_sensors.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_protection_relay_schemes_protection_relay_functions.py +40 -0
- zepben/ewb/database/sqlite/tables/associations/table_synchronous_machines_reactive_capability_curves.py +39 -0
- zepben/ewb/database/sqlite/tables/associations/table_usage_points_end_devices.py +40 -0
- zepben/ewb/database/sqlite/tables/exceptions.py +10 -0
- zepben/ewb/database/sqlite/tables/extensions/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/table_reclose_delays.py +38 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/assetinfo/table_relay_info.py +21 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/metering/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61968/metering/table_pan_demand_response_functions.py +21 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/core/table_sites.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/table_loops.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/feeder/table_lv_feeders.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/generation/production/table_ev_charging_units.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_distance_relays.py +28 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_function_thresholds.py +36 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_function_time_limits.py +34 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_functions.py +24 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_schemes.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_protection_relay_systems.py +20 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/protection/table_voltage_relays.py +15 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/table_battery_controls.py +23 -0
- zepben/ewb/database/sqlite/tables/extensions/iec61970/base/wires/table_power_transformer_end_ratings.py +34 -0
- zepben/ewb/database/sqlite/tables/iec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_cable_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_no_load_tests.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_open_circuit_tests.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_overhead_wire_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_power_transformer_info.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_short_circuit_tests.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_shunt_compensator_info.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_switch_info.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_end_info.py +46 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_tank_info.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_transformer_test.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/assetinfo/table_wire_info.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_functions.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_info.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_organisation_roles.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_asset_owners.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_assets.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_streetlights.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61968/assets/table_structures.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_agreements.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_documents.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_location_street_address_field.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_location_street_addresses.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_locations.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_organisation_roles.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_organisations.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_position_points.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_street_addresses.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61968/common/table_town_details.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_customer_agreements.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_customers.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_pricing_structures.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/customers/table_tariffs.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/table_current_transformer_info.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassetinfo/table_potential_transformer_info.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassets/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/infiec61968/infassets/table_poles.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_end_device_functions.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_end_devices.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_meters.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61968/metering/table_usage_points.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61968/operations/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61968/operations/table_operational_restrictions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_auxiliary_equipment.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_current_transformers.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_fault_indicators.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_potential_transformers.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/auxiliaryequipment/table_sensors.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_ac_dc_terminals.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_base_voltages.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_conducting_equipment.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_connectivity_node_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_connectivity_nodes.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_curve_data.py +46 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_curves.py +17 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_equipment.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_equipment_containers.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_feeders.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_geographical_regions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_identified_objects.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_name_types.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_names.py +36 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_power_system_resources.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_sub_geographical_regions.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_substations.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/core/table_terminals.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagram_object_points.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagram_objects.py +31 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/diagramlayout/table_diagrams.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/table_equivalent_branches.py +35 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/equivalents/table_equivalent_equipment.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_battery_units.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_photo_voltaic_units.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_power_electronics_units.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/generation/production/table_power_electronics_wind_units.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_accumulators.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_analogs.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_controls.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_discretes.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_io_points.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/meas/table_measurements.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/protection/table_current_relays.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_controls.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_points.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/scada/table_remote_sources.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ac_line_segments.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_breakers.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_busbar_sections.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_clamps.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_conductors.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_connectors.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_cuts.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_disconnectors.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_earth_fault_compensators.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_connections.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_consumer_phases.py +37 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_consumers.py +26 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_source_phases.py +33 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_energy_sources.py +44 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_fuses.py +20 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ground_disconnectors.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_grounding_impedances.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_grounds.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_jumpers.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_junctions.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_linear_shunt_compensators.py +23 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_lines.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_load_break_switches.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_impedances.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_line_parameters.py +14 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_phase_impedances.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_per_length_sequence_impedances.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_petersen_coils.py +27 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_phase_impedance_data.py +52 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_electronics_connection_phases.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_electronics_connections.py +50 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_transformer_ends.py +43 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_power_transformers.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_protected_switches.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_ratio_tap_changers.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_reactive_capability_curves.py +18 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_reclosers.py +15 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_regulating_cond_eq.py +19 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_regulating_controls.py +29 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_rotating_machines.py +36 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_series_compensators.py +25 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_shunt_compensators.py +22 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_static_var_compensator.py +24 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_switches.py +21 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_synchronous_machines.py +95 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_tap_changer_controls.py +28 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_tap_changers.py +25 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_transformer_ends.py +30 -0
- zepben/ewb/database/sqlite/tables/iec61970/base/wires/table_transformer_star_impedances.py +32 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/feeder/__init__.py +4 -0
- zepben/ewb/database/sqlite/tables/iec61970/infiec61970/feeder/table_circuits.py +27 -0
- zepben/ewb/database/sqlite/tables/sqlite_table.py +45 -0
- zepben/ewb/database/sqlite/tables/table_metadata_data_sources.py +21 -0
- zepben/ewb/database/sqlite/tables/table_version.py +39 -0
- zepben/ewb/dataclassy/__init__.py +15 -0
- zepben/ewb/dataclassy/dataclass.py +192 -0
- zepben/ewb/dataclassy/decorator.py +35 -0
- zepben/ewb/dataclassy/functions.py +80 -0
- zepben/ewb/examples/__init__.py +6 -0
- zepben/ewb/examples/simple_test_network.py +158 -0
- zepben/ewb/exceptions.py +52 -0
- zepben/ewb/model/__init__.py +4 -0
- zepben/ewb/model/busbranch/__init__.py +4 -0
- zepben/ewb/model/busbranch/bus_branch.py +1051 -0
- zepben/ewb/model/cim/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/assetinfo/relay_info.py +128 -0
- zepben/ewb/model/cim/extensions/iec61968/metering/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61968/metering/pan_demand_reponse_function.py +112 -0
- zepben/ewb/model/cim/extensions/iec61970/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/core/site.py +37 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/loop.py +207 -0
- zepben/ewb/model/cim/extensions/iec61970/base/feeder/lv_feeder.py +258 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/generation/production/ev_charging_unit.py +18 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/distance_relay.py +69 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/power_direction_kind.py +36 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_kind.py +112 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_function.py +448 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_scheme.py +97 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/protection_relay_system.py +97 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/relay_setting.py +35 -0
- zepben/ewb/model/cim/extensions/iec61970/base/protection/voltage_relay.py +20 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/battery_control.py +36 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/battery_control_mode.py +83 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/transformer_cooling_type.py +57 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/transformer_end_rated_s.py +26 -0
- zepben/ewb/model/cim/extensions/iec61970/base/wires/vector_group.py +293 -0
- zepben/ewb/model/cim/extensions/zbex.py +17 -0
- zepben/ewb/model/cim/iec61968/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assetinfo/cable_info.py +15 -0
- zepben/ewb/model/cim/iec61968/assetinfo/no_load_test.py +42 -0
- zepben/ewb/model/cim/iec61968/assetinfo/open_circuit_test.py +42 -0
- zepben/ewb/model/cim/iec61968/assetinfo/overhead_wire_info.py +15 -0
- zepben/ewb/model/cim/iec61968/assetinfo/power_transformer_info.py +103 -0
- zepben/ewb/model/cim/iec61968/assetinfo/short_circuit_test.py +67 -0
- zepben/ewb/model/cim/iec61968/assetinfo/shunt_compensator_info.py +26 -0
- zepben/ewb/model/cim/iec61968/assetinfo/switch_info.py +17 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_end_info.py +137 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_tank_info.py +108 -0
- zepben/ewb/model/cim/iec61968/assetinfo/transformer_test.py +26 -0
- zepben/ewb/model/cim/iec61968/assetinfo/wire_info.py +24 -0
- zepben/ewb/model/cim/iec61968/assetinfo/wire_material_kind.py +57 -0
- zepben/ewb/model/cim/iec61968/assets/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/assets/asset.py +154 -0
- zepben/ewb/model/cim/iec61968/assets/asset_container.py +16 -0
- zepben/ewb/model/cim/iec61968/assets/asset_function.py +15 -0
- zepben/ewb/model/cim/iec61968/assets/asset_info.py +19 -0
- zepben/ewb/model/cim/iec61968/assets/asset_organisation_role.py +13 -0
- zepben/ewb/model/cim/iec61968/assets/asset_owner.py +13 -0
- zepben/ewb/model/cim/iec61968/assets/streetlight.py +29 -0
- zepben/ewb/model/cim/iec61968/assets/structure.py +16 -0
- zepben/ewb/model/cim/iec61968/common/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/common/agreement.py +16 -0
- zepben/ewb/model/cim/iec61968/common/document.py +36 -0
- zepben/ewb/model/cim/iec61968/common/location.py +129 -0
- zepben/ewb/model/cim/iec61968/common/organisation.py +15 -0
- zepben/ewb/model/cim/iec61968/common/organisation_role.py +22 -0
- zepben/ewb/model/cim/iec61968/common/position_point.py +44 -0
- zepben/ewb/model/cim/iec61968/common/street_address.py +28 -0
- zepben/ewb/model/cim/iec61968/common/street_detail.py +46 -0
- zepben/ewb/model/cim/iec61968/common/town_detail.py +25 -0
- zepben/ewb/model/cim/iec61968/customers/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/customers/customer.py +93 -0
- zepben/ewb/model/cim/iec61968/customers/customer_agreement.py +107 -0
- zepben/ewb/model/cim/iec61968/customers/customer_kind.py +69 -0
- zepben/ewb/model/cim/iec61968/customers/pricing_structure.py +88 -0
- zepben/ewb/model/cim/iec61968/customers/tariff.py +18 -0
- zepben/ewb/model/cim/iec61968/infiec61968/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/current_transformer_info.py +51 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/potential_transformer_info.py +33 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/transformer_construction_kind.py +69 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassetinfo/transformer_function_kind.py +45 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/pole.py +87 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infassets/streetlight_lamp_kind.py +27 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infcommon/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/infiec61968/infcommon/ratio.py +34 -0
- zepben/ewb/model/cim/iec61968/metering/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/metering/controlled_appliance.py +152 -0
- zepben/ewb/model/cim/iec61968/metering/end_device.py +165 -0
- zepben/ewb/model/cim/iec61968/metering/end_device_function.py +17 -0
- zepben/ewb/model/cim/iec61968/metering/end_device_function_kind.py +48 -0
- zepben/ewb/model/cim/iec61968/metering/meter.py +28 -0
- zepben/ewb/model/cim/iec61968/metering/usage_point.py +186 -0
- zepben/ewb/model/cim/iec61968/operations/__init__.py +4 -0
- zepben/ewb/model/cim/iec61968/operations/operational_restriction.py +92 -0
- zepben/ewb/model/cim/iec61970/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/auxiliary_equipment.py +24 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/current_transformer.py +37 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/fault_indicator.py +18 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/potential_transformer.py +38 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/potential_transformer_kind.py +30 -0
- zepben/ewb/model/cim/iec61970/base/auxiliaryequipment/sensor.py +92 -0
- zepben/ewb/model/cim/iec61970/base/core/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/core/ac_dc_terminal.py +16 -0
- zepben/ewb/model/cim/iec61970/base/core/base_voltage.py +17 -0
- zepben/ewb/model/cim/iec61970/base/core/conducting_equipment.py +198 -0
- zepben/ewb/model/cim/iec61970/base/core/connectivity_node.py +105 -0
- zepben/ewb/model/cim/iec61970/base/core/connectivity_node_container.py +15 -0
- zepben/ewb/model/cim/iec61970/base/core/curve.py +125 -0
- zepben/ewb/model/cim/iec61970/base/core/curve_data.py +29 -0
- zepben/ewb/model/cim/iec61970/base/core/equipment.py +366 -0
- zepben/ewb/model/cim/iec61970/base/core/equipment_container.py +199 -0
- zepben/ewb/model/cim/iec61970/base/core/feeder.py +260 -0
- zepben/ewb/model/cim/iec61970/base/core/geographical_region.py +82 -0
- zepben/ewb/model/cim/iec61970/base/core/identified_object.py +239 -0
- zepben/ewb/model/cim/iec61970/base/core/name.py +36 -0
- zepben/ewb/model/cim/iec61970/base/core/name_type.py +203 -0
- zepben/ewb/model/cim/iec61970/base/core/phase_code.py +202 -0
- zepben/ewb/model/cim/iec61970/base/core/power_system_resource.py +106 -0
- zepben/ewb/model/cim/iec61970/base/core/sub_geographical_region.py +93 -0
- zepben/ewb/model/cim/iec61970/base/core/substation.py +277 -0
- zepben/ewb/model/cim/iec61970/base/core/terminal.py +171 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram.py +109 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_object.py +160 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_object_point.py +25 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/diagram_style.py +28 -0
- zepben/ewb/model/cim/iec61970/base/diagramlayout/orientation_kind.py +29 -0
- zepben/ewb/model/cim/iec61970/base/domain/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/domain/unit_symbol.py +494 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/equivalent_branch.py +113 -0
- zepben/ewb/model/cim/iec61970/base/equivalents/equivalent_equipment.py +15 -0
- zepben/ewb/model/cim/iec61970/base/generation/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/battery_state_kind.py +39 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/battery_unit.py +108 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/photo_voltaic_unit.py +13 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/power_electronics_unit.py +28 -0
- zepben/ewb/model/cim/iec61970/base/generation/production/power_electronics_wind_unit.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/meas/accumulator.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/accumulator_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/analog.py +18 -0
- zepben/ewb/model/cim/iec61970/base/meas/analog_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/control.py +26 -0
- zepben/ewb/model/cim/iec61970/base/meas/discrete.py +13 -0
- zepben/ewb/model/cim/iec61970/base/meas/discrete_value.py +20 -0
- zepben/ewb/model/cim/iec61970/base/meas/iopoint.py +16 -0
- zepben/ewb/model/cim/iec61970/base/meas/measurement.py +60 -0
- zepben/ewb/model/cim/iec61970/base/meas/measurement_value.py +21 -0
- zepben/ewb/model/cim/iec61970/base/protection/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/protection/current_relay.py +23 -0
- zepben/ewb/model/cim/iec61970/base/scada/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_control.py +22 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_point.py +16 -0
- zepben/ewb/model/cim/iec61970/base/scada/remote_source.py +22 -0
- zepben/ewb/model/cim/iec61970/base/wires/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/base/wires/ac_line_segment.py +214 -0
- zepben/ewb/model/cim/iec61970/base/wires/breaker.py +32 -0
- zepben/ewb/model/cim/iec61970/base/wires/busbar_section.py +19 -0
- zepben/ewb/model/cim/iec61970/base/wires/clamp.py +32 -0
- zepben/ewb/model/cim/iec61970/base/wires/conductor.py +49 -0
- zepben/ewb/model/cim/iec61970/base/wires/connector.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/cut.py +36 -0
- zepben/ewb/model/cim/iec61970/base/wires/disconnector.py +17 -0
- zepben/ewb/model/cim/iec61970/base/wires/earth_fault_compensator.py +21 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_connection.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_consumer.py +107 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_consumer_phase.py +56 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_source.py +172 -0
- zepben/ewb/model/cim/iec61970/base/wires/energy_source_phase.py +45 -0
- zepben/ewb/model/cim/iec61970/base/wires/fuse.py +23 -0
- zepben/ewb/model/cim/iec61970/base/wires/ground.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/ground_disconnector.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/grounding_impedance.py +19 -0
- zepben/ewb/model/cim/iec61970/base/wires/jumper.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/junction.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/line.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/linear_shunt_compensator.py +26 -0
- zepben/ewb/model/cim/iec61970/base/wires/load_break_switch.py +14 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_impedance.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_line_parameter.py +13 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_phase_impedance.py +99 -0
- zepben/ewb/model/cim/iec61970/base/wires/per_length_sequence_impedance.py +43 -0
- zepben/ewb/model/cim/iec61970/base/wires/petersen_coil.py +22 -0
- zepben/ewb/model/cim/iec61970/base/wires/phase_impedance_data.py +37 -0
- zepben/ewb/model/cim/iec61970/base/wires/phase_shunt_connection_kind.py +40 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_electronics_connection.py +524 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_electronics_connection_phase.py +34 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_transformer.py +217 -0
- zepben/ewb/model/cim/iec61970/base/wires/power_transformer_end.py +208 -0
- zepben/ewb/model/cim/iec61970/base/wires/protected_switch.py +96 -0
- zepben/ewb/model/cim/iec61970/base/wires/ratio_tap_changer.py +30 -0
- zepben/ewb/model/cim/iec61970/base/wires/reactive_capability_curve.py +16 -0
- zepben/ewb/model/cim/iec61970/base/wires/recloser.py +15 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_cond_eq.py +45 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_control.py +173 -0
- zepben/ewb/model/cim/iec61970/base/wires/regulating_control_mode_kind.py +48 -0
- zepben/ewb/model/cim/iec61970/base/wires/rotating_machine.py +36 -0
- zepben/ewb/model/cim/iec61970/base/wires/series_compensator.py +42 -0
- zepben/ewb/model/cim/iec61970/base/wires/shunt_compensator.py +59 -0
- zepben/ewb/model/cim/iec61970/base/wires/single_phase_kind.py +107 -0
- zepben/ewb/model/cim/iec61970/base/wires/static_var_compensator.py +40 -0
- zepben/ewb/model/cim/iec61970/base/wires/svc_control_mode.py +30 -0
- zepben/ewb/model/cim/iec61970/base/wires/switch.py +119 -0
- zepben/ewb/model/cim/iec61970/base/wires/synchronous_machine.py +168 -0
- zepben/ewb/model/cim/iec61970/base/wires/synchronous_machine_kind.py +46 -0
- zepben/ewb/model/cim/iec61970/base/wires/tap_changer.py +150 -0
- zepben/ewb/model/cim/iec61970/base/wires/tap_changer_control.py +49 -0
- zepben/ewb/model/cim/iec61970/base/wires/transformer_end.py +73 -0
- zepben/ewb/model/cim/iec61970/base/wires/transformer_star_impedance.py +48 -0
- zepben/ewb/model/cim/iec61970/base/wires/winding_connection.py +45 -0
- zepben/ewb/model/cim/iec61970/infiec61970/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/infiec61970/feeder/__init__.py +4 -0
- zepben/ewb/model/cim/iec61970/infiec61970/feeder/circuit.py +144 -0
- zepben/ewb/model/phases.py +168 -0
- zepben/ewb/model/resistance_reactance.py +40 -0
- zepben/ewb/services/__init__.py +4 -0
- zepben/ewb/services/common/__init__.py +16 -0
- zepben/ewb/services/common/base_service.py +383 -0
- zepben/ewb/services/common/base_service_comparator.py +394 -0
- zepben/ewb/services/common/difference.py +47 -0
- zepben/ewb/services/common/enum_mapper.py +55 -0
- zepben/ewb/services/common/meta/__init__.py +4 -0
- zepben/ewb/services/common/meta/data_source.py +16 -0
- zepben/ewb/services/common/meta/metadata_collection.py +28 -0
- zepben/ewb/services/common/meta/metadata_translations.py +47 -0
- zepben/ewb/services/common/meta/service_info.py +22 -0
- zepben/ewb/services/common/reference_resolvers.py +374 -0
- zepben/ewb/services/common/resolver.py +597 -0
- zepben/ewb/services/common/translator/__init__.py +4 -0
- zepben/ewb/services/common/translator/base_cim2proto.py +115 -0
- zepben/ewb/services/common/translator/base_proto2cim.py +146 -0
- zepben/ewb/services/common/translator/service_differences.py +81 -0
- zepben/ewb/services/common/translator/util.py +75 -0
- zepben/ewb/services/customer/__init__.py +4 -0
- zepben/ewb/services/customer/customer_service_comparator.py +52 -0
- zepben/ewb/services/customer/customers.py +23 -0
- zepben/ewb/services/customer/translator/__init__.py +21 -0
- zepben/ewb/services/customer/translator/customer_cim2proto.py +71 -0
- zepben/ewb/services/customer/translator/customer_enum_mappers.py +18 -0
- zepben/ewb/services/customer/translator/customer_proto2cim.py +87 -0
- zepben/ewb/services/diagram/__init__.py +4 -0
- zepben/ewb/services/diagram/diagram_service_comparator.py +39 -0
- zepben/ewb/services/diagram/diagrams.py +107 -0
- zepben/ewb/services/diagram/translator/__init__.py +11 -0
- zepben/ewb/services/diagram/translator/diagram_cim2proto.py +51 -0
- zepben/ewb/services/diagram/translator/diagram_enum_mappers.py +21 -0
- zepben/ewb/services/diagram/translator/diagram_proto2cim.py +61 -0
- zepben/ewb/services/measurement/__init__.py +4 -0
- zepben/ewb/services/measurement/measurements.py +35 -0
- zepben/ewb/services/measurement/translator/__init__.py +6 -0
- zepben/ewb/services/measurement/translator/measurement_cim2proto.py +42 -0
- zepben/ewb/services/measurement/translator/measurement_proto2cim.py +52 -0
- zepben/ewb/services/network/__init__.py +4 -0
- zepben/ewb/services/network/network_extensions.py +119 -0
- zepben/ewb/services/network/network_service.py +302 -0
- zepben/ewb/services/network/network_service_comparator.py +1322 -0
- zepben/ewb/services/network/network_state.py +36 -0
- zepben/ewb/services/network/tracing/__init__.py +4 -0
- zepben/ewb/services/network/tracing/busbranch_trace.py +36 -0
- zepben/ewb/services/network/tracing/connectivity/__init__.py +4 -0
- zepben/ewb/services/network/tracing/connectivity/connectivity_result.py +105 -0
- zepben/ewb/services/network/tracing/connectivity/nominal_phase_path.py +23 -0
- zepben/ewb/services/network/tracing/connectivity/phase_paths.py +70 -0
- zepben/ewb/services/network/tracing/connectivity/terminal_connectivity_connected.py +226 -0
- zepben/ewb/services/network/tracing/connectivity/terminal_connectivity_internal.py +64 -0
- zepben/ewb/services/network/tracing/connectivity/transformer_phase_paths.py +202 -0
- zepben/ewb/services/network/tracing/connectivity/xy_candidate_phase_paths.py +235 -0
- zepben/ewb/services/network/tracing/connectivity/xy_phase_step.py +24 -0
- zepben/ewb/services/network/tracing/feeder/__init__.py +4 -0
- zepben/ewb/services/network/tracing/feeder/assign_to_feeders.py +202 -0
- zepben/ewb/services/network/tracing/feeder/assign_to_lv_feeders.py +202 -0
- zepben/ewb/services/network/tracing/feeder/clear_direction.py +80 -0
- zepben/ewb/services/network/tracing/feeder/direction_status.py +133 -0
- zepben/ewb/services/network/tracing/feeder/feeder_direction.py +107 -0
- zepben/ewb/services/network/tracing/feeder/set_direction.py +143 -0
- zepben/ewb/services/network/tracing/find_swer_equipment.py +175 -0
- zepben/ewb/services/network/tracing/networktrace/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/actions/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/actions/equipment_tree_builder.py +104 -0
- zepben/ewb/services/network/tracing/networktrace/actions/tree_node.py +35 -0
- zepben/ewb/services/network/tracing/networktrace/compute_data.py +60 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/__init__.py +4 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/conditions.py +73 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/direction_condition.py +63 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/equipment_step_limit_condition.py +26 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/equipment_type_step_limit_condition.py +44 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/network_trace_queue_condition.py +67 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/network_trace_stop_condition.py +65 -0
- zepben/ewb/services/network/tracing/networktrace/conditions/open_condition.py +39 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace.py +433 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_action_type.py +42 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_queue_next.py +84 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_step.py +128 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_step_path_provider.py +351 -0
- zepben/ewb/services/network/tracing/networktrace/network_trace_tracker.py +39 -0
- zepben/ewb/services/network/tracing/networktrace/operators/__init__.py +14 -0
- zepben/ewb/services/network/tracing/networktrace/operators/equipment_container_state_operators.py +264 -0
- zepben/ewb/services/network/tracing/networktrace/operators/feeder_direction_state_operations.py +181 -0
- zepben/ewb/services/network/tracing/networktrace/operators/in_service_state_operators.py +76 -0
- zepben/ewb/services/network/tracing/networktrace/operators/network_state_operators.py +120 -0
- zepben/ewb/services/network/tracing/networktrace/operators/open_state_operators.py +104 -0
- zepben/ewb/services/network/tracing/networktrace/operators/phase_state_operators.py +56 -0
- zepben/ewb/services/network/tracing/networktrace/tracing.py +132 -0
- zepben/ewb/services/network/tracing/phases/__init__.py +4 -0
- zepben/ewb/services/network/tracing/phases/phase_inferrer.py +205 -0
- zepben/ewb/services/network/tracing/phases/phase_status.py +101 -0
- zepben/ewb/services/network/tracing/phases/remove_phases.py +143 -0
- zepben/ewb/services/network/tracing/phases/set_phases.py +490 -0
- zepben/ewb/services/network/tracing/traversal/__init__.py +4 -0
- zepben/ewb/services/network/tracing/traversal/context_value_computer.py +63 -0
- zepben/ewb/services/network/tracing/traversal/debug_logging.py +124 -0
- zepben/ewb/services/network/tracing/traversal/queue.py +112 -0
- zepben/ewb/services/network/tracing/traversal/queue_condition.py +75 -0
- zepben/ewb/services/network/tracing/traversal/step_action.py +83 -0
- zepben/ewb/services/network/tracing/traversal/step_context.py +59 -0
- zepben/ewb/services/network/tracing/traversal/stop_condition.py +57 -0
- zepben/ewb/services/network/tracing/traversal/traversal.py +634 -0
- zepben/ewb/services/network/tracing/traversal/traversal_condition.py +22 -0
- zepben/ewb/services/network/tracing/traversal/weighted_priority_queue.py +85 -0
- zepben/ewb/services/network/tracing/util.py +93 -0
- zepben/ewb/services/network/translator/__init__.py +392 -0
- zepben/ewb/services/network/translator/network_cim2proto.py +1867 -0
- zepben/ewb/services/network/translator/network_enum_mappers.py +78 -0
- zepben/ewb/services/network/translator/network_proto2cim.py +2201 -0
- zepben/ewb/services/services.py +48 -0
- zepben/ewb/streaming/__init__.py +4 -0
- zepben/ewb/streaming/data/__init__.py +4 -0
- zepben/ewb/streaming/data/current_state_event.py +314 -0
- zepben/ewb/streaming/data/current_state_event_batch.py +25 -0
- zepben/ewb/streaming/data/set_current_states_status.py +286 -0
- zepben/ewb/streaming/exceptions.py +14 -0
- zepben/ewb/streaming/get/__init__.py +4 -0
- zepben/ewb/streaming/get/consumer.py +209 -0
- zepben/ewb/streaming/get/customer_consumer.py +111 -0
- zepben/ewb/streaming/get/diagram_consumer.py +107 -0
- zepben/ewb/streaming/get/hierarchy/__init__.py +4 -0
- zepben/ewb/streaming/get/hierarchy/data.py +27 -0
- zepben/ewb/streaming/get/included_energized_containers.py +36 -0
- zepben/ewb/streaming/get/included_energizing_containers.py +36 -0
- zepben/ewb/streaming/get/network_consumer.py +870 -0
- zepben/ewb/streaming/get/query_network_state_client.py +64 -0
- zepben/ewb/streaming/get/query_network_state_service.py +94 -0
- zepben/ewb/streaming/grpc/__init__.py +4 -0
- zepben/ewb/streaming/grpc/auth_token_plugin.py +24 -0
- zepben/ewb/streaming/grpc/connect.py +209 -0
- zepben/ewb/streaming/grpc/grpc.py +107 -0
- zepben/ewb/streaming/grpc/grpc_channel_builder.py +190 -0
- zepben/ewb/streaming/mutations/__init__.py +4 -0
- zepben/ewb/streaming/mutations/update_network_state_client.py +80 -0
- zepben/ewb/streaming/mutations/update_network_state_service.py +61 -0
- zepben/ewb/testing/__init__.py +4 -0
- zepben/ewb/testing/test_network_builder.py +816 -0
- zepben/ewb/types.py +17 -0
- zepben/ewb/util.py +200 -0
- zepben_ewb-1.0.0.dist-info/METADATA +90 -0
- zepben_ewb-1.0.0.dist-info/RECORD +641 -0
- zepben_ewb-1.0.0.dist-info/WHEEL +5 -0
- zepben_ewb-1.0.0.dist-info/licenses/LICENSE +374 -0
- zepben_ewb-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = ["StreetlightLampKind"]
|
|
7
|
+
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
from zepben.ewb import unique
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@unique
|
|
14
|
+
class StreetlightLampKind(Enum):
|
|
15
|
+
"""
|
|
16
|
+
Kind of lamp for a `Streetlight`
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
UNKNOWN = 0
|
|
20
|
+
HIGH_PRESSURE_SODIUM = 1
|
|
21
|
+
MERCURY_VAPOR = 2
|
|
22
|
+
METAL_HALIDE = 3
|
|
23
|
+
OTHER = 4
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def short_name(self):
|
|
27
|
+
return str(self)[20:]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2024 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = ["Ratio"]
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True)
|
|
12
|
+
class Ratio:
|
|
13
|
+
"""
|
|
14
|
+
Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
numerator: float
|
|
18
|
+
"""The part of a fraction that is below the line and that functions as the divisor of the numerator."""
|
|
19
|
+
|
|
20
|
+
denominator: float
|
|
21
|
+
"""The part of a fraction that is above the line and signifies the number to be divided by the denominator."""
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def quotient(self) -> float:
|
|
25
|
+
"""
|
|
26
|
+
The result of dividing the numerator by the denominator.
|
|
27
|
+
|
|
28
|
+
:return: The quotient of this ``Ratio``.
|
|
29
|
+
:raises AttributeError: If the denominator of this ``Ratio`` is zero.
|
|
30
|
+
"""
|
|
31
|
+
if self.denominator == 0:
|
|
32
|
+
raise AttributeError("Cannot calculate the quotient of a Ratio with a denominator of zero.")
|
|
33
|
+
|
|
34
|
+
return self.numerator / self.denominator
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Copyright 2024 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
__all__ = ["ControlledAppliance", "Appliance"]
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from enum import Enum
|
|
12
|
+
from typing import List, Union
|
|
13
|
+
|
|
14
|
+
from zepben.ewb import unique
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@unique
|
|
18
|
+
class Appliance(Enum):
|
|
19
|
+
"""
|
|
20
|
+
The type of appliance.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
ELECTRIC_VEHICLE = 0
|
|
24
|
+
"""An electric vehicle."""
|
|
25
|
+
|
|
26
|
+
EXTERIOR_LIGHTING = 1
|
|
27
|
+
"""Exterior lighting."""
|
|
28
|
+
|
|
29
|
+
GENERATION_SYSTEM = 2
|
|
30
|
+
"""A generation system."""
|
|
31
|
+
|
|
32
|
+
HVAC_COMPRESSOR_OR_FURNACE = 3
|
|
33
|
+
"""HVAC compressor or furnace."""
|
|
34
|
+
|
|
35
|
+
INTERIOR_LIGHTING = 4
|
|
36
|
+
"""Interior lighting."""
|
|
37
|
+
|
|
38
|
+
IRRIGATION_PUMP = 5
|
|
39
|
+
"""An irrigation pump."""
|
|
40
|
+
|
|
41
|
+
MANAGED_COMMERCIAL_INDUSTRIAL_LOAD = 6
|
|
42
|
+
"""Managed commercial or industrial load."""
|
|
43
|
+
|
|
44
|
+
POOL_PUMP_SPA_JACUZZI = 7
|
|
45
|
+
"""A pool, pump, spa or jacuzzi."""
|
|
46
|
+
|
|
47
|
+
SIMPLE_MISC_LOAD = 8
|
|
48
|
+
"""A simple miscellaneous load."""
|
|
49
|
+
|
|
50
|
+
SMART_APPLIANCE = 9
|
|
51
|
+
"""A smart appliance."""
|
|
52
|
+
|
|
53
|
+
STRIP_AND_BASEBOARD_HEATER = 10
|
|
54
|
+
"""A strip or baseboard heater."""
|
|
55
|
+
|
|
56
|
+
WATER_HEATER = 11
|
|
57
|
+
"""A water heater."""
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def bitmask(self):
|
|
61
|
+
return 1 << self.value
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass
|
|
65
|
+
class ControlledAppliance:
|
|
66
|
+
"""
|
|
67
|
+
Appliance controlled with a PAN device control.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
_bitmask: int
|
|
71
|
+
|
|
72
|
+
def __init__(self, appliances: Union[int, Appliance, List[Appliance]]):
|
|
73
|
+
if isinstance(appliances, int):
|
|
74
|
+
self._bitmask = appliances
|
|
75
|
+
elif isinstance(appliances, Appliance):
|
|
76
|
+
self._bitmask = appliances.bitmask
|
|
77
|
+
elif isinstance(appliances, List):
|
|
78
|
+
if appliances:
|
|
79
|
+
def f(bitmask: int, nxt: Appliance) -> int:
|
|
80
|
+
return bitmask | nxt.bitmask
|
|
81
|
+
|
|
82
|
+
acc = appliances[0].bitmask
|
|
83
|
+
if len(appliances) > 1:
|
|
84
|
+
_ = [acc := f(acc, app) for app in appliances[1:]]
|
|
85
|
+
self._bitmask = acc
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def bitmask(self):
|
|
89
|
+
return self._bitmask
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def is_electric_vehicle(self) -> bool:
|
|
93
|
+
"""True if the appliance is an electric vehicle"""
|
|
94
|
+
return Appliance.ELECTRIC_VEHICLE in self
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def is_exterior_lighting(self) -> bool:
|
|
98
|
+
"""True if the appliance is exterior lighting"""
|
|
99
|
+
return Appliance.EXTERIOR_LIGHTING in self
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def is_generation_system(self) -> bool:
|
|
103
|
+
"""True if the appliance is a generation system"""
|
|
104
|
+
return Appliance.GENERATION_SYSTEM in self
|
|
105
|
+
|
|
106
|
+
@property
|
|
107
|
+
def is_hvac_compressor_or_furnace(self) -> bool:
|
|
108
|
+
"""True if the appliance is HVAC compressor or furnace"""
|
|
109
|
+
return Appliance.HVAC_COMPRESSOR_OR_FURNACE in self
|
|
110
|
+
|
|
111
|
+
@property
|
|
112
|
+
def is_interior_lighting(self) -> bool:
|
|
113
|
+
"""True if the appliance is interior lighting"""
|
|
114
|
+
return Appliance.INTERIOR_LIGHTING in self
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def is_irrigation_pump(self) -> bool:
|
|
118
|
+
"""True if the appliance is an irrigation pump"""
|
|
119
|
+
return Appliance.IRRIGATION_PUMP in self
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def is_managed_commercial_industrial_load(self) -> bool:
|
|
123
|
+
"""True if the appliance is managed commercial or industrial load"""
|
|
124
|
+
return Appliance.MANAGED_COMMERCIAL_INDUSTRIAL_LOAD in self
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def is_pool_pump_spa_jacuzzi(self) -> bool:
|
|
128
|
+
"""True if the appliance is a pool, pump, spa or jacuzzi"""
|
|
129
|
+
return Appliance.POOL_PUMP_SPA_JACUZZI in self
|
|
130
|
+
|
|
131
|
+
@property
|
|
132
|
+
def is_simple_misc_load(self) -> bool:
|
|
133
|
+
"""True if the appliance is a simple miscellaneous load"""
|
|
134
|
+
return Appliance.SIMPLE_MISC_LOAD in self
|
|
135
|
+
|
|
136
|
+
@property
|
|
137
|
+
def is_smart_appliance(self) -> bool:
|
|
138
|
+
"""True if the appliance is a smart appliance"""
|
|
139
|
+
return Appliance.SMART_APPLIANCE in self
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
def is_strip_and_baseboard_heater(self) -> bool:
|
|
143
|
+
"""True if the appliance is a strip or baseboard heater"""
|
|
144
|
+
return Appliance.STRIP_AND_BASEBOARD_HEATER in self
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def is_water_heater(self) -> bool:
|
|
148
|
+
"""True if the appliance is a water heater"""
|
|
149
|
+
return Appliance.WATER_HEATER in self
|
|
150
|
+
|
|
151
|
+
def __contains__(self, item: Appliance):
|
|
152
|
+
return (self._bitmask & item.bitmask) != 0
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
__all__ = ["EndDevice"]
|
|
9
|
+
|
|
10
|
+
from typing import Optional, List, Generator, TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_container import AssetContainer
|
|
13
|
+
from zepben.ewb.util import nlen, ngen, get_by_mrid, safe_remove
|
|
14
|
+
|
|
15
|
+
if TYPE_CHECKING:
|
|
16
|
+
from zepben.ewb.model.cim.iec61968.common.location import Location
|
|
17
|
+
from zepben.ewb.model.cim.iec61968.metering.end_device_function import EndDeviceFunction
|
|
18
|
+
from zepben.ewb.model.cim.iec61968.metering.usage_point import UsagePoint
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class EndDevice(AssetContainer):
|
|
22
|
+
"""
|
|
23
|
+
Asset container that performs one or more end device functions. One type of end device is a meter which can perform
|
|
24
|
+
metering, load management, connect/disconnect, accounting functions, etc. Some end devices, such as ones monitoring
|
|
25
|
+
and controlling air conditioners, refrigerators, pool pumps may be connected to a meter. All end devices may have
|
|
26
|
+
communication capability defined by the associated communication function(s).
|
|
27
|
+
|
|
28
|
+
An end device may be owned by a consumer, a service provider, utility or otherwise.
|
|
29
|
+
|
|
30
|
+
There may be a related end device function that identifies a sensor or control point within a metering application
|
|
31
|
+
or communications systems (e.g., water, gas, electricity).
|
|
32
|
+
|
|
33
|
+
Some devices may use an optical port that conforms to the ANSI C12.18 standard for communications.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
customer_mrid: Optional[str] = None
|
|
37
|
+
"""The `zepben.ewb.model.cim.iec61968.customers.customer.Customer` owning this `EndDevice`."""
|
|
38
|
+
|
|
39
|
+
service_location: Optional[Location] = None
|
|
40
|
+
"""Service `zepben.ewb.model.cim.iec61968.common.location.Location` whose service delivery is measured by this `EndDevice`."""
|
|
41
|
+
|
|
42
|
+
_usage_points: Optional[List[UsagePoint]] = None
|
|
43
|
+
|
|
44
|
+
_functions: Optional[List[EndDeviceFunction]] = None
|
|
45
|
+
|
|
46
|
+
def __init__(self, usage_points: List[UsagePoint] = None, functions: List[EndDeviceFunction] = None, **kwargs):
|
|
47
|
+
super(EndDevice, self).__init__(**kwargs)
|
|
48
|
+
if usage_points:
|
|
49
|
+
for up in usage_points:
|
|
50
|
+
self.add_usage_point(up)
|
|
51
|
+
if functions:
|
|
52
|
+
for edf in functions:
|
|
53
|
+
self.add_function(edf)
|
|
54
|
+
|
|
55
|
+
def num_usage_points(self):
|
|
56
|
+
"""
|
|
57
|
+
Returns The number of `UsagePoint`s associated with this `EndDevice`
|
|
58
|
+
"""
|
|
59
|
+
return nlen(self._usage_points)
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def usage_points(self) -> Generator[UsagePoint, None, None]:
|
|
63
|
+
"""
|
|
64
|
+
The `UsagePoint`s associated with this `EndDevice`
|
|
65
|
+
"""
|
|
66
|
+
return ngen(self._usage_points)
|
|
67
|
+
|
|
68
|
+
def get_usage_point(self, mrid: str) -> UsagePoint:
|
|
69
|
+
"""
|
|
70
|
+
Get the `UsagePoint` for this `EndDevice` identified by `mrid`
|
|
71
|
+
|
|
72
|
+
`mrid` the mRID of the required `UsagePoint`
|
|
73
|
+
Returns The `UsagePoint` with the specified `mrid` if it exists
|
|
74
|
+
Raises `KeyError` if `mrid` wasn't present.
|
|
75
|
+
"""
|
|
76
|
+
return get_by_mrid(self._usage_points, mrid)
|
|
77
|
+
|
|
78
|
+
def add_usage_point(self, up: UsagePoint) -> EndDevice:
|
|
79
|
+
"""
|
|
80
|
+
Associate `up` to this `EndDevice`.
|
|
81
|
+
|
|
82
|
+
`up` the `UsagePoint` to associate with this `EndDevice`.
|
|
83
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
84
|
+
Raises `ValueError` if another `UsagePoint` with the same `mrid` already exists for this `EndDevice`.
|
|
85
|
+
"""
|
|
86
|
+
if self._validate_reference(up, self.get_usage_point, "A UsagePoint"):
|
|
87
|
+
return self
|
|
88
|
+
self._usage_points = list() if self._usage_points is None else self._usage_points
|
|
89
|
+
self._usage_points.append(up)
|
|
90
|
+
return self
|
|
91
|
+
|
|
92
|
+
def remove_usage_point(self, up: UsagePoint) -> EndDevice:
|
|
93
|
+
"""
|
|
94
|
+
Disassociate `up` from this `EndDevice`
|
|
95
|
+
|
|
96
|
+
`up` the `UsagePoint` to disassociate from this `EndDevice`.
|
|
97
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
98
|
+
Raises `ValueError` if `up` was not associated with this `EndDevice`.
|
|
99
|
+
"""
|
|
100
|
+
self._usage_points = safe_remove(self._usage_points, up)
|
|
101
|
+
return self
|
|
102
|
+
|
|
103
|
+
def clear_usage_points(self) -> EndDevice:
|
|
104
|
+
"""
|
|
105
|
+
Clear all usage_points.
|
|
106
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
107
|
+
"""
|
|
108
|
+
self._usage_points = None
|
|
109
|
+
return self
|
|
110
|
+
|
|
111
|
+
def num_functions(self):
|
|
112
|
+
"""
|
|
113
|
+
Returns The number of `EndDeviceFunction`s associated with this `EndDevice`
|
|
114
|
+
"""
|
|
115
|
+
return nlen(self._functions)
|
|
116
|
+
|
|
117
|
+
@property
|
|
118
|
+
def functions(self) -> Generator[EndDeviceFunction, None, None]:
|
|
119
|
+
"""
|
|
120
|
+
The `EndDeviceFunction`s associated with this `EndDevice`
|
|
121
|
+
"""
|
|
122
|
+
return ngen(self._functions)
|
|
123
|
+
|
|
124
|
+
def get_function(self, mrid: str) -> EndDeviceFunction:
|
|
125
|
+
"""
|
|
126
|
+
Get the `EndDeviceFunction` for this `EndDevice` identified by `mrid`
|
|
127
|
+
|
|
128
|
+
`mrid` the mRID of the required `EndDeviceFunction`
|
|
129
|
+
Returns The `EndDeviceFunction` with the specified `mrid` if it exists
|
|
130
|
+
Raises `KeyError` if `mrid` wasn't present.
|
|
131
|
+
"""
|
|
132
|
+
return get_by_mrid(self._functions, mrid)
|
|
133
|
+
|
|
134
|
+
def add_function(self, edf: EndDeviceFunction) -> EndDevice:
|
|
135
|
+
"""
|
|
136
|
+
Associate `edf` to this `EndDevice`.
|
|
137
|
+
|
|
138
|
+
`edf` the `EndDeviceFunction` to associate with this `EndDevice`.
|
|
139
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
140
|
+
Raises `ValueError` if another `EndDeviceFunction` with the same `mrid` already exists for this `EndDevice`.
|
|
141
|
+
"""
|
|
142
|
+
if self._validate_reference(edf, self.get_function, "An EndDeviceFunction"):
|
|
143
|
+
return self
|
|
144
|
+
self._functions = list() if self._functions is None else self._functions
|
|
145
|
+
self._functions.append(edf)
|
|
146
|
+
return self
|
|
147
|
+
|
|
148
|
+
def remove_function(self, edf: EndDeviceFunction) -> EndDevice:
|
|
149
|
+
"""
|
|
150
|
+
Disassociate `edf` from this `EndDevice`
|
|
151
|
+
|
|
152
|
+
`up` the `EndDeviceFunction` to disassociate from this `EndDevice`.
|
|
153
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
154
|
+
Raises `ValueError` if `up` was not associated with this `EndDevice`.
|
|
155
|
+
"""
|
|
156
|
+
self._functions = safe_remove(self._functions, edf)
|
|
157
|
+
return self
|
|
158
|
+
|
|
159
|
+
def clear_functions(self) -> EndDevice:
|
|
160
|
+
"""
|
|
161
|
+
Clear all end_device_functions.
|
|
162
|
+
Returns A reference to this `EndDevice` to allow fluent use.
|
|
163
|
+
"""
|
|
164
|
+
self._functions = None
|
|
165
|
+
return self
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = ["EndDeviceFunction"]
|
|
7
|
+
|
|
8
|
+
from zepben.ewb.model.cim.iec61968.assets.asset_function import AssetFunction
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class EndDeviceFunction(AssetFunction):
|
|
12
|
+
"""
|
|
13
|
+
Function performed by an end device such as a meter, communication equipment, controllers, etc.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
enabled: bool = True
|
|
17
|
+
"""True if the function is enabled."""
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = ["EndDeviceFunctionKind"]
|
|
7
|
+
|
|
8
|
+
from enum import Enum
|
|
9
|
+
|
|
10
|
+
from zepben.ewb import unique
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@unique
|
|
14
|
+
class EndDeviceFunctionKind(Enum):
|
|
15
|
+
"""
|
|
16
|
+
Kind of end device function.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
UNKNOWN = 0
|
|
20
|
+
"""Unknown function kind."""
|
|
21
|
+
|
|
22
|
+
autonomousDst = 1
|
|
23
|
+
"""Autonomous application of daylight saving time (DST)."""
|
|
24
|
+
|
|
25
|
+
demandResponse = 2
|
|
26
|
+
"""Demand response functions."""
|
|
27
|
+
|
|
28
|
+
electricMetering = 3
|
|
29
|
+
"""Electricity metering."""
|
|
30
|
+
|
|
31
|
+
metrology = 4
|
|
32
|
+
"""Presentation of metered values to a user or another system (always a function of a meter, but might not be supported by a load control unit)."""
|
|
33
|
+
|
|
34
|
+
onRequestRead = 5
|
|
35
|
+
"""On-request reads."""
|
|
36
|
+
|
|
37
|
+
outageHistory = 6
|
|
38
|
+
"""Reporting historical power interruption data."""
|
|
39
|
+
|
|
40
|
+
relaysProgramming = 7
|
|
41
|
+
"""Support for one or more relays that may be programmable in the meter (and tied to TOU, time pulse, load control or other functions)."""
|
|
42
|
+
|
|
43
|
+
reverseFlow = 8
|
|
44
|
+
"""Detection and monitoring of reverse flow."""
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def short_name(self):
|
|
48
|
+
return str(self)[22:]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
__all__ = ["Meter"]
|
|
7
|
+
|
|
8
|
+
from typing import Optional
|
|
9
|
+
|
|
10
|
+
from zepben.ewb.model.cim.iec61968.metering.end_device import EndDevice
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Meter(EndDevice):
|
|
14
|
+
"""
|
|
15
|
+
Physical asset that performs the metering role of the usage point. Used for measuring consumption and detection of events.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def company_meter_id(self) -> Optional[str]:
|
|
20
|
+
""" Returns this `Meter`s ID. Currently stored in `IdentifiedObject.name` """
|
|
21
|
+
return self.name
|
|
22
|
+
|
|
23
|
+
@company_meter_id.setter
|
|
24
|
+
def company_meter_id(self, meter_id: Optional[str]):
|
|
25
|
+
"""
|
|
26
|
+
`meter_id` The ID to set for this Meter. Will use `IdentifiedObject.name` as a backing field.
|
|
27
|
+
"""
|
|
28
|
+
self.name = meter_id
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Copyright 2025 Zeppelin Bend Pty Ltd
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
__all__ = ["UsagePoint"]
|
|
9
|
+
|
|
10
|
+
from typing import Optional, List, Generator, TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
from zepben.ewb.model.cim.iec61970.base.core.identified_object import IdentifiedObject
|
|
13
|
+
from zepben.ewb.model.cim.iec61970.base.core.phase_code import PhaseCode
|
|
14
|
+
from zepben.ewb.util import nlen, ngen, get_by_mrid, safe_remove
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from zepben.ewb.model.cim.iec61968.common.location import Location
|
|
18
|
+
from zepben.ewb.model.cim.iec61968.metering.end_device import EndDevice
|
|
19
|
+
from zepben.ewb.model.cim.iec61970.base.core.equipment import Equipment
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class UsagePoint(IdentifiedObject):
|
|
23
|
+
"""
|
|
24
|
+
Logical or physical point in the network to which readings or events may be attributed.
|
|
25
|
+
Used at the place where a physical or virtual meter may be located; however, it is not required that a meter be present.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
usage_point_location: Optional[Location] = None
|
|
29
|
+
"""Service `zepben.ewb.model.cim.iec61968.common.location.Location` where the service delivered by this `UsagePoint` is consumed."""
|
|
30
|
+
|
|
31
|
+
is_virtual: Optional[bool] = None
|
|
32
|
+
"""
|
|
33
|
+
If true, this usage point is virtual, i.e., no physical location exists in the network where a meter could be located to
|
|
34
|
+
collect the meter readings. For example, one may define a virtual usage point to serve as an aggregation of usage for all
|
|
35
|
+
of a company's premises distributed widely across the distribution territory. Otherwise, the usage point is physical,
|
|
36
|
+
i.e., there is a logical point in the network where a meter could be located to collect meter readings.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
connection_category: Optional[str] = None
|
|
40
|
+
"""
|
|
41
|
+
A code used to specify the connection category, e.g., low voltage or low pressure, where the usage point is defined.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
rated_power: Optional[int] = None
|
|
45
|
+
"""Active power that this usage point is configured to deliver in watts."""
|
|
46
|
+
|
|
47
|
+
approved_inverter_capacity: Optional[int] = None
|
|
48
|
+
"""The approved inverter capacity at this UsagePoint in volt-amperes."""
|
|
49
|
+
|
|
50
|
+
phase_code: PhaseCode = PhaseCode.NONE
|
|
51
|
+
"""
|
|
52
|
+
Phase code. Number of wires and specific nominal phases can be deduced from enumeration literal values. For example, ABCN is three-phase,
|
|
53
|
+
four-wire, s12n (splitSecondary12N) is single-phase, three-wire, and s1n and s2n are single-phase, two-wire.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
_equipment: Optional[List[Equipment]] = None
|
|
57
|
+
_end_devices: Optional[List[EndDevice]] = None
|
|
58
|
+
|
|
59
|
+
def __init__(self, equipment: List[Equipment] = None, end_devices: List[EndDevice] = None, **kwargs):
|
|
60
|
+
super(UsagePoint, self).__init__(**kwargs)
|
|
61
|
+
if equipment:
|
|
62
|
+
for eq in equipment:
|
|
63
|
+
self.add_equipment(eq)
|
|
64
|
+
if end_devices:
|
|
65
|
+
for ed in end_devices:
|
|
66
|
+
self.add_end_device(ed)
|
|
67
|
+
|
|
68
|
+
def num_equipment(self):
|
|
69
|
+
"""
|
|
70
|
+
Returns The number of `Equipment`s associated with this `UsagePoint`
|
|
71
|
+
"""
|
|
72
|
+
return nlen(self._equipment)
|
|
73
|
+
|
|
74
|
+
def num_end_devices(self):
|
|
75
|
+
"""
|
|
76
|
+
Returns The number of `EndDevice`s associated with this `UsagePoint`
|
|
77
|
+
"""
|
|
78
|
+
return nlen(self._end_devices)
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def end_devices(self) -> Generator[EndDevice, None, None]:
|
|
82
|
+
"""
|
|
83
|
+
The `EndDevice`'s (Meter's) associated with this `UsagePoint`.
|
|
84
|
+
"""
|
|
85
|
+
return ngen(self._end_devices)
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def equipment(self) -> Generator[Equipment, None, None]:
|
|
89
|
+
"""
|
|
90
|
+
The `zepben.model.Equipment` associated with this `UsagePoint`.
|
|
91
|
+
"""
|
|
92
|
+
return ngen(self._equipment)
|
|
93
|
+
|
|
94
|
+
def get_equipment(self, mrid: str) -> Equipment:
|
|
95
|
+
"""
|
|
96
|
+
Get the `Equipment` for this `UsagePoint` identified by `mrid`
|
|
97
|
+
|
|
98
|
+
`mrid` The mRID of the required `Equipment`
|
|
99
|
+
Returns The `Equipment` with the specified `mrid` if it exists
|
|
100
|
+
Raises `KeyError` if `mrid` wasn't present.
|
|
101
|
+
"""
|
|
102
|
+
return get_by_mrid(self._equipment, mrid)
|
|
103
|
+
|
|
104
|
+
def add_equipment(self, equipment: Equipment) -> UsagePoint:
|
|
105
|
+
"""
|
|
106
|
+
Associate an `Equipment` with this `UsagePoint`
|
|
107
|
+
|
|
108
|
+
`equipment` The `Equipment` to associate with this `UsagePoint`.
|
|
109
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
110
|
+
Raises `ValueError` if another `Equipment` with the same `mrid` already exists for this `UsagePoint`.
|
|
111
|
+
"""
|
|
112
|
+
if self._validate_reference(equipment, self.get_equipment, "An Equipment"):
|
|
113
|
+
return self
|
|
114
|
+
|
|
115
|
+
self._equipment = list() if self._equipment is None else self._equipment
|
|
116
|
+
self._equipment.append(equipment)
|
|
117
|
+
return self
|
|
118
|
+
|
|
119
|
+
def remove_equipment(self, equipment: Equipment) -> UsagePoint:
|
|
120
|
+
"""
|
|
121
|
+
Disassociate an `Equipment` from this `UsagePoint`
|
|
122
|
+
|
|
123
|
+
`equipment` The `Equipment` to disassociate with this `UsagePoint`.
|
|
124
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
125
|
+
Raises `ValueError` if `equipment` was not associated with this `UsagePoint`.
|
|
126
|
+
"""
|
|
127
|
+
self._equipment = safe_remove(self._equipment, equipment)
|
|
128
|
+
return self
|
|
129
|
+
|
|
130
|
+
def clear_equipment(self) -> UsagePoint:
|
|
131
|
+
"""
|
|
132
|
+
Clear all equipment.
|
|
133
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
134
|
+
"""
|
|
135
|
+
self._equipment = None
|
|
136
|
+
return self
|
|
137
|
+
|
|
138
|
+
def get_end_device(self, mrid: str) -> EndDevice:
|
|
139
|
+
"""
|
|
140
|
+
Get the `EndDevice` for this `UsagePoint` identified by `mrid`
|
|
141
|
+
|
|
142
|
+
`mrid` The mRID of the required `EndDevice`
|
|
143
|
+
Returns The `EndDevice` with the specified `mrid` if it exists
|
|
144
|
+
Raises `KeyError` if `mrid` wasn't present.
|
|
145
|
+
"""
|
|
146
|
+
return get_by_mrid(self._end_devices, mrid)
|
|
147
|
+
|
|
148
|
+
def add_end_device(self, end_device: EndDevice) -> UsagePoint:
|
|
149
|
+
"""
|
|
150
|
+
Associate an `EndDevice` with this `UsagePoint`
|
|
151
|
+
|
|
152
|
+
`end_device` The `EndDevice` to associate with this `UsagePoint`.
|
|
153
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
154
|
+
Raises `ValueError` if another `EndDevice` with the same `mrid` already exists for this `UsagePoint`.
|
|
155
|
+
"""
|
|
156
|
+
if self._validate_reference(end_device, self.get_end_device, "An EndDevice"):
|
|
157
|
+
return self
|
|
158
|
+
self._end_devices = list() if self._end_devices is None else self._end_devices
|
|
159
|
+
self._end_devices.append(end_device)
|
|
160
|
+
return self
|
|
161
|
+
|
|
162
|
+
def remove_end_device(self, end_device: EndDevice) -> UsagePoint:
|
|
163
|
+
"""
|
|
164
|
+
Disassociate `end_device` from this `UsagePoint`.
|
|
165
|
+
|
|
166
|
+
`end_device` The `EndDevice` to disassociate from this `UsagePoint`.
|
|
167
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
168
|
+
Raises `ValueError` if `end_device` was not associated with this `UsagePoint`.
|
|
169
|
+
"""
|
|
170
|
+
self._end_devices = safe_remove(self._end_devices, end_device)
|
|
171
|
+
return self
|
|
172
|
+
|
|
173
|
+
def clear_end_devices(self) -> UsagePoint:
|
|
174
|
+
"""
|
|
175
|
+
Clear all end_devices.
|
|
176
|
+
Returns A reference to this `UsagePoint` to allow fluent use.
|
|
177
|
+
"""
|
|
178
|
+
self._end_devices = None
|
|
179
|
+
return self
|
|
180
|
+
|
|
181
|
+
def is_metered(self):
|
|
182
|
+
"""
|
|
183
|
+
Check whether this `UsagePoint` is metered. A `UsagePoint` is metered if it's associated with at least one `EndDevice`.
|
|
184
|
+
Returns True if this `UsagePoint` has an `EndDevice`, False otherwise.
|
|
185
|
+
"""
|
|
186
|
+
return nlen(self._end_devices) > 0
|