gridstate 2.13.0__tar.gz → 2.14.0__tar.gz
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.
- {gridstate-2.13.0 → gridstate-2.14.0}/PKG-INFO +1 -1
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/_version.py +3 -3
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/derived.py +7 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/derived_tables.py +37 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/version.py +3 -1
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/preparation.py +9 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/steps.py +11 -1
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/apply_resolved.py +17 -7
- gridstate-2.14.0/gridstate/telemetry/sigma2_scale.py +111 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/PKG-INFO +1 -1
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/SOURCES.txt +2 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/scm_file_list.json +2 -0
- gridstate-2.14.0/gridstate.egg-info/scm_version.json +8 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case118.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case118_degraded.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case14.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case14_degraded.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case30.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case30_degraded.json +24 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/manifest.json +86 -2
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_derived_tables.py +3 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_external_sigma2.py +1 -0
- gridstate-2.14.0/tests/test_measurement_sigma2_scale.py +142 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_telemetry_apply_kernel.py +52 -0
- gridstate-2.13.0/gridstate.egg-info/scm_version.json +0 -8
- {gridstate-2.13.0 → gridstate-2.14.0}/.github/workflows/ci.yml +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/.github/workflows/release.yml +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/.gitignore +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/.pre-commit-config.yaml +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/CHANGELOG.md +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/LICENSE +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/Makefile +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/README.md +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/build_cython.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/__pyinstaller/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/__pyinstaller/hook-gridstate.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/_arrays.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/adapters/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/adapters/from_pandapower.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/_selinv_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/base.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/estimators.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/jacobian_pattern.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algebra/normalized_residuals.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/_gram_numba.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/ipm.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/ipm_pd.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/kkt_solver.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/status.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/wls.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/algorithms/wls_box.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/api.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/bad_data_repass.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/bounds.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/constants.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/_legacy.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/containers.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/serialize.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/tables.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/contract/validate.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/ipm_hints.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/load_characteristics.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/losses.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/measurement_ids.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/config.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/context.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/manifest.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/orchestration.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/passes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/pipeline/runner.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/post_processing.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/_scan.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/ipm_setup.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/meas_rows.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/mirror_voltage.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/node_props.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/preprocessing/pseudo_measurements.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/py.typed +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/quality_summary.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/resolve_pass.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/result.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/runtime.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/shunt_sanity.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/solution_hints.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/state.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/supernodes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/_filters.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/generators.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/kinds.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/load_only_injection.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/loss_filter.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/measurements.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/noise.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/on_line.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/quality.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/rpn.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/shunts.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/sigma_floor.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/units.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/voltage_filter.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/telemetry/voltage_nominal.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/topology.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/units.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/utils.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/v_mirror.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/v_refine.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/validation/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/validation/_diagnostics.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/validation/bad_data.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/validation/chi2_test.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/validation/observability.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/working.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/ybus.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate/z_vector.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/dependency_links.txt +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/entry_points.txt +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/requires.txt +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/gridstate.egg-info/top_level.txt +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/pyproject.toml +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/setup.cfg +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/__init__.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/_golden.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/conftest.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_adapters_lazy_import.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_aggregate_generators.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_algebra_base.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_anti_overshoot.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_arrays_helpers.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_bad_data.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_bad_data_repass.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_bounds.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_boxed_balance.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_breaker_reactance.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_chain_mirror.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_contract.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_contract_edge_cases.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_contract_runtime.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case118.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case118_degraded.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case14.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case14_degraded.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case30.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/golden/case30_degraded.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case118.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case118_truth.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case14.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case14_truth.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case30.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_data/ieee/case30_truth.npz +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_enum_codes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_flow_sigma_floor.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_from_pandapower.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_generator_shunt_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_golden.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_gram_numba.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ieee_cases.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_injection_split.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm_balance_modes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm_hints.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm_injection_roles.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm_integration.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ipm_pd.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_jacobian_pattern.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_kkt_solver.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_load_characteristic_segments.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_load_only_injection.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_losses_breakdown.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_losses_q_convention.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_losses_trafo_classification.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_materialize_kernel.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_measurement_filter_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_measurement_ids.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_mirror_voltage_kernel.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_near_critical_ranking.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_neutral_wording.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_noise_model.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_normalized_residuals.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_numpy_only_runtime.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_observability.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_on_line_kernel.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_perf_synthetic_network.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_config_validation.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_idempotent.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_invariant_errors.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_step_order.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_warm_start.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pipeline_working_layer.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_post_processing.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_preparation_steps.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_prepare_network.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pseudo_transit_tight.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pseudo_unknown_load.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pseudo_v_scope.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_pseudo_v_unobservable.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_quality_summary_paths.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_reconcile_balance.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_refine_merge.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_resolve_pass.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_result_quality_summary.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_rn_selected_inversion.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_serialize_npz.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_shunt_sanity.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_solution_hints.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_solve_status.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_state.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_state_range.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_supernodes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_telemetry_bounds.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_telemetry_physics_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_tm_code_quality.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_topology_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_topology_port.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_transformer_from_shunt.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_units.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_units_array_kernels.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_v_mirror.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_v_refine.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_variance_charging.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_version.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_voltage_calibration_gen_nodes.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_voltage_range_filter_fallback.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_wls.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_wls_node_box.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_wls_robustness.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_working_container.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_ybus.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tests/test_z_vector.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tools/gen_ieee_fixtures.py +0 -0
- {gridstate-2.13.0 → gridstate-2.14.0}/tools/golden.py +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.
|
|
22
|
-
__version_tuple__ = version_tuple = (2,
|
|
21
|
+
__version__ = version = '2.14.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 14, 0)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'gbf7092d1e'
|
|
@@ -67,6 +67,12 @@ class DerivedInputs:
|
|
|
67
67
|
components summed into one row (injection components, repeated hits)
|
|
68
68
|
sum their variances. What the later steps may do with it is set by
|
|
69
69
|
``PipelineConfig.external_sigma2``. ``None`` = the built-in rules;
|
|
70
|
+
* ``measurement_sigma2_scale`` — ``{TelemetryKey: factor}``, the producer's
|
|
71
|
+
factor of the variance of a telemetry value (<1 more trust, >1 less). It
|
|
72
|
+
multiplies the variance of the row the value feeds after every built-in
|
|
73
|
+
rule of the preparation (the QUESTIONABLE multiplier, the scale plans, the
|
|
74
|
+
flow σ floor) and also a final external variance; a row fed by several
|
|
75
|
+
values takes the largest factor among them. ``None`` = no factors;
|
|
70
76
|
* ``pseudo_measurements`` — ``{PseudoKey: PseudoValue}``, pseudo-measurements
|
|
71
77
|
added as given (``is_pseudo``, variance final) by the ``external_pseudo``
|
|
72
78
|
step, before the built-in ``add_pseudo``. ``None`` = none.
|
|
@@ -87,4 +93,5 @@ class DerivedInputs:
|
|
|
87
93
|
flow_sigma2_scale: dict[FlowKey, float] | None = None
|
|
88
94
|
telemetry_bounds: dict[TelemetryKey, TelemetryBounds] | None = None
|
|
89
95
|
measurement_sigma2: dict[TelemetryKey, float] | None = None
|
|
96
|
+
measurement_sigma2_scale: dict[TelemetryKey, float] | None = None
|
|
90
97
|
pseudo_measurements: dict[PseudoKey, PseudoValue] | None = None
|
|
@@ -54,6 +54,7 @@ table and is absent from ``fields`` in the metadata):
|
|
|
54
54
|
``flow_sigma2_scale`` ``flow_sigma2_scale`` one branch flow variance factor
|
|
55
55
|
``telemetry_bounds`` ``telemetry_bounds`` one plausible range of a telemetry value
|
|
56
56
|
``measurement_sigma2`` ``measurement_sigma2`` one absolute variance of a telemetry value
|
|
57
|
+
``measurement_sigma2_scale`` ``measurement_sigma2_scale`` one variance factor of a telemetry value
|
|
57
58
|
``pseudo_measurements`` ``pseudo_measurements`` one external pseudo-measurement
|
|
58
59
|
``telemetry_total_args`` (metadata) integer, statistics only
|
|
59
60
|
===================== ===================== ======================================
|
|
@@ -364,6 +365,21 @@ MEASUREMENT_SIGMA2 = TableSchema(
|
|
|
364
365
|
),
|
|
365
366
|
)
|
|
366
367
|
|
|
368
|
+
MEASUREMENT_SIGMA2_SCALE = TableSchema(
|
|
369
|
+
name="measurement_sigma2_scale",
|
|
370
|
+
key=("object_id", "kind", "component"),
|
|
371
|
+
doc=(
|
|
372
|
+
"Producer's variance factor of telemetry values "
|
|
373
|
+
"(DerivedInputs.measurement_sigma2_scale). In memory: {(object_id, kind): factor}."
|
|
374
|
+
),
|
|
375
|
+
columns=(
|
|
376
|
+
_col("object_id", "i4", "Object id (as in the telemetry table)."),
|
|
377
|
+
_col("kind", "i1", "Telemetry kind code (TELEMETRY_KINDS)."),
|
|
378
|
+
_col("component", "i4", "Component number of an injection kind; -1 for none."),
|
|
379
|
+
_col("factor", "f8", "Multiplier of the final variance (<1 more trust, >1 less)."),
|
|
380
|
+
),
|
|
381
|
+
)
|
|
382
|
+
|
|
367
383
|
PSEUDO_MEASUREMENTS = TableSchema(
|
|
368
384
|
name="pseudo_measurements",
|
|
369
385
|
key=("node_id", "kind"),
|
|
@@ -390,6 +406,7 @@ DERIVED_TABLES: tuple[TableSchema, ...] = (
|
|
|
390
406
|
FLOW_SIGMA2_SCALE,
|
|
391
407
|
TELEMETRY_BOUNDS,
|
|
392
408
|
MEASUREMENT_SIGMA2,
|
|
409
|
+
MEASUREMENT_SIGMA2_SCALE,
|
|
393
410
|
PSEUDO_MEASUREMENTS,
|
|
394
411
|
)
|
|
395
412
|
|
|
@@ -404,6 +421,7 @@ FIELD_TABLES: dict[str, str] = {
|
|
|
404
421
|
"flow_sigma2_scale": FLOW_SIGMA2_SCALE.name,
|
|
405
422
|
"telemetry_bounds": TELEMETRY_BOUNDS.name,
|
|
406
423
|
"measurement_sigma2": MEASUREMENT_SIGMA2.name,
|
|
424
|
+
"measurement_sigma2_scale": MEASUREMENT_SIGMA2_SCALE.name,
|
|
407
425
|
"pseudo_measurements": PSEUDO_MEASUREMENTS.name,
|
|
408
426
|
}
|
|
409
427
|
|
|
@@ -543,6 +561,14 @@ def derived_to_tables(derived: DerivedInputs) -> tuple[dict[str, np.ndarray], di
|
|
|
543
561
|
"measurement_sigma2",
|
|
544
562
|
((*_key_columns(o, k), float(s2)) for (o, k), s2 in derived.measurement_sigma2.items()),
|
|
545
563
|
)
|
|
564
|
+
if derived.measurement_sigma2_scale is not None:
|
|
565
|
+
put(
|
|
566
|
+
"measurement_sigma2_scale",
|
|
567
|
+
(
|
|
568
|
+
(*_key_columns(o, k), float(f))
|
|
569
|
+
for (o, k), f in derived.measurement_sigma2_scale.items()
|
|
570
|
+
),
|
|
571
|
+
)
|
|
546
572
|
if derived.pseudo_measurements is not None:
|
|
547
573
|
put(
|
|
548
574
|
"pseudo_measurements",
|
|
@@ -689,6 +715,15 @@ def _measurement_sigma2(arr: np.ndarray) -> dict[tuple[int, str], float]:
|
|
|
689
715
|
return out
|
|
690
716
|
|
|
691
717
|
|
|
718
|
+
def _measurement_sigma2_scale(arr: np.ndarray) -> dict[tuple[int, str], float]:
|
|
719
|
+
out: dict[tuple[int, str], float] = {}
|
|
720
|
+
for object_id, code, comp, factor in arr.tolist():
|
|
721
|
+
out[(object_id, _kind_name(code, comp))] = factor
|
|
722
|
+
if len(out) != len(arr):
|
|
723
|
+
raise ValueError("derived table 'measurement_sigma2_scale': duplicate keys")
|
|
724
|
+
return out
|
|
725
|
+
|
|
726
|
+
|
|
692
727
|
def _pseudo_measurements(arr: np.ndarray) -> dict[tuple[int, str], tuple[float, float]]:
|
|
693
728
|
out: dict[tuple[int, str], tuple[float, float]] = {}
|
|
694
729
|
for node_id, code, value, sigma2 in arr.tolist():
|
|
@@ -750,6 +785,8 @@ def derived_from_tables(tables: Mapping[str, np.ndarray], meta: Mapping[str, Any
|
|
|
750
785
|
derived.telemetry_bounds = _telemetry_bounds(arr)
|
|
751
786
|
if (arr := table("measurement_sigma2")) is not None:
|
|
752
787
|
derived.measurement_sigma2 = _measurement_sigma2(arr)
|
|
788
|
+
if (arr := table("measurement_sigma2_scale")) is not None:
|
|
789
|
+
derived.measurement_sigma2_scale = _measurement_sigma2_scale(arr)
|
|
753
790
|
if (arr := table("pseudo_measurements")) is not None:
|
|
754
791
|
derived.pseudo_measurements = _pseudo_measurements(arr)
|
|
755
792
|
return derived
|
|
@@ -52,7 +52,9 @@ from dataclasses import dataclass
|
|
|
52
52
|
# (piecewise load characteristics).
|
|
53
53
|
# 3.3.0 (MINOR): the optional derived tables ``measurement_sigma2`` and
|
|
54
54
|
# ``pseudo_measurements`` (external measurement variances and pseudo-measurements).
|
|
55
|
-
|
|
55
|
+
# 3.4.0 (MINOR): the optional derived table ``measurement_sigma2_scale`` (the
|
|
56
|
+
# producer's variance factor of a telemetry value, applied last).
|
|
57
|
+
CONTRACT_VERSION = "3.4.0"
|
|
56
58
|
|
|
57
59
|
# Major of the data the explicit legacy path of the ``.npz`` loader still reads
|
|
58
60
|
# (``load_se_input_npz(path, trusted=True)``).
|
|
@@ -33,6 +33,7 @@ from gridstate.telemetry.load_only_injection import (
|
|
|
33
33
|
)
|
|
34
34
|
from gridstate.telemetry.on_line import apply_topology_resolved
|
|
35
35
|
from gridstate.telemetry.rpn import apply_rpn_resolved
|
|
36
|
+
from gridstate.telemetry.sigma2_scale import apply_measurement_sigma2_scale
|
|
36
37
|
from gridstate.telemetry.voltage_nominal import apply_voltage_nominal_resolved
|
|
37
38
|
from gridstate.topology import (
|
|
38
39
|
disable_disconnected_components,
|
|
@@ -281,3 +282,11 @@ def _s_flow_sigma_floor(ctx: _Ctx) -> dict:
|
|
|
281
282
|
return dict(
|
|
282
283
|
apply_flow_sigma_floor(ctx.model, kv_frac=float(frac), skip_ids=ctx.fixed_sigma2_ids) or {}
|
|
283
284
|
)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def _s_measurement_sigma2_scale(ctx: _Ctx) -> dict:
|
|
288
|
+
# The producer's factor of a value's variance, last: after every built-in
|
|
289
|
+
# rule above (the flow floor included) and over a final external variance.
|
|
290
|
+
if ctx.derived is None or ctx.derived.measurement_sigma2_scale is None:
|
|
291
|
+
return {"skipped": "no factors (derived.measurement_sigma2_scale)"}
|
|
292
|
+
return apply_measurement_sigma2_scale(ctx.model, ctx.derived.measurement_sigma2_scale)
|
|
@@ -49,6 +49,7 @@ from gridstate.pipeline.preparation import (
|
|
|
49
49
|
_s_gen_v_calibration,
|
|
50
50
|
_s_generator_status,
|
|
51
51
|
_s_materialize,
|
|
52
|
+
_s_measurement_sigma2_scale,
|
|
52
53
|
_s_mirror_voltage,
|
|
53
54
|
_s_normalize_breakers,
|
|
54
55
|
_s_reactors,
|
|
@@ -332,13 +333,22 @@ STEPS: list[Step] = [
|
|
|
332
333
|
_s_flow_sigma_floor,
|
|
333
334
|
after=("add_pseudo",),
|
|
334
335
|
),
|
|
336
|
+
Step(
|
|
337
|
+
"measurement_sigma2_scale",
|
|
338
|
+
"Producer's variance factors",
|
|
339
|
+
_G_INPUT,
|
|
340
|
+
"variance ×factor of DerivedInputs.measurement_sigma2_scale, after every rule above.",
|
|
341
|
+
_s_measurement_sigma2_scale,
|
|
342
|
+
needs_derived=True,
|
|
343
|
+
after=("flow_sigma_floor",),
|
|
344
|
+
),
|
|
335
345
|
Step(
|
|
336
346
|
"estimate",
|
|
337
347
|
"Оценка состояния (WLS/IPM)",
|
|
338
348
|
_G_EST,
|
|
339
349
|
"gridstate.estimate: solve_wls / solve_ipm.",
|
|
340
350
|
_s_estimate,
|
|
341
|
-
after=("
|
|
351
|
+
after=("measurement_sigma2_scale",),
|
|
342
352
|
),
|
|
343
353
|
# ORDER INVARIANT (after=): bad_data_repass → v_refine → v_mirror →
|
|
344
354
|
# v_mirror_chain → refine_merged → anti_overshoot strictly BETWEEN estimate
|
|
@@ -207,6 +207,15 @@ def apply_telemetry_resolved(
|
|
|
207
207
|
return stats
|
|
208
208
|
|
|
209
209
|
|
|
210
|
+
def _usable_value(entry: tuple[float | None, int, str, int]) -> float | None:
|
|
211
|
+
"""Value of a resolved entry for the consistency pre-passes; ``None`` when BAD.
|
|
212
|
+
|
|
213
|
+
A BAD measurement is not applied, so its value must not condemn the other
|
|
214
|
+
measurements of the branch either.
|
|
215
|
+
"""
|
|
216
|
+
return None if entry[3] == _Q_BAD else entry[0]
|
|
217
|
+
|
|
218
|
+
|
|
210
219
|
def _detect_sign_inconsistent_branches(
|
|
211
220
|
arg_keys: list[tuple[int, str]],
|
|
212
221
|
resolved: dict[tuple[int, str], tuple[float | None, int, str, int]],
|
|
@@ -216,7 +225,7 @@ def _detect_sign_inconsistent_branches(
|
|
|
216
225
|
(p_from and p_to both flowing into the line, i.e. of the same sign after
|
|
217
226
|
accounting for invert) -- this indicates a measurement bound to the wrong
|
|
218
227
|
branch or stale telemetry. The branch measurements of such branches are
|
|
219
|
-
not activated.
|
|
228
|
+
not activated. BAD measurements take no part in the check.
|
|
220
229
|
"""
|
|
221
230
|
inconsistent_branches: set[int] = set()
|
|
222
231
|
if threshold_mw is None:
|
|
@@ -226,8 +235,8 @@ def _detect_sign_inconsistent_branches(
|
|
|
226
235
|
continue
|
|
227
236
|
if (obj_id, KIND_P_TO) not in resolved:
|
|
228
237
|
continue
|
|
229
|
-
v_beg = resolved[(obj_id, KIND_P_FROM)]
|
|
230
|
-
v_end = resolved[(obj_id, KIND_P_TO)]
|
|
238
|
+
v_beg = _usable_value(resolved[(obj_id, KIND_P_FROM)])
|
|
239
|
+
v_end = _usable_value(resolved[(obj_id, KIND_P_TO)])
|
|
231
240
|
if v_beg is None or v_end is None:
|
|
232
241
|
continue
|
|
233
242
|
# p_from/p_to values arrive with the sign already applied (the inversion
|
|
@@ -255,7 +264,8 @@ def _detect_q_inconsistent_branches(
|
|
|
255
264
|
``branch.{susceptance, reactance}``; an outlier is a deviation above
|
|
256
265
|
``max(floor, rel_pct/100 * expected)``. See
|
|
257
266
|
:func:`gridstate.telemetry.loss_filter.is_branch_q_consistent_with_physics`.
|
|
258
|
-
Branches without a nominal voltage are not checked
|
|
267
|
+
Branches without a nominal voltage are not checked; BAD measurements take no
|
|
268
|
+
part in the check.
|
|
259
269
|
|
|
260
270
|
Returns ``(q_inconsistent_branches, q_inconsistent_hv_branches)``: branches
|
|
261
271
|
to drop and branches to downweight (by ``q_loss_filter_action``).
|
|
@@ -271,8 +281,8 @@ def _detect_q_inconsistent_branches(
|
|
|
271
281
|
continue
|
|
272
282
|
if (obj_id, KIND_Q_TO) not in resolved:
|
|
273
283
|
continue
|
|
274
|
-
v_beg = resolved[(obj_id, KIND_Q_FROM)]
|
|
275
|
-
v_end = resolved[(obj_id, KIND_Q_TO)]
|
|
284
|
+
v_beg = _usable_value(resolved[(obj_id, KIND_Q_FROM)])
|
|
285
|
+
v_end = _usable_value(resolved[(obj_id, KIND_Q_TO)])
|
|
276
286
|
if v_beg is None or v_end is None:
|
|
277
287
|
continue
|
|
278
288
|
vn = branch_vn.get(int(obj_id), 0.0)
|
|
@@ -283,7 +293,7 @@ def _detect_q_inconsistent_branches(
|
|
|
283
293
|
for p_kind in (KIND_P_FROM, KIND_P_TO):
|
|
284
294
|
if (obj_id, p_kind) not in resolved:
|
|
285
295
|
continue
|
|
286
|
-
pv = resolved[(obj_id, p_kind)]
|
|
296
|
+
pv = _usable_value(resolved[(obj_id, p_kind)])
|
|
287
297
|
if pv is not None:
|
|
288
298
|
p_typical = max(p_typical, abs(pv))
|
|
289
299
|
is_ok, _, _, _ = is_branch_q_consistent_with_physics(
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"""Producer's variance factor of a telemetry value (``DerivedInputs.measurement_sigma2_scale``).
|
|
2
|
+
|
|
3
|
+
The factor is the producer's last word on the weight of one value: the step runs
|
|
4
|
+
after every built-in rule of the preparation (QUESTIONABLE multiplier, the scale
|
|
5
|
+
plans, the flow σ floor), so ``variance := variance · factor`` holds against the
|
|
6
|
+
variance those rules settled on, a final external variance included. Pseudo rows
|
|
7
|
+
are not touched.
|
|
8
|
+
|
|
9
|
+
Rows and keys (``{(object_id, kind): factor}``, kinds of
|
|
10
|
+
:data:`~gridstate.contract.derived_tables.TELEMETRY_KINDS`):
|
|
11
|
+
|
|
12
|
+
* node V row ← ``(node, "v")``;
|
|
13
|
+
* branch flow row of one end ← ``(branch, "p_from" | "p_to" | "q_from" | "q_to")``;
|
|
14
|
+
* node injection row ← every component of its axis, ``p_gen[:n]`` and
|
|
15
|
+
``p_load[:n]`` (``q_*`` for Q); a role row (``source_code`` ``inj_gen`` /
|
|
16
|
+
``inj_load``) only the components of its role. A row fed by several keys takes
|
|
17
|
+
the largest factor among them (the least trust wins).
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import math
|
|
23
|
+
from collections.abc import Mapping
|
|
24
|
+
from typing import TYPE_CHECKING
|
|
25
|
+
|
|
26
|
+
import numpy as np
|
|
27
|
+
|
|
28
|
+
from gridstate.constants import SOURCE_INJ_GEN, SOURCE_INJ_LOAD
|
|
29
|
+
from gridstate.contract.derived_tables import split_kind
|
|
30
|
+
from gridstate.working import table_copy, table_replace
|
|
31
|
+
from gridstate.z_vector import (
|
|
32
|
+
KIND_POWER_INJECTION_P,
|
|
33
|
+
KIND_POWER_INJECTION_Q,
|
|
34
|
+
KIND_POWER_P,
|
|
35
|
+
KIND_POWER_Q,
|
|
36
|
+
KIND_VOLTAGE,
|
|
37
|
+
OBJ_BRANCH,
|
|
38
|
+
OBJ_NODE,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
from gridstate.working import Working
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = ["apply_measurement_sigma2_scale"]
|
|
47
|
+
|
|
48
|
+
_FLOW = {
|
|
49
|
+
(KIND_POWER_P, 0): "p_from",
|
|
50
|
+
(KIND_POWER_P, 1): "p_to",
|
|
51
|
+
(KIND_POWER_Q, 0): "q_from",
|
|
52
|
+
(KIND_POWER_Q, 1): "q_to",
|
|
53
|
+
}
|
|
54
|
+
_INJECTION_AXIS = {KIND_POWER_INJECTION_P: "p", KIND_POWER_INJECTION_Q: "q"}
|
|
55
|
+
_ROLES = {SOURCE_INJ_GEN: ("gen",), SOURCE_INJ_LOAD: ("load",)}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _row_bases(row: np.void) -> tuple[str, ...]:
|
|
59
|
+
"""Base kinds of the keys that feed ``row`` (empty: no telemetry key feeds it)."""
|
|
60
|
+
ot, mt = int(row["object_type"]), int(row["measurement_type"])
|
|
61
|
+
if ot == OBJ_NODE and mt == KIND_VOLTAGE:
|
|
62
|
+
return ("v",)
|
|
63
|
+
if ot == OBJ_BRANCH:
|
|
64
|
+
kind = _FLOW.get((mt, int(row["branch_side"])))
|
|
65
|
+
return (kind,) if kind else ()
|
|
66
|
+
if ot == OBJ_NODE and mt in _INJECTION_AXIS:
|
|
67
|
+
axis = _INJECTION_AXIS[mt]
|
|
68
|
+
roles = _ROLES.get(str(row["source_code"]), ("gen", "load"))
|
|
69
|
+
return tuple(f"{axis}_{role}" for role in roles)
|
|
70
|
+
return ()
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def apply_measurement_sigma2_scale(
|
|
74
|
+
model: Working, scale: Mapping[tuple[int, str], float]
|
|
75
|
+
) -> dict[str, int]:
|
|
76
|
+
"""Multiply the variance of the rows the keyed values feed by their factor.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
``{"scaled": rows, "unused": keys that feed no real row}``.
|
|
80
|
+
|
|
81
|
+
Raises:
|
|
82
|
+
ValueError: a factor that is not finite and positive, or a key outside the
|
|
83
|
+
telemetry vocabulary.
|
|
84
|
+
"""
|
|
85
|
+
by_base: dict[tuple[int, str], float] = {}
|
|
86
|
+
for (object_id, kind), factor in scale.items():
|
|
87
|
+
f = float(factor)
|
|
88
|
+
if not (math.isfinite(f) and f > 0.0):
|
|
89
|
+
raise ValueError(
|
|
90
|
+
f"measurement_sigma2_scale[{(object_id, kind)!r}] = {factor!r}: expected finite > 0"
|
|
91
|
+
)
|
|
92
|
+
base, _component = split_kind(kind)
|
|
93
|
+
key = (int(object_id), base)
|
|
94
|
+
by_base[key] = max(by_base.get(key, 0.0), f)
|
|
95
|
+
|
|
96
|
+
meas_arr = table_copy(model.measurements)
|
|
97
|
+
used: set[tuple[int, str]] = set()
|
|
98
|
+
scaled = 0
|
|
99
|
+
for i in np.flatnonzero(~meas_arr["is_pseudo"].astype(bool)).tolist():
|
|
100
|
+
row = meas_arr[i]
|
|
101
|
+
oid = int(row["object_id"])
|
|
102
|
+
hits = [(oid, b) for b in _row_bases(row) if (oid, b) in by_base]
|
|
103
|
+
if not hits:
|
|
104
|
+
continue
|
|
105
|
+
used.update(hits)
|
|
106
|
+
meas_arr["variance"][i] *= max(by_base[k] for k in hits)
|
|
107
|
+
meas_arr["weight"][i] = 1.0 / meas_arr["variance"][i]
|
|
108
|
+
scaled += 1
|
|
109
|
+
table_replace(model.measurements, meas_arr)
|
|
110
|
+
unused = sum(1 for (o, k) in scale if (int(o), split_kind(k)[0]) not in used)
|
|
111
|
+
return {"scaled": scaled, "unused": unused}
|
|
@@ -101,6 +101,7 @@ gridstate/telemetry/on_line.py
|
|
|
101
101
|
gridstate/telemetry/quality.py
|
|
102
102
|
gridstate/telemetry/rpn.py
|
|
103
103
|
gridstate/telemetry/shunts.py
|
|
104
|
+
gridstate/telemetry/sigma2_scale.py
|
|
104
105
|
gridstate/telemetry/sigma_floor.py
|
|
105
106
|
gridstate/telemetry/units.py
|
|
106
107
|
gridstate/telemetry/voltage_filter.py
|
|
@@ -153,6 +154,7 @@ tests/test_losses_trafo_classification.py
|
|
|
153
154
|
tests/test_materialize_kernel.py
|
|
154
155
|
tests/test_measurement_filter_kernels.py
|
|
155
156
|
tests/test_measurement_ids.py
|
|
157
|
+
tests/test_measurement_sigma2_scale.py
|
|
156
158
|
tests/test_mirror_voltage_kernel.py
|
|
157
159
|
tests/test_near_critical_ranking.py
|
|
158
160
|
tests/test_neutral_wording.py
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"gridstate/telemetry/quality.py",
|
|
86
86
|
"gridstate/telemetry/rpn.py",
|
|
87
87
|
"gridstate/telemetry/shunts.py",
|
|
88
|
+
"gridstate/telemetry/sigma2_scale.py",
|
|
88
89
|
"gridstate/telemetry/sigma_floor.py",
|
|
89
90
|
"gridstate/telemetry/units.py",
|
|
90
91
|
"gridstate/telemetry/voltage_filter.py",
|
|
@@ -165,6 +166,7 @@
|
|
|
165
166
|
"tests/test_materialize_kernel.py",
|
|
166
167
|
"tests/test_measurement_filter_kernels.py",
|
|
167
168
|
"tests/test_measurement_ids.py",
|
|
169
|
+
"tests/test_measurement_sigma2_scale.py",
|
|
168
170
|
"tests/test_mirror_voltage_kernel.py",
|
|
169
171
|
"tests/test_near_critical_ranking.py",
|
|
170
172
|
"tests/test_neutral_wording.py",
|
|
@@ -260,6 +260,10 @@
|
|
|
260
260
|
"skipped": "<text>"
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"type": "step_skipped",
|
|
265
|
+
"name": "measurement_sigma2_scale"
|
|
266
|
+
},
|
|
263
267
|
{
|
|
264
268
|
"type": "step_start",
|
|
265
269
|
"name": "estimate"
|
|
@@ -584,6 +588,10 @@
|
|
|
584
588
|
"floored": 744
|
|
585
589
|
}
|
|
586
590
|
},
|
|
591
|
+
{
|
|
592
|
+
"type": "step_skipped",
|
|
593
|
+
"name": "measurement_sigma2_scale"
|
|
594
|
+
},
|
|
587
595
|
{
|
|
588
596
|
"type": "step_start",
|
|
589
597
|
"name": "estimate"
|
|
@@ -941,6 +949,10 @@
|
|
|
941
949
|
"floored": 744
|
|
942
950
|
}
|
|
943
951
|
},
|
|
952
|
+
{
|
|
953
|
+
"type": "step_skipped",
|
|
954
|
+
"name": "measurement_sigma2_scale"
|
|
955
|
+
},
|
|
944
956
|
{
|
|
945
957
|
"type": "step_start",
|
|
946
958
|
"name": "estimate"
|
|
@@ -1291,6 +1303,10 @@
|
|
|
1291
1303
|
"floored": 744
|
|
1292
1304
|
}
|
|
1293
1305
|
},
|
|
1306
|
+
{
|
|
1307
|
+
"type": "step_skipped",
|
|
1308
|
+
"name": "measurement_sigma2_scale"
|
|
1309
|
+
},
|
|
1294
1310
|
{
|
|
1295
1311
|
"type": "step_start",
|
|
1296
1312
|
"name": "estimate"
|
|
@@ -1658,6 +1674,10 @@
|
|
|
1658
1674
|
"floored": 744
|
|
1659
1675
|
}
|
|
1660
1676
|
},
|
|
1677
|
+
{
|
|
1678
|
+
"type": "step_skipped",
|
|
1679
|
+
"name": "measurement_sigma2_scale"
|
|
1680
|
+
},
|
|
1661
1681
|
{
|
|
1662
1682
|
"type": "step_start",
|
|
1663
1683
|
"name": "estimate"
|
|
@@ -2028,6 +2048,10 @@
|
|
|
2028
2048
|
"floored": 744
|
|
2029
2049
|
}
|
|
2030
2050
|
},
|
|
2051
|
+
{
|
|
2052
|
+
"type": "step_skipped",
|
|
2053
|
+
"name": "measurement_sigma2_scale"
|
|
2054
|
+
},
|
|
2031
2055
|
{
|
|
2032
2056
|
"type": "step_start",
|
|
2033
2057
|
"name": "estimate"
|
|
@@ -260,6 +260,10 @@
|
|
|
260
260
|
"skipped": "<text>"
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"type": "step_skipped",
|
|
265
|
+
"name": "measurement_sigma2_scale"
|
|
266
|
+
},
|
|
263
267
|
{
|
|
264
268
|
"type": "step_start",
|
|
265
269
|
"name": "estimate"
|
|
@@ -584,6 +588,10 @@
|
|
|
584
588
|
"floored": 734
|
|
585
589
|
}
|
|
586
590
|
},
|
|
591
|
+
{
|
|
592
|
+
"type": "step_skipped",
|
|
593
|
+
"name": "measurement_sigma2_scale"
|
|
594
|
+
},
|
|
587
595
|
{
|
|
588
596
|
"type": "step_start",
|
|
589
597
|
"name": "estimate"
|
|
@@ -957,6 +965,10 @@
|
|
|
957
965
|
"floored": 734
|
|
958
966
|
}
|
|
959
967
|
},
|
|
968
|
+
{
|
|
969
|
+
"type": "step_skipped",
|
|
970
|
+
"name": "measurement_sigma2_scale"
|
|
971
|
+
},
|
|
960
972
|
{
|
|
961
973
|
"type": "step_start",
|
|
962
974
|
"name": "estimate"
|
|
@@ -1323,6 +1335,10 @@
|
|
|
1323
1335
|
"floored": 734
|
|
1324
1336
|
}
|
|
1325
1337
|
},
|
|
1338
|
+
{
|
|
1339
|
+
"type": "step_skipped",
|
|
1340
|
+
"name": "measurement_sigma2_scale"
|
|
1341
|
+
},
|
|
1326
1342
|
{
|
|
1327
1343
|
"type": "step_start",
|
|
1328
1344
|
"name": "estimate"
|
|
@@ -1706,6 +1722,10 @@
|
|
|
1706
1722
|
"floored": 734
|
|
1707
1723
|
}
|
|
1708
1724
|
},
|
|
1725
|
+
{
|
|
1726
|
+
"type": "step_skipped",
|
|
1727
|
+
"name": "measurement_sigma2_scale"
|
|
1728
|
+
},
|
|
1709
1729
|
{
|
|
1710
1730
|
"type": "step_start",
|
|
1711
1731
|
"name": "estimate"
|
|
@@ -2095,6 +2115,10 @@
|
|
|
2095
2115
|
"floored": 734
|
|
2096
2116
|
}
|
|
2097
2117
|
},
|
|
2118
|
+
{
|
|
2119
|
+
"type": "step_skipped",
|
|
2120
|
+
"name": "measurement_sigma2_scale"
|
|
2121
|
+
},
|
|
2098
2122
|
{
|
|
2099
2123
|
"type": "step_start",
|
|
2100
2124
|
"name": "estimate"
|
|
@@ -258,6 +258,10 @@
|
|
|
258
258
|
"skipped": "<text>"
|
|
259
259
|
}
|
|
260
260
|
},
|
|
261
|
+
{
|
|
262
|
+
"type": "step_skipped",
|
|
263
|
+
"name": "measurement_sigma2_scale"
|
|
264
|
+
},
|
|
261
265
|
{
|
|
262
266
|
"type": "step_start",
|
|
263
267
|
"name": "estimate"
|
|
@@ -583,6 +587,10 @@
|
|
|
583
587
|
"floored": 40
|
|
584
588
|
}
|
|
585
589
|
},
|
|
590
|
+
{
|
|
591
|
+
"type": "step_skipped",
|
|
592
|
+
"name": "measurement_sigma2_scale"
|
|
593
|
+
},
|
|
586
594
|
{
|
|
587
595
|
"type": "step_start",
|
|
588
596
|
"name": "estimate"
|
|
@@ -941,6 +949,10 @@
|
|
|
941
949
|
"floored": 40
|
|
942
950
|
}
|
|
943
951
|
},
|
|
952
|
+
{
|
|
953
|
+
"type": "step_skipped",
|
|
954
|
+
"name": "measurement_sigma2_scale"
|
|
955
|
+
},
|
|
944
956
|
{
|
|
945
957
|
"type": "step_start",
|
|
946
958
|
"name": "estimate"
|
|
@@ -1292,6 +1304,10 @@
|
|
|
1292
1304
|
"floored": 40
|
|
1293
1305
|
}
|
|
1294
1306
|
},
|
|
1307
|
+
{
|
|
1308
|
+
"type": "step_skipped",
|
|
1309
|
+
"name": "measurement_sigma2_scale"
|
|
1310
|
+
},
|
|
1295
1311
|
{
|
|
1296
1312
|
"type": "step_start",
|
|
1297
1313
|
"name": "estimate"
|
|
@@ -1660,6 +1676,10 @@
|
|
|
1660
1676
|
"floored": 40
|
|
1661
1677
|
}
|
|
1662
1678
|
},
|
|
1679
|
+
{
|
|
1680
|
+
"type": "step_skipped",
|
|
1681
|
+
"name": "measurement_sigma2_scale"
|
|
1682
|
+
},
|
|
1663
1683
|
{
|
|
1664
1684
|
"type": "step_start",
|
|
1665
1685
|
"name": "estimate"
|
|
@@ -2031,6 +2051,10 @@
|
|
|
2031
2051
|
"floored": 40
|
|
2032
2052
|
}
|
|
2033
2053
|
},
|
|
2054
|
+
{
|
|
2055
|
+
"type": "step_skipped",
|
|
2056
|
+
"name": "measurement_sigma2_scale"
|
|
2057
|
+
},
|
|
2034
2058
|
{
|
|
2035
2059
|
"type": "step_start",
|
|
2036
2060
|
"name": "estimate"
|
|
@@ -258,6 +258,10 @@
|
|
|
258
258
|
"skipped": "<text>"
|
|
259
259
|
}
|
|
260
260
|
},
|
|
261
|
+
{
|
|
262
|
+
"type": "step_skipped",
|
|
263
|
+
"name": "measurement_sigma2_scale"
|
|
264
|
+
},
|
|
261
265
|
{
|
|
262
266
|
"type": "step_start",
|
|
263
267
|
"name": "estimate"
|
|
@@ -582,6 +586,10 @@
|
|
|
582
586
|
"floored": 40
|
|
583
587
|
}
|
|
584
588
|
},
|
|
589
|
+
{
|
|
590
|
+
"type": "step_skipped",
|
|
591
|
+
"name": "measurement_sigma2_scale"
|
|
592
|
+
},
|
|
585
593
|
{
|
|
586
594
|
"type": "step_start",
|
|
587
595
|
"name": "estimate"
|
|
@@ -951,6 +959,10 @@
|
|
|
951
959
|
"floored": 40
|
|
952
960
|
}
|
|
953
961
|
},
|
|
962
|
+
{
|
|
963
|
+
"type": "step_skipped",
|
|
964
|
+
"name": "measurement_sigma2_scale"
|
|
965
|
+
},
|
|
954
966
|
{
|
|
955
967
|
"type": "step_start",
|
|
956
968
|
"name": "estimate"
|
|
@@ -1313,6 +1325,10 @@
|
|
|
1313
1325
|
"floored": 40
|
|
1314
1326
|
}
|
|
1315
1327
|
},
|
|
1328
|
+
{
|
|
1329
|
+
"type": "step_skipped",
|
|
1330
|
+
"name": "measurement_sigma2_scale"
|
|
1331
|
+
},
|
|
1316
1332
|
{
|
|
1317
1333
|
"type": "step_start",
|
|
1318
1334
|
"name": "estimate"
|
|
@@ -1692,6 +1708,10 @@
|
|
|
1692
1708
|
"floored": 40
|
|
1693
1709
|
}
|
|
1694
1710
|
},
|
|
1711
|
+
{
|
|
1712
|
+
"type": "step_skipped",
|
|
1713
|
+
"name": "measurement_sigma2_scale"
|
|
1714
|
+
},
|
|
1695
1715
|
{
|
|
1696
1716
|
"type": "step_start",
|
|
1697
1717
|
"name": "estimate"
|
|
@@ -2077,6 +2097,10 @@
|
|
|
2077
2097
|
"floored": 40
|
|
2078
2098
|
}
|
|
2079
2099
|
},
|
|
2100
|
+
{
|
|
2101
|
+
"type": "step_skipped",
|
|
2102
|
+
"name": "measurement_sigma2_scale"
|
|
2103
|
+
},
|
|
2080
2104
|
{
|
|
2081
2105
|
"type": "step_start",
|
|
2082
2106
|
"name": "estimate"
|