chronaxis 0.1.0.dev0__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.
- chronaxis/__init__.py +72 -0
- chronaxis/__main__.py +12 -0
- chronaxis/analysis_cli.py +181 -0
- chronaxis/batch/__init__.py +14 -0
- chronaxis/batch/api.py +46 -0
- chronaxis/batch/cli.py +48 -0
- chronaxis/batch/config.py +37 -0
- chronaxis/batch/models.py +202 -0
- chronaxis/batch/process_transport.py +149 -0
- chronaxis/batch/process_tree.py +72 -0
- chronaxis/batch/publication.py +41 -0
- chronaxis/batch/runner.py +236 -0
- chronaxis/batch/templates.py +42 -0
- chronaxis/can_dependencies.py +42 -0
- chronaxis/cli.py +193 -0
- chronaxis/configuration/__init__.py +46 -0
- chronaxis/configuration/cli.py +41 -0
- chronaxis/configuration/diagnostics.py +107 -0
- chronaxis/configuration/explanation.py +233 -0
- chronaxis/configuration/file_tools.py +140 -0
- chronaxis/configuration/imports.py +144 -0
- chronaxis/configuration/initialization.py +36 -0
- chronaxis/configuration/json_parser.py +114 -0
- chronaxis/configuration/models.py +74 -0
- chronaxis/configuration/origins.py +90 -0
- chronaxis/configuration/overrides.py +55 -0
- chronaxis/configuration/resolution.py +150 -0
- chronaxis/configuration/template_catalog.py +68 -0
- chronaxis/configuration/templates/batch/analysis-annotated.yaml +18 -0
- chronaxis/configuration/templates/batch/analysis-minimal.yaml +18 -0
- chronaxis/configuration/templates/batch/annotated.yaml +6 -0
- chronaxis/configuration/templates/batch/minimal.yaml +6 -0
- chronaxis/configuration/templates/can-asc/annotated.yaml +18 -0
- chronaxis/configuration/templates/can-asc/minimal.yaml +18 -0
- chronaxis/configuration/templates/can-blf/annotated.yaml +18 -0
- chronaxis/configuration/templates/can-blf/minimal.yaml +18 -0
- chronaxis/configuration/templates/can-export/annotated.yaml +23 -0
- chronaxis/configuration/templates/can-export/minimal.yaml +23 -0
- chronaxis/configuration/templates/catalog.json +233 -0
- chronaxis/configuration/templates/charge-session/annotated.yaml +38 -0
- chronaxis/configuration/templates/charge-session/minimal.yaml +38 -0
- chronaxis/configuration/templates/command-response/annotated.yaml +32 -0
- chronaxis/configuration/templates/command-response/minimal.yaml +36 -0
- chronaxis/configuration/templates/fault-window/annotated.yaml +25 -0
- chronaxis/configuration/templates/fault-window/minimal.yaml +27 -0
- chronaxis/configuration/templates/ini-mapping/annotated.yaml +20 -0
- chronaxis/configuration/templates/ini-mapping/minimal.yaml +20 -0
- chronaxis/configuration/templates/raw-can-csv/annotated.yaml +34 -0
- chronaxis/configuration/templates/raw-can-csv/minimal.yaml +35 -0
- chronaxis/configuration/templates/shared/charge-session.asc +5 -0
- chronaxis/configuration/templates/shared/command-response.asc +8 -0
- chronaxis/configuration/templates/shared/fault-window.asc +5 -0
- chronaxis/configuration/templates/shared/power.asc +7 -0
- chronaxis/configuration/templates/shared/sample.asc +6 -0
- chronaxis/configuration/templates/shared/sample.blf +0 -0
- chronaxis/configuration/templates/shared/sample.csv +5 -0
- chronaxis/configuration/templates/shared/sample.dbc +11 -0
- chronaxis/configuration/templates/shared/signals.csv +6 -0
- chronaxis/configuration/templates/shared/source.ini +5 -0
- chronaxis/configuration/templates/shared/stability.asc +9 -0
- chronaxis/configuration/templates/shared/teaching.dbc +27 -0
- chronaxis/configuration/templates/shared/threshold.asc +7 -0
- chronaxis/configuration/templates/signal-csv/annotated.yaml +27 -0
- chronaxis/configuration/templates/signal-csv/minimal.yaml +27 -0
- chronaxis/configuration/templates/signal-export/annotated.yaml +27 -0
- chronaxis/configuration/templates/signal-export/minimal.yaml +29 -0
- chronaxis/configuration/templates/stability/annotated.yaml +35 -0
- chronaxis/configuration/templates/stability/minimal.yaml +35 -0
- chronaxis/configuration/templates/threshold/annotated.yaml +22 -0
- chronaxis/configuration/templates/threshold/minimal.yaml +22 -0
- chronaxis/configuration/yaml_parser.py +125 -0
- chronaxis/core/__init__.py +71 -0
- chronaxis/core/binding.py +449 -0
- chronaxis/core/calculation_series_join.py +106 -0
- chronaxis/core/calculations.py +435 -0
- chronaxis/core/calculations_memory_numpy.py +136 -0
- chronaxis/core/calculations_memory_reference.py +165 -0
- chronaxis/core/calculations_numpy.py +298 -0
- chronaxis/core/calculations_reference.py +294 -0
- chronaxis/core/condition_evidence.py +182 -0
- chronaxis/core/conditional_integral_result.py +43 -0
- chronaxis/core/conditional_integral_terms.py +146 -0
- chronaxis/core/conditional_integral_terms_numpy.py +148 -0
- chronaxis/core/conditional_integral_terms_reference.py +111 -0
- chronaxis/core/conditional_time_reduction.py +118 -0
- chronaxis/core/conditional_time_reduction_numpy.py +223 -0
- chronaxis/core/conditional_time_reduction_reference.py +213 -0
- chronaxis/core/declarations.py +192 -0
- chronaxis/core/decoded_binding.py +197 -0
- chronaxis/core/direct_message.py +387 -0
- chronaxis/core/export_interpolation.py +54 -0
- chronaxis/core/expression.py +642 -0
- chronaxis/core/expression_numpy.py +314 -0
- chronaxis/core/expression_reference.py +272 -0
- chronaxis/core/integral_result.py +53 -0
- chronaxis/core/integral_sum.py +77 -0
- chronaxis/core/integral_sum_numpy.py +224 -0
- chronaxis/core/integral_sum_reference.py +148 -0
- chronaxis/core/integral_terms.py +119 -0
- chronaxis/core/integral_terms_numpy.py +127 -0
- chronaxis/core/integral_terms_reference.py +91 -0
- chronaxis/core/mean_weights_numpy.py +29 -0
- chronaxis/core/mean_weights_reference.py +27 -0
- chronaxis/core/message_binding.py +305 -0
- chronaxis/core/models.py +485 -0
- chronaxis/core/normalize_numpy.py +396 -0
- chronaxis/core/numeric.py +472 -0
- chronaxis/core/numeric_numpy.py +440 -0
- chronaxis/core/record_intervals.py +115 -0
- chronaxis/core/sample_reduction.py +161 -0
- chronaxis/core/sample_reduction_numpy.py +160 -0
- chronaxis/core/sample_reduction_reference.py +154 -0
- chronaxis/core/selection.py +74 -0
- chronaxis/core/sequence.py +160 -0
- chronaxis/core/sequence_reference.py +248 -0
- chronaxis/core/stability.py +249 -0
- chronaxis/core/start_end.py +169 -0
- chronaxis/core/state.py +494 -0
- chronaxis/core/state_numpy.py +296 -0
- chronaxis/core/temporal.py +373 -0
- chronaxis/core/temporal_clock.py +25 -0
- chronaxis/core/temporal_memory_numpy.py +163 -0
- chronaxis/core/temporal_memory_reference.py +161 -0
- chronaxis/core/temporal_numpy.py +345 -0
- chronaxis/core/temporal_reference.py +304 -0
- chronaxis/core/time_reduction.py +190 -0
- chronaxis/core/time_reduction_numpy.py +205 -0
- chronaxis/core/time_reduction_reference.py +203 -0
- chronaxis/core/types.py +105 -0
- chronaxis/core/units.py +81 -0
- chronaxis/core/validation.py +94 -0
- chronaxis/core/window_delta.py +123 -0
- chronaxis/core/window_delta_numpy.py +78 -0
- chronaxis/core/window_delta_reference.py +69 -0
- chronaxis/core/windows.py +224 -0
- chronaxis/core/windows_numpy.py +78 -0
- chronaxis/core/windows_reference.py +61 -0
- chronaxis/execution/__init__.py +6 -0
- chronaxis/execution/batch_signal_groups.py +122 -0
- chronaxis/execution/bindings.py +296 -0
- chronaxis/execution/boundaries.py +568 -0
- chronaxis/execution/calculation_blocks.py +338 -0
- chronaxis/execution/calculation_values.py +55 -0
- chronaxis/execution/can_batch_reader.py +356 -0
- chronaxis/execution/can_reader.py +948 -0
- chronaxis/execution/can_reference_template.py +61 -0
- chronaxis/execution/condition_evidence.py +370 -0
- chronaxis/execution/conditional_integral_facts.py +310 -0
- chronaxis/execution/conditional_integral_reduction.py +216 -0
- chronaxis/execution/csv_observation.py +524 -0
- chronaxis/execution/csv_reader.py +662 -0
- chronaxis/execution/current_message_calculation.py +225 -0
- chronaxis/execution/driver_expression.py +274 -0
- chronaxis/execution/expressions.py +618 -0
- chronaxis/execution/frame_capture.py +245 -0
- chronaxis/execution/groups.py +236 -0
- chronaxis/execution/historical_conditional_blocks.py +264 -0
- chronaxis/execution/historical_conditional_integral.py +226 -0
- chronaxis/execution/historical_conditional_time_calculation.py +368 -0
- chronaxis/execution/historical_integral.py +219 -0
- chronaxis/execution/historical_observation.py +372 -0
- chronaxis/execution/historical_sample_calculation.py +338 -0
- chronaxis/execution/historical_selection_rows.py +300 -0
- chronaxis/execution/historical_time_calculation.py +341 -0
- chronaxis/execution/history.py +572 -0
- chronaxis/execution/history_records.py +225 -0
- chronaxis/execution/hold.py +448 -0
- chronaxis/execution/integral_facts.py +311 -0
- chronaxis/execution/integral_reduction.py +216 -0
- chronaxis/execution/legacy_frame_samples.py +94 -0
- chronaxis/execution/memory_reader.py +247 -0
- chronaxis/execution/message_bindings.py +293 -0
- chronaxis/execution/message_delivery.py +37 -0
- chronaxis/execution/observed_ingestion.py +551 -0
- chronaxis/execution/raw_signal_groups.py +192 -0
- chronaxis/execution/record_alarm_duration.py +114 -0
- chronaxis/execution/record_delta_condition.py +167 -0
- chronaxis/execution/record_diagnostics.py +87 -0
- chronaxis/execution/record_event_durations.py +143 -0
- chronaxis/execution/record_export_samples.py +94 -0
- chronaxis/execution/record_exports.py +155 -0
- chronaxis/execution/record_integral.py +196 -0
- chronaxis/execution/record_point_buffer.py +101 -0
- chronaxis/execution/record_rule_timeline.py +344 -0
- chronaxis/execution/record_sample.py +46 -0
- chronaxis/execution/record_sample_series.py +29 -0
- chronaxis/execution/record_scope_calculations.py +290 -0
- chronaxis/execution/record_selection.py +62 -0
- chronaxis/execution/record_sequences.py +199 -0
- chronaxis/execution/record_session_calculations.py +778 -0
- chronaxis/execution/record_signal_export.py +133 -0
- chronaxis/execution/record_source_cursor.py +295 -0
- chronaxis/execution/record_time_calculation.py +322 -0
- chronaxis/execution/record_time_indexes.py +143 -0
- chronaxis/execution/record_value_history.py +160 -0
- chronaxis/execution/record_windows.py +229 -0
- chronaxis/execution/required_expression.py +52 -0
- chronaxis/execution/retained_metadata.py +71 -0
- chronaxis/execution/run_session.py +402 -0
- chronaxis/execution/scanned_signal_proof.py +550 -0
- chronaxis/execution/signal_validity.py +40 -0
- chronaxis/execution/state.py +280 -0
- chronaxis/execution/temporal_buffer.py +508 -0
- chronaxis/execution/text_can_reader.py +359 -0
- chronaxis/execution/timeline.py +309 -0
- chronaxis/execution/timeline_multi.py +415 -0
- chronaxis/execution/window_delta_events.py +220 -0
- chronaxis/execution/window_replay.py +350 -0
- chronaxis/execution/windows.py +173 -0
- chronaxis/guide/README.md +70 -0
- chronaxis/guide/api/AnalysisError.md +14 -0
- chronaxis/guide/api/AnalysisPlan.md +96 -0
- chronaxis/guide/api/AnalysisResult.md +398 -0
- chronaxis/guide/api/AnalysisRunner.md +155 -0
- chronaxis/guide/api/BatchJob.md +19 -0
- chronaxis/guide/api/BatchJobResult.md +61 -0
- chronaxis/guide/api/BatchPlan.md +48 -0
- chronaxis/guide/api/BatchReport.md +108 -0
- chronaxis/guide/api/BatchRunner.md +84 -0
- chronaxis/guide/api/OutputManifest.md +23 -0
- chronaxis/guide/api/PlanFragment.md +47 -0
- chronaxis/guide/api/PlanValidationError.md +98 -0
- chronaxis/guide/api/PresetSpec.md +63 -0
- chronaxis/guide/api/ResultClosedError.md +14 -0
- chronaxis/guide/api/RunMetadata.md +100 -0
- chronaxis/guide/api/TimeConversion.md +29 -0
- chronaxis/guide/api/TimeOverflowError.md +17 -0
- chronaxis/guide/api/build_preset.md +36 -0
- chronaxis/guide/api/checked_add_ns.md +30 -0
- chronaxis/guide/api/convert_time.md +40 -0
- chronaxis/guide/api/explain_analysis_plan.md +38 -0
- chronaxis/guide/api/index.json +185 -0
- chronaxis/guide/api/load_analysis_plan.md +34 -0
- chronaxis/guide/api/load_batch_plan.md +36 -0
- chronaxis/guide/api/parse_datetime_ns.md +35 -0
- chronaxis/guide/api/parse_duration.md +30 -0
- chronaxis/guide/api/resolve_preset_roles.md +37 -0
- chronaxis/guide/api/run_batch.md +38 -0
- chronaxis/guide/api/shift_times_reference.md +33 -0
- chronaxis/guide/api/time_deltas_reference.md +37 -0
- chronaxis/guide/api/validate_analysis_plan.md +38 -0
- chronaxis/guide/en/README.md +74 -0
- chronaxis/guide/en/api/AnalysisError.md +14 -0
- chronaxis/guide/en/api/AnalysisPlan.md +93 -0
- chronaxis/guide/en/api/AnalysisResult.md +398 -0
- chronaxis/guide/en/api/AnalysisRunner.md +191 -0
- chronaxis/guide/en/api/BatchJob.md +17 -0
- chronaxis/guide/en/api/BatchJobResult.md +43 -0
- chronaxis/guide/en/api/BatchPlan.md +37 -0
- chronaxis/guide/en/api/BatchReport.md +52 -0
- chronaxis/guide/en/api/BatchRunner.md +51 -0
- chronaxis/guide/en/api/OutputManifest.md +23 -0
- chronaxis/guide/en/api/PlanFragment.md +33 -0
- chronaxis/guide/en/api/PlanValidationError.md +58 -0
- chronaxis/guide/en/api/PresetSpec.md +51 -0
- chronaxis/guide/en/api/ResultClosedError.md +14 -0
- chronaxis/guide/en/api/RunMetadata.md +100 -0
- chronaxis/guide/en/api/TimeConversion.md +23 -0
- chronaxis/guide/en/api/TimeOverflowError.md +14 -0
- chronaxis/guide/en/api/build_preset.md +23 -0
- chronaxis/guide/en/api/checked_add_ns.md +21 -0
- chronaxis/guide/en/api/convert_time.md +25 -0
- chronaxis/guide/en/api/explain_analysis_plan.md +30 -0
- chronaxis/guide/en/api/index.json +185 -0
- chronaxis/guide/en/api/load_analysis_plan.md +27 -0
- chronaxis/guide/en/api/load_batch_plan.md +28 -0
- chronaxis/guide/en/api/parse_datetime_ns.md +23 -0
- chronaxis/guide/en/api/parse_duration.md +20 -0
- chronaxis/guide/en/api/resolve_preset_roles.md +23 -0
- chronaxis/guide/en/api/run_batch.md +39 -0
- chronaxis/guide/en/api/shift_times_reference.md +21 -0
- chronaxis/guide/en/api/time_deltas_reference.md +22 -0
- chronaxis/guide/en/api/validate_analysis_plan.md +29 -0
- chronaxis/guide/en/fields/analysis/calculations-all-1.json +345 -0
- chronaxis/guide/en/fields/analysis/calculations-all-2.json +300 -0
- chronaxis/guide/en/fields/analysis/calculations-all-3.json +84 -0
- chronaxis/guide/en/fields/analysis/config_version-all-1.json +24 -0
- chronaxis/guide/en/fields/analysis/dataset-all-1.json +344 -0
- chronaxis/guide/en/fields/analysis/derived-all-1.json +147 -0
- chronaxis/guide/en/fields/analysis/diagnostics-all-1.json +69 -0
- chronaxis/guide/en/fields/analysis/execution-all-1.json +167 -0
- chronaxis/guide/en/fields/analysis/imports-all-1.json +39 -0
- chronaxis/guide/en/fields/analysis/intervals-all-1.json +173 -0
- chronaxis/guide/en/fields/analysis/message_calculations-all-1.json +345 -0
- chronaxis/guide/en/fields/analysis/message_calculations-all-2.json +270 -0
- chronaxis/guide/en/fields/analysis/metadata-all-1.json +24 -0
- chronaxis/guide/en/fields/analysis/outputs-all-1.json +332 -0
- chronaxis/guide/en/fields/analysis/outputs-all-2.json +319 -0
- chronaxis/guide/en/fields/analysis/outputs-all-3.json +321 -0
- chronaxis/guide/en/fields/analysis/outputs-all-4.json +236 -0
- chronaxis/guide/en/fields/analysis/outputs-all-5.json +246 -0
- chronaxis/guide/en/fields/analysis/outputs-all-6.json +214 -0
- chronaxis/guide/en/fields/analysis/overrides-all-1.json +104 -0
- chronaxis/guide/en/fields/analysis/presets-charge_session-1.json +398 -0
- chronaxis/guide/en/fields/analysis/presets-charge_session-2.json +114 -0
- chronaxis/guide/en/fields/analysis/presets-command_response-1.json +376 -0
- chronaxis/guide/en/fields/analysis/presets-fault_context-1.json +285 -0
- chronaxis/guide/en/fields/analysis/presets-threshold_excursion-1.json +317 -0
- chronaxis/guide/en/fields/analysis/rules-condition_duration-1.json +344 -0
- chronaxis/guide/en/fields/analysis/rules-condition_duration-2.json +27 -0
- chronaxis/guide/en/fields/analysis/rules-debounce-1.json +335 -0
- chronaxis/guide/en/fields/analysis/rules-falling_edge-1.json +317 -0
- chronaxis/guide/en/fields/analysis/rules-hysteresis-1.json +334 -0
- chronaxis/guide/en/fields/analysis/rules-hysteresis-2.json +27 -0
- chronaxis/guide/en/fields/analysis/rules-rising_edge-1.json +317 -0
- chronaxis/guide/en/fields/analysis/rules-start_end-1.json +333 -0
- chronaxis/guide/en/fields/analysis/rules-start_end-2.json +60 -0
- chronaxis/guide/en/fields/analysis/rules-start_only-1.json +334 -0
- chronaxis/guide/en/fields/analysis/rules-window_delta-1.json +338 -0
- chronaxis/guide/en/fields/analysis/rules-window_delta-2.json +96 -0
- chronaxis/guide/en/fields/analysis/sequences-all-1.json +378 -0
- chronaxis/guide/en/fields/analysis/sequences-all-2.json +70 -0
- chronaxis/guide/en/fields/analysis/signals-variant-1-1.json +349 -0
- chronaxis/guide/en/fields/analysis/signals-variant-1-2.json +297 -0
- chronaxis/guide/en/fields/analysis/signals-variant-1-3.json +323 -0
- chronaxis/guide/en/fields/analysis/signals-variant-1-4.json +192 -0
- chronaxis/guide/en/fields/analysis/signals-variant-2-1.json +327 -0
- chronaxis/guide/en/fields/analysis/signals-variant-2-2.json +312 -0
- chronaxis/guide/en/fields/analysis/signals-variant-2-3.json +294 -0
- chronaxis/guide/en/fields/analysis/signals-variant-2-4.json +253 -0
- chronaxis/guide/en/fields/analysis/signals-variant-2-5.json +44 -0
- chronaxis/guide/en/fields/analysis/sources-can_asc-1.json +318 -0
- chronaxis/guide/en/fields/analysis/sources-can_asc-2.json +310 -0
- chronaxis/guide/en/fields/analysis/sources-can_asc-3.json +311 -0
- chronaxis/guide/en/fields/analysis/sources-can_asc-4.json +69 -0
- chronaxis/guide/en/fields/analysis/sources-can_blf-1.json +317 -0
- chronaxis/guide/en/fields/analysis/sources-can_blf-2.json +310 -0
- chronaxis/guide/en/fields/analysis/sources-can_blf-3.json +317 -0
- chronaxis/guide/en/fields/analysis/sources-memory-1.json +332 -0
- chronaxis/guide/en/fields/analysis/sources-memory-2.json +125 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-1.json +330 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-10.json +233 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-11.json +225 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-12.json +228 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-13.json +226 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-14.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-15.json +227 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-16.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-17.json +238 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-18.json +239 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-19.json +233 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-2.json +310 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-20.json +242 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-21.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-22.json +228 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-23.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-24.json +223 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-25.json +290 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-26.json +131 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-3.json +297 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-4.json +226 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-5.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-6.json +227 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-7.json +230 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-8.json +238 -0
- chronaxis/guide/en/fields/analysis/sources-raw_can_csv-9.json +239 -0
- chronaxis/guide/en/fields/analysis/sources-signal_csv-1.json +331 -0
- chronaxis/guide/en/fields/analysis/sources-signal_csv-2.json +307 -0
- chronaxis/guide/en/fields/analysis/sources-signal_csv-3.json +315 -0
- chronaxis/guide/en/fields/analysis/sources-variant-6-1.json +319 -0
- chronaxis/guide/en/fields/analysis/sources-variant-6-2.json +307 -0
- chronaxis/guide/en/fields/analysis/sources-variant-6-3.json +312 -0
- chronaxis/guide/en/fields/analysis/sources-variant-6-4.json +113 -0
- chronaxis/guide/en/fields/analysis/windows-all-1.json +361 -0
- chronaxis/guide/en/fields/analysis/windows-all-2.json +187 -0
- chronaxis/guide/en/fields/batch/backend-all-1.json +26 -0
- chronaxis/guide/en/fields/batch/batch_version-all-1.json +22 -0
- chronaxis/guide/en/fields/batch/fail_fast-all-1.json +22 -0
- chronaxis/guide/en/fields/batch/inputs-all-1.json +161 -0
- chronaxis/guide/en/fields/batch/jobs-all-1.json +58 -0
- chronaxis/guide/en/fields/batch/process_count-all-1.json +23 -0
- chronaxis/guide/en/fields/batch/source-all-1.json +22 -0
- chronaxis/guide/en/fields/batch/template-all-1.json +22 -0
- chronaxis/guide/en/fields/definitions/derived-all-1.json +121 -0
- chronaxis/guide/en/fields/definitions/signals-all-1.json +336 -0
- chronaxis/guide/en/fields/definitions/signals-all-2.json +307 -0
- chronaxis/guide/en/fields/definitions/signals-all-3.json +290 -0
- chronaxis/guide/en/fields/definitions/signals-all-4.json +347 -0
- chronaxis/guide/en/fields/definitions/signals-all-5.json +297 -0
- chronaxis/guide/en/fields/definitions/signals-all-6.json +259 -0
- chronaxis/guide/en/fields/definitions/signals-all-7.json +117 -0
- chronaxis/guide/en/fields/definitions/sources-all-1.json +332 -0
- chronaxis/guide/en/fields/definitions/sources-all-10.json +306 -0
- chronaxis/guide/en/fields/definitions/sources-all-11.json +294 -0
- chronaxis/guide/en/fields/definitions/sources-all-12.json +212 -0
- chronaxis/guide/en/fields/definitions/sources-all-13.json +217 -0
- chronaxis/guide/en/fields/definitions/sources-all-14.json +213 -0
- chronaxis/guide/en/fields/definitions/sources-all-15.json +214 -0
- chronaxis/guide/en/fields/definitions/sources-all-16.json +215 -0
- chronaxis/guide/en/fields/definitions/sources-all-17.json +213 -0
- chronaxis/guide/en/fields/definitions/sources-all-18.json +214 -0
- chronaxis/guide/en/fields/definitions/sources-all-19.json +213 -0
- chronaxis/guide/en/fields/definitions/sources-all-2.json +323 -0
- chronaxis/guide/en/fields/definitions/sources-all-20.json +217 -0
- chronaxis/guide/en/fields/definitions/sources-all-21.json +210 -0
- chronaxis/guide/en/fields/definitions/sources-all-22.json +214 -0
- chronaxis/guide/en/fields/definitions/sources-all-23.json +218 -0
- chronaxis/guide/en/fields/definitions/sources-all-24.json +209 -0
- chronaxis/guide/en/fields/definitions/sources-all-25.json +215 -0
- chronaxis/guide/en/fields/definitions/sources-all-26.json +218 -0
- chronaxis/guide/en/fields/definitions/sources-all-27.json +224 -0
- chronaxis/guide/en/fields/definitions/sources-all-28.json +215 -0
- chronaxis/guide/en/fields/definitions/sources-all-29.json +205 -0
- chronaxis/guide/en/fields/definitions/sources-all-3.json +303 -0
- chronaxis/guide/en/fields/definitions/sources-all-30.json +298 -0
- chronaxis/guide/en/fields/definitions/sources-all-31.json +315 -0
- chronaxis/guide/en/fields/definitions/sources-all-32.json +306 -0
- chronaxis/guide/en/fields/definitions/sources-all-33.json +209 -0
- chronaxis/guide/en/fields/definitions/sources-all-4.json +336 -0
- chronaxis/guide/en/fields/definitions/sources-all-5.json +299 -0
- chronaxis/guide/en/fields/definitions/sources-all-6.json +307 -0
- chronaxis/guide/en/fields/definitions/sources-all-7.json +320 -0
- chronaxis/guide/en/fields/definitions/sources-all-8.json +303 -0
- chronaxis/guide/en/fields/definitions/sources-all-9.json +315 -0
- chronaxis/guide/en/fields/index.json +3450 -0
- chronaxis/guide/en/fields/mapping/aliases-all-1.json +91 -0
- chronaxis/guide/en/fields/mapping/analysis-all-1.json +382 -0
- chronaxis/guide/en/fields/mapping/analysis-all-10.json +301 -0
- chronaxis/guide/en/fields/mapping/analysis-all-11.json +312 -0
- chronaxis/guide/en/fields/mapping/analysis-all-12.json +311 -0
- chronaxis/guide/en/fields/mapping/analysis-all-13.json +314 -0
- chronaxis/guide/en/fields/mapping/analysis-all-14.json +310 -0
- chronaxis/guide/en/fields/mapping/analysis-all-15.json +297 -0
- chronaxis/guide/en/fields/mapping/analysis-all-16.json +226 -0
- chronaxis/guide/en/fields/mapping/analysis-all-17.json +230 -0
- chronaxis/guide/en/fields/mapping/analysis-all-18.json +227 -0
- chronaxis/guide/en/fields/mapping/analysis-all-19.json +230 -0
- chronaxis/guide/en/fields/mapping/analysis-all-2.json +323 -0
- chronaxis/guide/en/fields/mapping/analysis-all-20.json +221 -0
- chronaxis/guide/en/fields/mapping/analysis-all-21.json +237 -0
- chronaxis/guide/en/fields/mapping/analysis-all-22.json +233 -0
- chronaxis/guide/en/fields/mapping/analysis-all-23.json +222 -0
- chronaxis/guide/en/fields/mapping/analysis-all-24.json +231 -0
- chronaxis/guide/en/fields/mapping/analysis-all-25.json +225 -0
- chronaxis/guide/en/fields/mapping/analysis-all-26.json +230 -0
- chronaxis/guide/en/fields/mapping/analysis-all-27.json +228 -0
- chronaxis/guide/en/fields/mapping/analysis-all-28.json +230 -0
- chronaxis/guide/en/fields/mapping/analysis-all-29.json +223 -0
- chronaxis/guide/en/fields/mapping/analysis-all-3.json +318 -0
- chronaxis/guide/en/fields/mapping/analysis-all-30.json +233 -0
- chronaxis/guide/en/fields/mapping/analysis-all-31.json +218 -0
- chronaxis/guide/en/fields/mapping/analysis-all-32.json +239 -0
- chronaxis/guide/en/fields/mapping/analysis-all-33.json +233 -0
- chronaxis/guide/en/fields/mapping/analysis-all-34.json +225 -0
- chronaxis/guide/en/fields/mapping/analysis-all-35.json +228 -0
- chronaxis/guide/en/fields/mapping/analysis-all-36.json +226 -0
- chronaxis/guide/en/fields/mapping/analysis-all-37.json +244 -0
- chronaxis/guide/en/fields/mapping/analysis-all-38.json +326 -0
- chronaxis/guide/en/fields/mapping/analysis-all-39.json +299 -0
- chronaxis/guide/en/fields/mapping/analysis-all-4.json +297 -0
- chronaxis/guide/en/fields/mapping/analysis-all-40.json +311 -0
- chronaxis/guide/en/fields/mapping/analysis-all-41.json +310 -0
- chronaxis/guide/en/fields/mapping/analysis-all-42.json +346 -0
- chronaxis/guide/en/fields/mapping/analysis-all-43.json +267 -0
- chronaxis/guide/en/fields/mapping/analysis-all-44.json +327 -0
- chronaxis/guide/en/fields/mapping/analysis-all-45.json +279 -0
- chronaxis/guide/en/fields/mapping/analysis-all-46.json +327 -0
- chronaxis/guide/en/fields/mapping/analysis-all-47.json +312 -0
- chronaxis/guide/en/fields/mapping/analysis-all-48.json +294 -0
- chronaxis/guide/en/fields/mapping/analysis-all-49.json +253 -0
- chronaxis/guide/en/fields/mapping/analysis-all-5.json +312 -0
- chronaxis/guide/en/fields/mapping/analysis-all-50.json +346 -0
- chronaxis/guide/en/fields/mapping/analysis-all-51.json +324 -0
- chronaxis/guide/en/fields/mapping/analysis-all-52.json +335 -0
- chronaxis/guide/en/fields/mapping/analysis-all-53.json +317 -0
- chronaxis/guide/en/fields/mapping/analysis-all-54.json +316 -0
- chronaxis/guide/en/fields/mapping/analysis-all-55.json +302 -0
- chronaxis/guide/en/fields/mapping/analysis-all-56.json +319 -0
- chronaxis/guide/en/fields/mapping/analysis-all-57.json +334 -0
- chronaxis/guide/en/fields/mapping/analysis-all-58.json +333 -0
- chronaxis/guide/en/fields/mapping/analysis-all-59.json +359 -0
- chronaxis/guide/en/fields/mapping/analysis-all-6.json +327 -0
- chronaxis/guide/en/fields/mapping/analysis-all-60.json +303 -0
- chronaxis/guide/en/fields/mapping/analysis-all-61.json +326 -0
- chronaxis/guide/en/fields/mapping/analysis-all-62.json +301 -0
- chronaxis/guide/en/fields/mapping/analysis-all-63.json +326 -0
- chronaxis/guide/en/fields/mapping/analysis-all-64.json +367 -0
- chronaxis/guide/en/fields/mapping/analysis-all-65.json +334 -0
- chronaxis/guide/en/fields/mapping/analysis-all-66.json +358 -0
- chronaxis/guide/en/fields/mapping/analysis-all-67.json +349 -0
- chronaxis/guide/en/fields/mapping/analysis-all-68.json +331 -0
- chronaxis/guide/en/fields/mapping/analysis-all-69.json +304 -0
- chronaxis/guide/en/fields/mapping/analysis-all-7.json +303 -0
- chronaxis/guide/en/fields/mapping/analysis-all-70.json +349 -0
- chronaxis/guide/en/fields/mapping/analysis-all-71.json +288 -0
- chronaxis/guide/en/fields/mapping/analysis-all-72.json +316 -0
- chronaxis/guide/en/fields/mapping/analysis-all-73.json +266 -0
- chronaxis/guide/en/fields/mapping/analysis-all-74.json +227 -0
- chronaxis/guide/en/fields/mapping/analysis-all-75.json +239 -0
- chronaxis/guide/en/fields/mapping/analysis-all-76.json +274 -0
- chronaxis/guide/en/fields/mapping/analysis-all-77.json +380 -0
- chronaxis/guide/en/fields/mapping/analysis-all-78.json +313 -0
- chronaxis/guide/en/fields/mapping/analysis-all-79.json +338 -0
- chronaxis/guide/en/fields/mapping/analysis-all-8.json +292 -0
- chronaxis/guide/en/fields/mapping/analysis-all-80.json +304 -0
- chronaxis/guide/en/fields/mapping/analysis-all-81.json +140 -0
- chronaxis/guide/en/fields/mapping/analysis-all-9.json +332 -0
- chronaxis/guide/en/fields/mapping/io_policy-all-1.json +19 -0
- chronaxis/guide/en/fields/mapping/mapping_version-all-1.json +19 -0
- chronaxis/guide/en/fields/mapping/path_base-all-1.json +19 -0
- chronaxis/guide/en/fields/mapping/sections-all-1.json +402 -0
- chronaxis/guide/en/fields/mapping/sections-all-2.json +232 -0
- chronaxis/guide/en/semantics.md +70 -0
- chronaxis/guide/en/tasks.json +290 -0
- chronaxis/guide/en/workflow.md +41 -0
- chronaxis/guide/examples/analysis-imports.yaml +22 -0
- chronaxis/guide/examples/analysis.yaml +23 -0
- chronaxis/guide/examples/batch-minimal.yaml +3 -0
- chronaxis/guide/examples/conditional-energy.yaml +36 -0
- chronaxis/guide/examples/data/activity.csv +6 -0
- chronaxis/guide/examples/data/can/activity.asc +11 -0
- chronaxis/guide/examples/data/can/calculation-minimal.asc +6 -0
- chronaxis/guide/examples/data/can/conditional-energy/part-1.asc +92 -0
- chronaxis/guide/examples/data/can/conditional-energy/part-2.asc +36 -0
- chronaxis/guide/examples/data/can/conditional-energy/signals.dbc +10 -0
- chronaxis/guide/examples/data/can/execution-comparison.asc +12 -0
- chronaxis/guide/examples/data/can/execution-report.asc +4 -0
- chronaxis/guide/examples/data/can/expression-extended.asc +11 -0
- chronaxis/guide/examples/data/can/interval-actual.asc +6 -0
- chronaxis/guide/examples/data/can/preset-charge-energy.asc +15 -0
- chronaxis/guide/examples/data/can/preset-charge-minimal.asc +11 -0
- chronaxis/guide/examples/data/can/preset-command-automatic.asc +11 -0
- chronaxis/guide/examples/data/can/preset-fault-context.asc +7 -0
- chronaxis/guide/examples/data/can/preset-threshold-delay.asc +7 -0
- chronaxis/guide/examples/data/can/preset-threshold-partial.asc +7 -0
- chronaxis/guide/examples/data/can/quality.asc +6 -0
- chronaxis/guide/examples/data/can/quickstart-parts/part1.asc +4 -0
- chronaxis/guide/examples/data/can/quickstart-parts/part2.asc +3 -0
- chronaxis/guide/examples/data/can/quickstart.asc +6 -0
- chronaxis/guide/examples/data/can/rule-condition_duration-extended.asc +35 -0
- chronaxis/guide/examples/data/can/rule-condition_duration-minimal.asc +19 -0
- chronaxis/guide/examples/data/can/rule-debounce-extended.asc +19 -0
- chronaxis/guide/examples/data/can/rule-falling_edge-extended.asc +35 -0
- chronaxis/guide/examples/data/can/rule-hysteresis-extended.asc +19 -0
- chronaxis/guide/examples/data/can/rule-start_end-extended.asc +35 -0
- chronaxis/guide/examples/data/can/rule-start_only-extended.asc +19 -0
- chronaxis/guide/examples/data/can/rule-window_delta-extended.asc +19 -0
- chronaxis/guide/examples/data/can/sequence-outcomes.asc +19 -0
- chronaxis/guide/examples/data/can/signal-types.asc +13 -0
- chronaxis/guide/examples/data/can/start-end.asc +30 -0
- chronaxis/guide/examples/data/can/teaching-base.asc +58 -0
- chronaxis/guide/examples/data/can/teaching.dbc +53 -0
- chronaxis/guide/examples/data/joint-current.csv +5 -0
- chronaxis/guide/examples/data/joint.asc +5 -0
- chronaxis/guide/examples/data/joint.dbc +7 -0
- chronaxis/guide/examples/data/message-clean.asc +6 -0
- chronaxis/guide/examples/data/message-direction.asc +7 -0
- chronaxis/guide/examples/data/message-direction.dbc +7 -0
- chronaxis/guide/examples/data/power.blf +0 -0
- chronaxis/guide/examples/data/power.dbc +6 -0
- chronaxis/guide/examples/data/quality.csv +5 -0
- chronaxis/guide/examples/data/raw-can-example.csv +5 -0
- chronaxis/guide/examples/data/signal-types.csv +5 -0
- chronaxis/guide/examples/data/signals.csv +6 -0
- chronaxis/guide/examples/data/timing.asc +6 -0
- chronaxis/guide/examples/data/timing.dbc +11 -0
- chronaxis/guide/examples/export-can-minimal.yaml +24 -0
- chronaxis/guide/examples/input-csv-minimal.yaml +23 -0
- chronaxis/guide/examples/preset-charge-energy.yaml +41 -0
- chronaxis/guide/examples/preset-charge-minimal.yaml +31 -0
- chronaxis/guide/examples/preset-fault-context.yaml +27 -0
- chronaxis/guide/examples/quality.yaml +19 -0
- chronaxis/guide/examples/sequence-outcomes.yaml +39 -0
- chronaxis/guide/examples/shared/definitions.yaml +14 -0
- chronaxis/guide/examples/signal-enum-minimal.yaml +19 -0
- chronaxis/guide/examples/signal-number-conversion.yaml +24 -0
- chronaxis/guide/examples/window-merged.yaml +28 -0
- chronaxis/guide/fields/analysis/calculations-all-1.json +360 -0
- chronaxis/guide/fields/analysis/calculations-all-2.json +299 -0
- chronaxis/guide/fields/analysis/calculations-all-3.json +70 -0
- chronaxis/guide/fields/analysis/config_version-all-1.json +24 -0
- chronaxis/guide/fields/analysis/dataset-all-1.json +344 -0
- chronaxis/guide/fields/analysis/derived-all-1.json +147 -0
- chronaxis/guide/fields/analysis/diagnostics-all-1.json +69 -0
- chronaxis/guide/fields/analysis/execution-all-1.json +167 -0
- chronaxis/guide/fields/analysis/imports-all-1.json +39 -0
- chronaxis/guide/fields/analysis/intervals-all-1.json +173 -0
- chronaxis/guide/fields/analysis/message_calculations-all-1.json +360 -0
- chronaxis/guide/fields/analysis/message_calculations-all-2.json +255 -0
- chronaxis/guide/fields/analysis/metadata-all-1.json +24 -0
- chronaxis/guide/fields/analysis/outputs-all-1.json +349 -0
- chronaxis/guide/fields/analysis/outputs-all-2.json +302 -0
- chronaxis/guide/fields/analysis/outputs-all-3.json +321 -0
- chronaxis/guide/fields/analysis/outputs-all-4.json +253 -0
- chronaxis/guide/fields/analysis/outputs-all-5.json +244 -0
- chronaxis/guide/fields/analysis/outputs-all-6.json +199 -0
- chronaxis/guide/fields/analysis/overrides-all-1.json +104 -0
- chronaxis/guide/fields/analysis/presets-charge_session-1.json +398 -0
- chronaxis/guide/fields/analysis/presets-charge_session-2.json +114 -0
- chronaxis/guide/fields/analysis/presets-command_response-1.json +376 -0
- chronaxis/guide/fields/analysis/presets-fault_context-1.json +285 -0
- chronaxis/guide/fields/analysis/presets-threshold_excursion-1.json +317 -0
- chronaxis/guide/fields/analysis/rules-condition_duration-1.json +344 -0
- chronaxis/guide/fields/analysis/rules-condition_duration-2.json +27 -0
- chronaxis/guide/fields/analysis/rules-debounce-1.json +335 -0
- chronaxis/guide/fields/analysis/rules-falling_edge-1.json +317 -0
- chronaxis/guide/fields/analysis/rules-hysteresis-1.json +334 -0
- chronaxis/guide/fields/analysis/rules-hysteresis-2.json +27 -0
- chronaxis/guide/fields/analysis/rules-rising_edge-1.json +317 -0
- chronaxis/guide/fields/analysis/rules-start_end-1.json +349 -0
- chronaxis/guide/fields/analysis/rules-start_end-2.json +44 -0
- chronaxis/guide/fields/analysis/rules-start_only-1.json +334 -0
- chronaxis/guide/fields/analysis/rules-window_delta-1.json +356 -0
- chronaxis/guide/fields/analysis/rules-window_delta-2.json +78 -0
- chronaxis/guide/fields/analysis/sequences-all-1.json +394 -0
- chronaxis/guide/fields/analysis/sequences-all-2.json +54 -0
- chronaxis/guide/fields/analysis/signals-variant-1-1.json +349 -0
- chronaxis/guide/fields/analysis/signals-variant-1-2.json +297 -0
- chronaxis/guide/fields/analysis/signals-variant-1-3.json +340 -0
- chronaxis/guide/fields/analysis/signals-variant-1-4.json +175 -0
- chronaxis/guide/fields/analysis/signals-variant-2-1.json +327 -0
- chronaxis/guide/fields/analysis/signals-variant-2-2.json +335 -0
- chronaxis/guide/fields/analysis/signals-variant-2-3.json +289 -0
- chronaxis/guide/fields/analysis/signals-variant-2-4.json +270 -0
- chronaxis/guide/fields/analysis/sources-can_asc-1.json +318 -0
- chronaxis/guide/fields/analysis/sources-can_asc-2.json +310 -0
- chronaxis/guide/fields/analysis/sources-can_asc-3.json +311 -0
- chronaxis/guide/fields/analysis/sources-can_asc-4.json +69 -0
- chronaxis/guide/fields/analysis/sources-can_blf-1.json +317 -0
- chronaxis/guide/fields/analysis/sources-can_blf-2.json +310 -0
- chronaxis/guide/fields/analysis/sources-can_blf-3.json +317 -0
- chronaxis/guide/fields/analysis/sources-memory-1.json +347 -0
- chronaxis/guide/fields/analysis/sources-memory-2.json +110 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-1.json +330 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-10.json +233 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-11.json +225 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-12.json +228 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-13.json +226 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-14.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-15.json +227 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-16.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-17.json +238 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-18.json +239 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-19.json +233 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-2.json +310 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-20.json +242 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-21.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-22.json +228 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-23.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-24.json +223 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-25.json +290 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-26.json +131 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-3.json +297 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-4.json +226 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-5.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-6.json +227 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-7.json +230 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-8.json +238 -0
- chronaxis/guide/fields/analysis/sources-raw_can_csv-9.json +239 -0
- chronaxis/guide/fields/analysis/sources-signal_csv-1.json +331 -0
- chronaxis/guide/fields/analysis/sources-signal_csv-2.json +327 -0
- chronaxis/guide/fields/analysis/sources-signal_csv-3.json +295 -0
- chronaxis/guide/fields/analysis/sources-variant-6-1.json +319 -0
- chronaxis/guide/fields/analysis/sources-variant-6-2.json +327 -0
- chronaxis/guide/fields/analysis/sources-variant-6-3.json +314 -0
- chronaxis/guide/fields/analysis/sources-variant-6-4.json +91 -0
- chronaxis/guide/fields/analysis/windows-all-1.json +361 -0
- chronaxis/guide/fields/analysis/windows-all-2.json +187 -0
- chronaxis/guide/fields/batch/backend-all-1.json +26 -0
- chronaxis/guide/fields/batch/batch_version-all-1.json +22 -0
- chronaxis/guide/fields/batch/fail_fast-all-1.json +22 -0
- chronaxis/guide/fields/batch/inputs-all-1.json +161 -0
- chronaxis/guide/fields/batch/jobs-all-1.json +58 -0
- chronaxis/guide/fields/batch/process_count-all-1.json +23 -0
- chronaxis/guide/fields/batch/source-all-1.json +22 -0
- chronaxis/guide/fields/batch/template-all-1.json +22 -0
- chronaxis/guide/fields/definitions/derived-all-1.json +121 -0
- chronaxis/guide/fields/definitions/signals-all-1.json +336 -0
- chronaxis/guide/fields/definitions/signals-all-2.json +307 -0
- chronaxis/guide/fields/definitions/signals-all-3.json +305 -0
- chronaxis/guide/fields/definitions/signals-all-4.json +352 -0
- chronaxis/guide/fields/definitions/signals-all-5.json +311 -0
- chronaxis/guide/fields/definitions/signals-all-6.json +254 -0
- chronaxis/guide/fields/definitions/signals-all-7.json +88 -0
- chronaxis/guide/fields/definitions/sources-all-1.json +332 -0
- chronaxis/guide/fields/definitions/sources-all-10.json +307 -0
- chronaxis/guide/fields/definitions/sources-all-11.json +280 -0
- chronaxis/guide/fields/definitions/sources-all-12.json +209 -0
- chronaxis/guide/fields/definitions/sources-all-13.json +219 -0
- chronaxis/guide/fields/definitions/sources-all-14.json +213 -0
- chronaxis/guide/fields/definitions/sources-all-15.json +212 -0
- chronaxis/guide/fields/definitions/sources-all-16.json +232 -0
- chronaxis/guide/fields/definitions/sources-all-17.json +213 -0
- chronaxis/guide/fields/definitions/sources-all-18.json +212 -0
- chronaxis/guide/fields/definitions/sources-all-19.json +217 -0
- chronaxis/guide/fields/definitions/sources-all-2.json +336 -0
- chronaxis/guide/fields/definitions/sources-all-20.json +228 -0
- chronaxis/guide/fields/definitions/sources-all-21.json +212 -0
- chronaxis/guide/fields/definitions/sources-all-22.json +232 -0
- chronaxis/guide/fields/definitions/sources-all-23.json +213 -0
- chronaxis/guide/fields/definitions/sources-all-24.json +212 -0
- chronaxis/guide/fields/definitions/sources-all-25.json +217 -0
- chronaxis/guide/fields/definitions/sources-all-26.json +228 -0
- chronaxis/guide/fields/definitions/sources-all-27.json +212 -0
- chronaxis/guide/fields/definitions/sources-all-28.json +217 -0
- chronaxis/guide/fields/definitions/sources-all-29.json +227 -0
- chronaxis/guide/fields/definitions/sources-all-3.json +306 -0
- chronaxis/guide/fields/definitions/sources-all-30.json +333 -0
- chronaxis/guide/fields/definitions/sources-all-31.json +302 -0
- chronaxis/guide/fields/definitions/sources-all-32.json +319 -0
- chronaxis/guide/fields/definitions/sources-all-33.json +89 -0
- chronaxis/guide/fields/definitions/sources-all-4.json +336 -0
- chronaxis/guide/fields/definitions/sources-all-5.json +313 -0
- chronaxis/guide/fields/definitions/sources-all-6.json +292 -0
- chronaxis/guide/fields/definitions/sources-all-7.json +319 -0
- chronaxis/guide/fields/definitions/sources-all-8.json +315 -0
- chronaxis/guide/fields/definitions/sources-all-9.json +318 -0
- chronaxis/guide/fields/index.json +3432 -0
- chronaxis/guide/fields/mapping/aliases-all-1.json +91 -0
- chronaxis/guide/fields/mapping/analysis-all-1.json +382 -0
- chronaxis/guide/fields/mapping/analysis-all-10.json +307 -0
- chronaxis/guide/fields/mapping/analysis-all-11.json +311 -0
- chronaxis/guide/fields/mapping/analysis-all-12.json +329 -0
- chronaxis/guide/fields/mapping/analysis-all-13.json +294 -0
- chronaxis/guide/fields/mapping/analysis-all-14.json +311 -0
- chronaxis/guide/fields/mapping/analysis-all-15.json +280 -0
- chronaxis/guide/fields/mapping/analysis-all-16.json +227 -0
- chronaxis/guide/fields/mapping/analysis-all-17.json +230 -0
- chronaxis/guide/fields/mapping/analysis-all-18.json +221 -0
- chronaxis/guide/fields/mapping/analysis-all-19.json +237 -0
- chronaxis/guide/fields/mapping/analysis-all-2.json +342 -0
- chronaxis/guide/fields/mapping/analysis-all-20.json +233 -0
- chronaxis/guide/fields/mapping/analysis-all-21.json +244 -0
- chronaxis/guide/fields/mapping/analysis-all-22.json +228 -0
- chronaxis/guide/fields/mapping/analysis-all-23.json +226 -0
- chronaxis/guide/fields/mapping/analysis-all-24.json +230 -0
- chronaxis/guide/fields/mapping/analysis-all-25.json +227 -0
- chronaxis/guide/fields/mapping/analysis-all-26.json +230 -0
- chronaxis/guide/fields/mapping/analysis-all-27.json +221 -0
- chronaxis/guide/fields/mapping/analysis-all-28.json +237 -0
- chronaxis/guide/fields/mapping/analysis-all-29.json +233 -0
- chronaxis/guide/fields/mapping/analysis-all-3.json +322 -0
- chronaxis/guide/fields/mapping/analysis-all-30.json +244 -0
- chronaxis/guide/fields/mapping/analysis-all-31.json +228 -0
- chronaxis/guide/fields/mapping/analysis-all-32.json +226 -0
- chronaxis/guide/fields/mapping/analysis-all-33.json +230 -0
- chronaxis/guide/fields/mapping/analysis-all-34.json +227 -0
- chronaxis/guide/fields/mapping/analysis-all-35.json +230 -0
- chronaxis/guide/fields/mapping/analysis-all-36.json +221 -0
- chronaxis/guide/fields/mapping/analysis-all-37.json +291 -0
- chronaxis/guide/fields/mapping/analysis-all-38.json +315 -0
- chronaxis/guide/fields/mapping/analysis-all-39.json +304 -0
- chronaxis/guide/fields/mapping/analysis-all-4.json +312 -0
- chronaxis/guide/fields/mapping/analysis-all-40.json +307 -0
- chronaxis/guide/fields/mapping/analysis-all-41.json +292 -0
- chronaxis/guide/fields/mapping/analysis-all-42.json +333 -0
- chronaxis/guide/fields/mapping/analysis-all-43.json +296 -0
- chronaxis/guide/fields/mapping/analysis-all-44.json +322 -0
- chronaxis/guide/fields/mapping/analysis-all-45.json +298 -0
- chronaxis/guide/fields/mapping/analysis-all-46.json +347 -0
- chronaxis/guide/fields/mapping/analysis-all-47.json +302 -0
- chronaxis/guide/fields/mapping/analysis-all-48.json +263 -0
- chronaxis/guide/fields/mapping/analysis-all-49.json +301 -0
- chronaxis/guide/fields/mapping/analysis-all-5.json +313 -0
- chronaxis/guide/fields/mapping/analysis-all-50.json +336 -0
- chronaxis/guide/fields/mapping/analysis-all-51.json +335 -0
- chronaxis/guide/fields/mapping/analysis-all-52.json +335 -0
- chronaxis/guide/fields/mapping/analysis-all-53.json +334 -0
- chronaxis/guide/fields/mapping/analysis-all-54.json +339 -0
- chronaxis/guide/fields/mapping/analysis-all-55.json +335 -0
- chronaxis/guide/fields/mapping/analysis-all-56.json +336 -0
- chronaxis/guide/fields/mapping/analysis-all-57.json +335 -0
- chronaxis/guide/fields/mapping/analysis-all-58.json +333 -0
- chronaxis/guide/fields/mapping/analysis-all-59.json +325 -0
- chronaxis/guide/fields/mapping/analysis-all-6.json +323 -0
- chronaxis/guide/fields/mapping/analysis-all-60.json +334 -0
- chronaxis/guide/fields/mapping/analysis-all-61.json +311 -0
- chronaxis/guide/fields/mapping/analysis-all-62.json +289 -0
- chronaxis/guide/fields/mapping/analysis-all-63.json +383 -0
- chronaxis/guide/fields/mapping/analysis-all-64.json +357 -0
- chronaxis/guide/fields/mapping/analysis-all-65.json +375 -0
- chronaxis/guide/fields/mapping/analysis-all-66.json +351 -0
- chronaxis/guide/fields/mapping/analysis-all-67.json +346 -0
- chronaxis/guide/fields/mapping/analysis-all-68.json +317 -0
- chronaxis/guide/fields/mapping/analysis-all-69.json +313 -0
- chronaxis/guide/fields/mapping/analysis-all-7.json +306 -0
- chronaxis/guide/fields/mapping/analysis-all-70.json +326 -0
- chronaxis/guide/fields/mapping/analysis-all-71.json +316 -0
- chronaxis/guide/fields/mapping/analysis-all-72.json +264 -0
- chronaxis/guide/fields/mapping/analysis-all-73.json +228 -0
- chronaxis/guide/fields/mapping/analysis-all-74.json +241 -0
- chronaxis/guide/fields/mapping/analysis-all-75.json +273 -0
- chronaxis/guide/fields/mapping/analysis-all-76.json +382 -0
- chronaxis/guide/fields/mapping/analysis-all-77.json +328 -0
- chronaxis/guide/fields/mapping/analysis-all-78.json +338 -0
- chronaxis/guide/fields/mapping/analysis-all-79.json +304 -0
- chronaxis/guide/fields/mapping/analysis-all-8.json +309 -0
- chronaxis/guide/fields/mapping/analysis-all-80.json +140 -0
- chronaxis/guide/fields/mapping/analysis-all-9.json +329 -0
- chronaxis/guide/fields/mapping/io_policy-all-1.json +19 -0
- chronaxis/guide/fields/mapping/mapping_version-all-1.json +19 -0
- chronaxis/guide/fields/mapping/path_base-all-1.json +19 -0
- chronaxis/guide/fields/mapping/sections-all-1.json +402 -0
- chronaxis/guide/fields/mapping/sections-all-2.json +232 -0
- chronaxis/guide/lookup.py +90 -0
- chronaxis/guide/manifest.json +614 -0
- chronaxis/guide/run_analysis.py +34 -0
- chronaxis/guide/schemas/analysis.schema.json +8451 -0
- chronaxis/guide/schemas/batch-v1.schema.json +172 -0
- chronaxis/guide/schemas/definitions.schema.json +29 -0
- chronaxis/guide/schemas/legacy-import-v1.schema.json +143 -0
- chronaxis/guide/semantics.md +62 -0
- chronaxis/guide/tasks.json +290 -0
- chronaxis/guide/workflow.md +38 -0
- chronaxis/legacy/__init__.py +46 -0
- chronaxis/legacy/batch_read.py +412 -0
- chronaxis/legacy/batch_validation.py +134 -0
- chronaxis/legacy/batch_wire.py +264 -0
- chronaxis/legacy/batch_worker.py +417 -0
- chronaxis/legacy/binding.py +154 -0
- chronaxis/legacy/dbc_cycles.py +47 -0
- chronaxis/legacy/decode_policy.py +28 -0
- chronaxis/legacy/disjunction.py +79 -0
- chronaxis/legacy/export_worker.py +147 -0
- chronaxis/legacy/export_write.py +378 -0
- chronaxis/legacy/message_store.py +562 -0
- chronaxis/legacy/process_read.py +526 -0
- chronaxis/legacy/raw_store.py +341 -0
- chronaxis/legacy/records.py +709 -0
- chronaxis/legacy/required_records.py +122 -0
- chronaxis/legacy/sum.py +403 -0
- chronaxis/legacy/sum_numpy.py +43 -0
- chronaxis/legacy/updates.py +277 -0
- chronaxis/legacy/vendor/sclicer_functions_v1/can_processor.py +138 -0
- chronaxis/legacy/vendor/sclicer_functions_v1/file_processor.py +218 -0
- chronaxis/legacy/vendor/sclicer_functions_v1/utils.py +447 -0
- chronaxis/legacy/worker.py +352 -0
- chronaxis/migration/__init__.py +11 -0
- chronaxis/migration/api.py +270 -0
- chronaxis/migration/ini.py +110 -0
- chronaxis/migration/legacy_sum.py +304 -0
- chronaxis/migration/models.py +83 -0
- chronaxis/migration/publication.py +230 -0
- chronaxis/migration/sclicer.py +241 -0
- chronaxis/migration/slope.py +78 -0
- chronaxis/migration/start_end.py +48 -0
- chronaxis/planning/__init__.py +19 -0
- chronaxis/planning/channels.py +30 -0
- chronaxis/planning/checks.py +447 -0
- chronaxis/planning/config_groups.py +215 -0
- chronaxis/planning/dbc_defaults.py +88 -0
- chronaxis/planning/export_options.py +247 -0
- chronaxis/planning/input_defaults.py +62 -0
- chronaxis/planning/input_paths.py +124 -0
- chronaxis/planning/input_requirements.py +250 -0
- chronaxis/planning/inputs.py +306 -0
- chronaxis/planning/intervals.py +242 -0
- chronaxis/planning/legacy_execution.py +38 -0
- chronaxis/planning/message_calculations.py +171 -0
- chronaxis/planning/models.py +369 -0
- chronaxis/planning/nodes.py +355 -0
- chronaxis/planning/plan.py +294 -0
- chronaxis/planning/preset_models.py +211 -0
- chronaxis/planning/record_execution.py +76 -0
- chronaxis/planning/reports.py +523 -0
- chronaxis/planning/sequences.py +91 -0
- chronaxis/planning/signal_groups.py +61 -0
- chronaxis/planning/signal_validity.py +46 -0
- chronaxis/planning/text_inputs.py +110 -0
- chronaxis/presets.py +270 -0
- chronaxis/results/__init__.py +34 -0
- chronaxis/results/analysis_outcome.py +67 -0
- chronaxis/results/artifact_exports.py +212 -0
- chronaxis/results/binding_metadata.py +54 -0
- chronaxis/results/budget.py +138 -0
- chronaxis/results/can_metadata.py +247 -0
- chronaxis/results/codec.py +246 -0
- chronaxis/results/errors.py +25 -0
- chronaxis/results/export_files.py +216 -0
- chronaxis/results/frame_exports.py +299 -0
- chronaxis/results/frame_patch.py +186 -0
- chronaxis/results/frame_rebuild.py +458 -0
- chronaxis/results/frame_sort.py +223 -0
- chronaxis/results/input_diagnostics.py +51 -0
- chronaxis/results/manifest.py +343 -0
- chronaxis/results/merge_runs.py +207 -0
- chronaxis/results/owned_directory.py +32 -0
- chronaxis/results/raw_exports.py +689 -0
- chronaxis/results/readable.py +355 -0
- chronaxis/results/readable_format.py +94 -0
- chronaxis/results/result.py +734 -0
- chronaxis/results/rows.py +57 -0
- chronaxis/results/signal_exports.py +209 -0
- chronaxis/results/signal_grid.py +219 -0
- chronaxis/results/spool.py +421 -0
- chronaxis/results/summary.py +350 -0
- chronaxis/results/text_can_metadata.py +64 -0
- chronaxis/results/threshold_metadata.py +105 -0
- chronaxis/runner.py +121 -0
- chronaxis/sources/__init__.py +23 -0
- chronaxis/sources/asc.py +412 -0
- chronaxis/sources/blf.py +101 -0
- chronaxis/sources/can_spec.py +179 -0
- chronaxis/sources/can_updates.py +160 -0
- chronaxis/sources/csv_spec.py +133 -0
- chronaxis/sources/descriptions.py +65 -0
- chronaxis/sources/memory.py +299 -0
- chronaxis/sources/models.py +497 -0
- chronaxis/sources/packing.py +170 -0
- chronaxis/sources/protocol.py +221 -0
- chronaxis/sources/raw_can.py +62 -0
- chronaxis/sources/raw_csv.py +470 -0
- chronaxis/sources/raw_csv_layout.py +310 -0
- chronaxis/sources/signal_csv.py +608 -0
- chronaxis/sources/text_can_decode.py +421 -0
- chronaxis/sources/text_can_ref.py +48 -0
- chronaxis/sources/text_can_spec.py +61 -0
- chronaxis/timebase/__init__.py +19 -0
- chronaxis/timebase/conversion.py +364 -0
- chronaxis/timebase/numpy_ops.py +104 -0
- chronaxis/user_guide.py +81 -0
- chronaxis-0.1.0.dev0.dist-info/METADATA +172 -0
- chronaxis-0.1.0.dev0.dist-info/RECORD +917 -0
- chronaxis-0.1.0.dev0.dist-info/WHEEL +5 -0
- chronaxis-0.1.0.dev0.dist-info/entry_points.txt +2 -0
- chronaxis-0.1.0.dev0.dist-info/licenses/LICENSE +21 -0
- chronaxis-0.1.0.dev0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
"""用有限记录计算时间统计和真实样本统计;仅时间均值暂存必要值/权重。
|
|
2
|
+
|
|
3
|
+
输入与RecordIntegral共享点缓冲、递增时间和失效处理。复用原时间/样本数值核;
|
|
4
|
+
样本统计保真实更新标志,不把条件/TTL更新当新样本,样本均值使用原序求和。
|
|
5
|
+
均值首遍仅写值与权重,实际权重为int64纳秒,周期权重为float秒;
|
|
6
|
+
次遍按已知总权重规范化,避免先求面积溢出。
|
|
7
|
+
临时文件由本owner关闭时删除,不默认留现场;结果不附历史、贡献或时间对照。
|
|
8
|
+
调用者必须先确认来源EOF及关闭成功再finish,本对象不替代公共AnalysisRunner发布。
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from dataclasses import dataclass
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from struct import Struct
|
|
14
|
+
from tempfile import TemporaryFile
|
|
15
|
+
|
|
16
|
+
import numpy as np
|
|
17
|
+
|
|
18
|
+
from ..core.calculations import CalculationDefinition, CalculationSeries, classify_calculation_value
|
|
19
|
+
from ..core.calculations import classify_coverage
|
|
20
|
+
from ..core.models import Interval
|
|
21
|
+
from ..core.types import SignalDType as D, QualityFlag as Q
|
|
22
|
+
from ..core.time_reduction import require_time_config, TimeReductionResult
|
|
23
|
+
from ..core.time_reduction_reference import ReferenceTimeReduction
|
|
24
|
+
from ..core.time_reduction_numpy import NumpyTimeReduction
|
|
25
|
+
from ..core.conditional_time_reduction_reference import ReferenceConditionalTimeReduction
|
|
26
|
+
from ..core.conditional_time_reduction_numpy import NumpyConditionalTimeReduction
|
|
27
|
+
from ..core.integral_sum_reference import ReferenceIntegralSum
|
|
28
|
+
from ..core.integral_sum_numpy import NumpyIntegralSum
|
|
29
|
+
from ..core.mean_weights_reference import normalized_mean_terms as reference_mean
|
|
30
|
+
from ..core.mean_weights_numpy import normalized_mean_terms as numpy_mean
|
|
31
|
+
from ..results.budget import ResourceBudget, _reserve_owned_ram, _release_owned_ram, _cleanup_owner
|
|
32
|
+
from ..results.errors import BudgetExceededError
|
|
33
|
+
from .history import _metadata_bytes
|
|
34
|
+
from .record_point_buffer import RecordPointBuffer
|
|
35
|
+
from ..core.sample_reduction import require_sample_config
|
|
36
|
+
from ..core.sample_reduction_reference import ReferenceSampleReduction
|
|
37
|
+
from ..core.sample_reduction_numpy import NumpySampleReduction
|
|
38
|
+
from .record_sample_series import sample_series
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True)
|
|
42
|
+
class RecordTimeResult:
|
|
43
|
+
"""保存时间统计的必要输出,整数极值不转成浮点数。"""
|
|
44
|
+
|
|
45
|
+
value: int | float | None
|
|
46
|
+
unit: str
|
|
47
|
+
status: str
|
|
48
|
+
reason: str
|
|
49
|
+
quality: Q
|
|
50
|
+
coverage_status: str | None = None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class RecordTimeCalculation(RecordPointBuffer):
|
|
54
|
+
"""拥有一份点缓冲、数值状态及可选均值临时文件,失败后只能清理。"""
|
|
55
|
+
|
|
56
|
+
def __init__(self, budget, spec, input_unit, dtype, step_ns, *, backend='numpy',
|
|
57
|
+
batch_intervals=64, partial_limit=4096, conditioned=False, work_dir=None):
|
|
58
|
+
"""预付有限状态,均值的文件延迟到首批有效项才创建。
|
|
59
|
+
|
|
60
|
+
参数: 共享budget、时间统计spec、已求值类型/单位;step_ns为None实际差或正周期;
|
|
61
|
+
后端和批上限明确;
|
|
62
|
+
conditioned表示外BOOL条件,time_weighted_mean需要既存work_dir。
|
|
63
|
+
返回: 新owner。异常: 配置/预算失败;持续清理故障附record_time_cleanup_owner。
|
|
64
|
+
"""
|
|
65
|
+
if not isinstance(budget, ResourceBudget) or not isinstance(spec, CalculationDefinition):
|
|
66
|
+
raise TypeError('记录时间统计需要共享预算和CalculationDefinition')
|
|
67
|
+
if backend not in ('reference', 'numpy') or type(conditioned) is not bool:
|
|
68
|
+
raise ValueError('时间统计需要明确后端及bool条件开关')
|
|
69
|
+
if type(batch_intervals) is not int or not 1 <= batch_intervals <= 4096:
|
|
70
|
+
raise ValueError('记录批上限需要1到4096')
|
|
71
|
+
self._samples=spec.operation in ('sample_minimum','sample_maximum','sample_mean')
|
|
72
|
+
if self._samples:
|
|
73
|
+
if step_ns is not None:raise ValueError('样本统计不使用固定或DBC周期')
|
|
74
|
+
self._unit,self._factor=require_sample_config(spec,input_unit,dtype,partial_limit)
|
|
75
|
+
else:
|
|
76
|
+
self._unit, self._factor = require_time_config(spec, input_unit, dtype, None, partial_limit, step_ns=step_ns)
|
|
77
|
+
self._work_dir = None
|
|
78
|
+
if spec.operation == 'time_weighted_mean':
|
|
79
|
+
if work_dir is None or not Path(work_dir).is_dir():
|
|
80
|
+
raise ValueError('均值需要已存在的专用工作目录')
|
|
81
|
+
self._work_dir = Path(work_dir)
|
|
82
|
+
self._budget, self._spec, self._input_unit, self._dtype = budget, spec, input_unit, dtype
|
|
83
|
+
self._step_ns, self._limit, self._conditioned = step_ns, batch_intervals, conditioned
|
|
84
|
+
self._backend, self._partial_limit = backend, partial_limit
|
|
85
|
+
self._held_cost = self._fixed_cost = self._workspace_cost = 0
|
|
86
|
+
self._closed = self._closing = self._failed = self._finished = False
|
|
87
|
+
self._rows = self._reduction = self._result = self._file = self._mean_sum = None
|
|
88
|
+
self._last_time = None
|
|
89
|
+
self._covered_ns = self._known_ns = self._selected_ns = self._selected_unknown_ns = self._false_ns = 0
|
|
90
|
+
self._quality = Q.NONE
|
|
91
|
+
self._coverage_value_ns=0 if spec.minimum_coverage>0 else None
|
|
92
|
+
self._record_count = 0
|
|
93
|
+
self._codec = Struct('>dq' if step_ns is None else '>dd') # 仅值/权重,实际纳秒不降为浮点。
|
|
94
|
+
try:
|
|
95
|
+
_reserve_owned_ram(self, 65536 + partial_limit * 512 + (batch_intervals+1)*1024
|
|
96
|
+
+ 16*_metadata_bytes((spec, input_unit)), '_fixed_cost')
|
|
97
|
+
self._rows = []
|
|
98
|
+
kernel = ((ReferenceConditionalTimeReduction if backend == 'reference' else NumpyConditionalTimeReduction)
|
|
99
|
+
if conditioned else (ReferenceTimeReduction if backend == 'reference' else NumpyTimeReduction))
|
|
100
|
+
self._reduction = ((ReferenceSampleReduction if backend=='reference' else NumpySampleReduction)
|
|
101
|
+
(spec,input_unit,dtype,partial_limit=partial_limit) if self._samples else
|
|
102
|
+
kernel(spec, input_unit, dtype, step_ns=step_ns, partial_limit=partial_limit))
|
|
103
|
+
except BaseException as exc:
|
|
104
|
+
_cleanup_owner(self, exc, 'record_time_cleanup_owner', '记录时间统计')
|
|
105
|
+
raise
|
|
106
|
+
|
|
107
|
+
def _append_mean(self, values, weights):
|
|
108
|
+
"""只写本批选中的必要均值项;费用先预约,不缓存完整输入。
|
|
109
|
+
|
|
110
|
+
参数: 已由核校验的有限数值/权重。返回: None。异常: 配额、短写、IO或取消传播。
|
|
111
|
+
"""
|
|
112
|
+
if len(values) == 0:
|
|
113
|
+
return
|
|
114
|
+
if self._file is None:
|
|
115
|
+
self._file = TemporaryFile(mode='w+b', buffering=0, dir=self._work_dir, prefix='mean-')
|
|
116
|
+
payload = bytearray(len(values)*self._codec.size)
|
|
117
|
+
view = None
|
|
118
|
+
try:
|
|
119
|
+
for index, (value, weight) in enumerate(zip(values, weights)):
|
|
120
|
+
self._codec.pack_into(payload, index*self._codec.size, float(value),
|
|
121
|
+
int(weight) if self._step_ns is None else float(weight))
|
|
122
|
+
self._budget.reserve_spool(len(payload))
|
|
123
|
+
view = memoryview(payload)
|
|
124
|
+
position = 0
|
|
125
|
+
while position < len(view):
|
|
126
|
+
written = self._file.write(view[position:])
|
|
127
|
+
if type(written) is not int or not 0 < written <= len(view)-position:
|
|
128
|
+
raise OSError('均值暂存短写或无写入进展')
|
|
129
|
+
position += written
|
|
130
|
+
self._record_count += len(values)
|
|
131
|
+
finally:
|
|
132
|
+
if view is not None:
|
|
133
|
+
view.release()
|
|
134
|
+
values = weights = payload = view = None
|
|
135
|
+
|
|
136
|
+
def _flush(self):
|
|
137
|
+
"""在共享预算内分块处理样本统计,保留每块的共同右端。
|
|
138
|
+
|
|
139
|
+
参数: 无,使用已预付的点缓冲。返回: None。
|
|
140
|
+
异常: 最小两点工作区也放不下时报告计算项与用途;数值、取消原错传播。
|
|
141
|
+
不降低每行估算、不放宽限额,也不丢弃、重排或重复累计真实样本。
|
|
142
|
+
"""
|
|
143
|
+
if not self._samples:
|
|
144
|
+
return self._flush_block()
|
|
145
|
+
remaining = None
|
|
146
|
+
try:
|
|
147
|
+
while len(self._rows) >= 2:
|
|
148
|
+
# 读取队列和其他指标仍存活,不能假定本指标可独占整个预算。
|
|
149
|
+
# 系数沿用原样本核对最多两个TTL插入点的保守预付。
|
|
150
|
+
available = self._budget.memory_budget_bytes - self._budget.ram_bytes
|
|
151
|
+
count = min(len(self._rows), (available - 65536) // 36864)
|
|
152
|
+
if count < 2:
|
|
153
|
+
raise BudgetExceededError(
|
|
154
|
+
f'计算项 {self._spec.calculation_id}({self._spec.operation})'
|
|
155
|
+
f'样本统计工作区不足:最小两点需要139264字节,当前可用{available}字节;'
|
|
156
|
+
'已尝试按可用预算分块,请减少同时运行的计算项或读取批量,'
|
|
157
|
+
'核实必要状态后再调整memory_budget_bytes')
|
|
158
|
+
if count == len(self._rows):
|
|
159
|
+
self._flush_block()
|
|
160
|
+
break
|
|
161
|
+
# 两份短列表的引用槽由既有点缓冲1024字节/行覆盖;不复制值对象。
|
|
162
|
+
# 右端在前块半开范围内不计样本,下一块再作为左端处理一次。
|
|
163
|
+
remaining = self._rows[count - 1:]
|
|
164
|
+
self._rows = self._rows[:count]
|
|
165
|
+
self._flush_block()
|
|
166
|
+
self._rows, remaining = remaining, None
|
|
167
|
+
finally:
|
|
168
|
+
# 中途失败不能持有已退款缓冲以外的尾部引用;外层负责标失败并关闭。
|
|
169
|
+
remaining = None
|
|
170
|
+
|
|
171
|
+
def _flush_block(self):
|
|
172
|
+
"""计算完整记录对,只留共享右端;均值写选中项,其他指标不写盘。
|
|
173
|
+
|
|
174
|
+
参数: 无。返回: None。异常: 预算/数值结构/IO/取消,失败后不得交付前缀。
|
|
175
|
+
"""
|
|
176
|
+
if len(self._rows) < 2:
|
|
177
|
+
return
|
|
178
|
+
series = block = facts = None
|
|
179
|
+
primary = None
|
|
180
|
+
try:
|
|
181
|
+
_reserve_owned_ram(self, 65536 + len(self._rows)*(36864 if self._samples else 12288), '_workspace_cost')
|
|
182
|
+
times = tuple(row[0] for row in self._rows)
|
|
183
|
+
values = tuple(row[1] for row in self._rows)
|
|
184
|
+
deadlines = tuple(row[2] for row in self._rows) if any(row[2] is not None for row in self._rows) else None
|
|
185
|
+
conditions = tuple(row[3] for row in self._rows) if self._conditioned else None
|
|
186
|
+
options = {'condition_valid_until_ns': tuple(row[4] for row in self._rows)} if self._conditioned else {}
|
|
187
|
+
series = (sample_series(self._rows,self._input_unit,self._conditioned) if self._samples else
|
|
188
|
+
CalculationSeries(Interval(times[0], times[-1]), times, values, (True,)*len(times), self._input_unit, conditions=conditions))
|
|
189
|
+
mean = self._spec.operation == 'time_weighted_mean'
|
|
190
|
+
block = (self._reduction.push(series) if self._samples else
|
|
191
|
+
self._reduction.push(series, valid_until_ns=deadlines,
|
|
192
|
+
retain_unknown_ranges=False, retain_mean_terms=mean, **options))
|
|
193
|
+
facts = block.facts if mean else block
|
|
194
|
+
if self._coverage_value_ns is not None:
|
|
195
|
+
self._coverage_value_ns+=facts.value_valid_duration_ns
|
|
196
|
+
if mean:
|
|
197
|
+
self._append_mean(block.values, block.weights)
|
|
198
|
+
span = 0 if facts.actual_window is None else facts.actual_window.end_ns-facts.actual_window.start_ns
|
|
199
|
+
self._covered_ns += span
|
|
200
|
+
self._known_ns += facts.condition_known_duration_ns if self._conditioned else span
|
|
201
|
+
self._selected_ns += facts.selected_duration_ns
|
|
202
|
+
self._selected_unknown_ns += facts.selected_value_unknown_duration_ns if self._conditioned else span-facts.value_valid_duration_ns
|
|
203
|
+
if self._conditioned:
|
|
204
|
+
self._false_ns += facts.false_duration_ns
|
|
205
|
+
self._quality |= facts.quality
|
|
206
|
+
self._rows[:] = self._rows[-1:]
|
|
207
|
+
except BaseException as exc:
|
|
208
|
+
primary, self._failed = exc, True
|
|
209
|
+
raise
|
|
210
|
+
finally:
|
|
211
|
+
series = block = facts = times = values = deadlines = conditions = options = None
|
|
212
|
+
try:
|
|
213
|
+
_release_owned_ram(self, self._workspace_cost, '_workspace_cost')
|
|
214
|
+
except BaseException as cleanup:
|
|
215
|
+
self._failed = True
|
|
216
|
+
if primary is None:
|
|
217
|
+
raise
|
|
218
|
+
primary.add_note('时间统计临时费用释放失败:'+type(cleanup).__name__)
|
|
219
|
+
|
|
220
|
+
def _finish_mean(self):
|
|
221
|
+
"""分批回读必要数值/权重,复用原归一化及原序求和,最终只换单位一次。
|
|
222
|
+
|
|
223
|
+
参数: 无。返回: TimeReductionResult。异常: 临时数据短缺/多出、IO、预算或取消。
|
|
224
|
+
"""
|
|
225
|
+
if self._record_count == 0:
|
|
226
|
+
return TimeReductionResult(None, self._unit, False, Q.NONE, 0)
|
|
227
|
+
denominator = (self._reduction.selected_duration_ns if self._step_ns is None
|
|
228
|
+
else self._reduction.selected_weight_seconds)
|
|
229
|
+
self._file.seek(0)
|
|
230
|
+
self._mean_sum = (ReferenceIntegralSum if self._backend == 'reference' else NumpyIntegralSum)(self._partial_limit)
|
|
231
|
+
remaining, quality = self._record_count, Q.NONE
|
|
232
|
+
payload = pairs = values = weights = terms = keep = None
|
|
233
|
+
try:
|
|
234
|
+
while remaining:
|
|
235
|
+
count = min(remaining, self._limit)
|
|
236
|
+
payload = self._file.read(count*self._codec.size)
|
|
237
|
+
if len(payload) != count*self._codec.size:
|
|
238
|
+
raise ValueError('均值必要暂存数据不完整')
|
|
239
|
+
if self._backend == 'reference':
|
|
240
|
+
pairs = tuple(self._codec.iter_unpack(payload))
|
|
241
|
+
values, weights = tuple(item[0] for item in pairs), tuple(item[1] for item in pairs)
|
|
242
|
+
terms, failure = reference_mean(values, weights, denominator)
|
|
243
|
+
keep = (True,)*len(terms)
|
|
244
|
+
else:
|
|
245
|
+
pairs = np.frombuffer(payload, dtype=[('value', '>f8'),
|
|
246
|
+
('weight', '>i8' if self._step_ns is None else '>f8')])
|
|
247
|
+
values, weights = pairs['value'], pairs['weight']
|
|
248
|
+
terms, failure = numpy_mean(values, weights, denominator)
|
|
249
|
+
keep = np.ones(len(terms), dtype=bool)
|
|
250
|
+
keep.setflags(write=False)
|
|
251
|
+
quality |= failure
|
|
252
|
+
if quality == Q.NONE:
|
|
253
|
+
self._mean_sum.push_values(terms, keep)
|
|
254
|
+
remaining -= count
|
|
255
|
+
if self._file.read(1):
|
|
256
|
+
raise ValueError('均值必要暂存含未登记数据')
|
|
257
|
+
if quality != Q.NONE:
|
|
258
|
+
return TimeReductionResult(None, self._unit, True, quality, self._record_count)
|
|
259
|
+
number = self._mean_sum.finish(self._unit, self._factor)
|
|
260
|
+
return TimeReductionResult(number.value, number.unit, number.calculation_failed, number.quality, self._record_count)
|
|
261
|
+
finally:
|
|
262
|
+
payload = pairs = values = weights = terms = keep = None
|
|
263
|
+
|
|
264
|
+
def finish(self):
|
|
265
|
+
"""上游确认EOF后结算,并关闭删除均值临时文件,再交付精简结果。
|
|
266
|
+
|
|
267
|
+
参数: 无。返回: RecordTimeResult,重复调用同一结果。异常: 失败拒绝前缀,close可重试。
|
|
268
|
+
"""
|
|
269
|
+
self._require_open()
|
|
270
|
+
if self._finished:
|
|
271
|
+
return self._result
|
|
272
|
+
primary = None
|
|
273
|
+
try:
|
|
274
|
+
self._flush()
|
|
275
|
+
workspace = 65536 + (self._limit+1)*12288 if self._spec.operation == 'time_weighted_mean' else 4096
|
|
276
|
+
_reserve_owned_ram(self, workspace, '_workspace_cost')
|
|
277
|
+
number = self._finish_mean() if self._spec.operation == 'time_weighted_mean' else self._reduction.finish()
|
|
278
|
+
value, status, reason = classify_calculation_value(self._spec, number.value, self._covered_ns,
|
|
279
|
+
self._known_ns, self._selected_ns, self._selected_unknown_ns,
|
|
280
|
+
all_false=self._conditioned and self._covered_ns>0 and self._false_ns==self._covered_ns,
|
|
281
|
+
calculation_failed=number.calculation_failed)
|
|
282
|
+
if self._file is not None:
|
|
283
|
+
self._file.close()
|
|
284
|
+
self._file = None
|
|
285
|
+
coverage=None if self._coverage_value_ns is None else classify_coverage(
|
|
286
|
+
self._spec,self._covered_ns,self._coverage_value_ns,self._known_ns)
|
|
287
|
+
self._result = RecordTimeResult(value, self._unit, status, reason, self._quality | number.quality,coverage)
|
|
288
|
+
self._finished = True
|
|
289
|
+
return self._result
|
|
290
|
+
except BaseException as exc:
|
|
291
|
+
primary, self._failed = exc, True
|
|
292
|
+
raise
|
|
293
|
+
finally:
|
|
294
|
+
number = None
|
|
295
|
+
try:
|
|
296
|
+
_release_owned_ram(self, self._workspace_cost, '_workspace_cost')
|
|
297
|
+
except BaseException as cleanup:
|
|
298
|
+
self._failed = True
|
|
299
|
+
if primary is None:
|
|
300
|
+
raise
|
|
301
|
+
primary.add_note('时间统计结算费用释放失败:'+type(cleanup).__name__)
|
|
302
|
+
|
|
303
|
+
@property
|
|
304
|
+
def closed(self):
|
|
305
|
+
"""读取自有文件/费用是否全部释放。参数: 无。返回: bool。异常: 无。"""
|
|
306
|
+
return self._closed
|
|
307
|
+
|
|
308
|
+
def close(self):
|
|
309
|
+
"""清理自有数值状态和临时文件,释放失败保留重试入口,不碰输入文件。
|
|
310
|
+
|
|
311
|
+
参数: 无。返回: None。异常: 文件关闭/费用释放失败可重试;重复关闭安全。
|
|
312
|
+
"""
|
|
313
|
+
if self._closed:
|
|
314
|
+
return
|
|
315
|
+
self._closing = True
|
|
316
|
+
self._rows = self._reduction = self._mean_sum = self._result = None
|
|
317
|
+
if self._file is not None:
|
|
318
|
+
self._file.close()
|
|
319
|
+
self._file = None
|
|
320
|
+
_release_owned_ram(self, self._workspace_cost, '_workspace_cost')
|
|
321
|
+
_release_owned_ram(self, self._fixed_cost, '_fixed_cost')
|
|
322
|
+
self._closed = True
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""只为周期选窗/事件时长保存一份所需驱动时刻,按索引定位。
|
|
2
|
+
|
|
3
|
+
每条只写一个实际整数时间;偏移只在单次查询中按记录索引计算,不保存改写时间轴。
|
|
4
|
+
"""
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
from struct import Struct
|
|
7
|
+
from tempfile import TemporaryFile
|
|
8
|
+
from ..results.errors import ResultClosedError
|
|
9
|
+
from ..results.spool import _reserve_owned_ram,_release_owned_ram,_cleanup_owner
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RecordTimeIndexes:
|
|
13
|
+
"""拥有各必要驱动的一份定长时间文件,所有消费者借用。"""
|
|
14
|
+
|
|
15
|
+
def __init__(self,budget,path,drivers):
|
|
16
|
+
"""预付有限索引状态。参数: 预算/私有路径/唯一驱动名称。返回: owner。异常: 原构造错。"""
|
|
17
|
+
self._budget,self._path=budget,path
|
|
18
|
+
self._files={}
|
|
19
|
+
self._counts={}
|
|
20
|
+
self._last={}
|
|
21
|
+
self._held_cost=self._fixed_cost=0
|
|
22
|
+
self._closed=False
|
|
23
|
+
self._codec=Struct('>q')
|
|
24
|
+
try:
|
|
25
|
+
_reserve_owned_ram(self,65536+len(drivers)*32768,'_fixed_cost')
|
|
26
|
+
self._counts=dict.fromkeys(drivers,0)
|
|
27
|
+
self._last=dict.fromkeys(drivers)
|
|
28
|
+
except BaseException as error:
|
|
29
|
+
_cleanup_owner(self,error,'record_time_indexes_cleanup_owner','必要驱动索引构造')
|
|
30
|
+
raise
|
|
31
|
+
|
|
32
|
+
def observe_group(self,group):
|
|
33
|
+
"""每驱动每实际同刻组只写一次。参数: 完整组。返回: None。异常: 顺序/IO/预算错误。"""
|
|
34
|
+
if self._closed:
|
|
35
|
+
raise ResultClosedError('驱动索引已关闭')
|
|
36
|
+
names={sample.name for sample in group.samples}
|
|
37
|
+
for driver in self._counts:
|
|
38
|
+
if driver not in names:
|
|
39
|
+
continue
|
|
40
|
+
if self._last[driver] is not None and group.time_ns<=self._last[driver]:
|
|
41
|
+
raise ValueError('驱动索引时间回退或重复')
|
|
42
|
+
if driver not in self._files:
|
|
43
|
+
self._files[driver]=TemporaryFile(mode='w+b',dir=self._path,prefix='driver-times-')
|
|
44
|
+
self._budget.reserve_spool(8)
|
|
45
|
+
handle=self._files[driver]
|
|
46
|
+
handle.seek(0,2)
|
|
47
|
+
if handle.write(self._codec.pack(group.time_ns))!=8:
|
|
48
|
+
raise OSError('驱动索引短写')
|
|
49
|
+
self._counts[driver]+=1
|
|
50
|
+
self._last[driver]=group.time_ns
|
|
51
|
+
|
|
52
|
+
def count(self,driver):
|
|
53
|
+
"""读取已写条数。参数: 驱动。返回: int。异常: 未声明驱动。"""
|
|
54
|
+
return self._counts[driver]
|
|
55
|
+
|
|
56
|
+
def last(self,driver):
|
|
57
|
+
"""读取已写末时刻。参数: 驱动。返回: int或None。异常: 未声明驱动。"""
|
|
58
|
+
return self._last[driver]
|
|
59
|
+
|
|
60
|
+
def at(self,driver,index):
|
|
61
|
+
"""只读取一个时间整数。参数: 驱动/索引。返回: int。异常: 越界/短读。"""
|
|
62
|
+
if self._closed:
|
|
63
|
+
raise ResultClosedError('驱动索引已关闭')
|
|
64
|
+
if not 0<=index<self._counts[driver]:
|
|
65
|
+
raise IndexError('驱动索引越界')
|
|
66
|
+
handle=self._files[driver]
|
|
67
|
+
handle.seek(index*8)
|
|
68
|
+
data=handle.read(8)
|
|
69
|
+
if len(data)!=8:
|
|
70
|
+
raise ValueError('驱动索引短读')
|
|
71
|
+
return self._codec.unpack(data)[0]
|
|
72
|
+
|
|
73
|
+
def lower(self,driver,time_ns):
|
|
74
|
+
"""二分首个不早于time_ns的时刻。参数: 驱动/实际时间。返回: 索引。异常: 原读取错。"""
|
|
75
|
+
lo,hi=0,self._counts[driver]
|
|
76
|
+
while lo<hi:
|
|
77
|
+
mid=(lo+hi)//2
|
|
78
|
+
if self.at(driver,mid)<time_ns:
|
|
79
|
+
lo=mid+1
|
|
80
|
+
else:
|
|
81
|
+
hi=mid
|
|
82
|
+
return lo
|
|
83
|
+
|
|
84
|
+
def position(self,driver,time_ns):
|
|
85
|
+
"""单次查询实际时刻位于哪对记录及其比例,不保存转换时间轴。
|
|
86
|
+
|
|
87
|
+
参数: 驱动/实际时间。返回: (Fraction记录位置,是否超出观测)。异常: 空索引或读取错。
|
|
88
|
+
"""
|
|
89
|
+
if not self.count(driver):
|
|
90
|
+
raise ValueError('记录位置需要真实驱动')
|
|
91
|
+
count=self.count(driver)
|
|
92
|
+
right=self.lower(driver,time_ns)
|
|
93
|
+
if right==count:
|
|
94
|
+
position=Fraction(count-1)
|
|
95
|
+
outside=time_ns>self.at(driver,count-1)
|
|
96
|
+
elif self.at(driver,right)==time_ns:
|
|
97
|
+
position=Fraction(right)
|
|
98
|
+
outside=False
|
|
99
|
+
elif right==0:
|
|
100
|
+
position=Fraction(0)
|
|
101
|
+
outside=True
|
|
102
|
+
else:
|
|
103
|
+
left_time,right_time=self.at(driver,right-1),self.at(driver,right)
|
|
104
|
+
position=Fraction(right-1)+Fraction(time_ns-left_time,right_time-left_time)
|
|
105
|
+
outside=False
|
|
106
|
+
return position,outside
|
|
107
|
+
|
|
108
|
+
def shift(self,driver,time_ns,offset_ns,step_ns):
|
|
109
|
+
"""按所选周期偏移记录位置,返回实际时刻及首尾裁剪标识。
|
|
110
|
+
|
|
111
|
+
参数: 驱动、实际锚点、带符号偏移ns、正周期ns。返回: (实际ns,是否裁剪)。
|
|
112
|
+
非整周期按原实际间隔比例定位,最终纳秒沿既有最近偶数舍入;不补观测之外的记录。
|
|
113
|
+
异常: 空索引/非法周期/实际读取错。
|
|
114
|
+
"""
|
|
115
|
+
if step_ns<=0 or not self.count(driver):
|
|
116
|
+
raise ValueError('周期选窗需要正周期及真实驱动记录')
|
|
117
|
+
count=self.count(driver)
|
|
118
|
+
position,outside=self.position(driver,time_ns)
|
|
119
|
+
target=position+Fraction(offset_ns,step_ns)
|
|
120
|
+
if target<0:
|
|
121
|
+
return self.at(driver,0),True
|
|
122
|
+
if target>count-1:
|
|
123
|
+
return self.at(driver,count-1),True
|
|
124
|
+
left=target.numerator//target.denominator
|
|
125
|
+
if target==left:
|
|
126
|
+
return self.at(driver,left),outside
|
|
127
|
+
a,b=self.at(driver,left),self.at(driver,left+1)
|
|
128
|
+
return round(Fraction(a)+(target-left)*(b-a)),outside
|
|
129
|
+
|
|
130
|
+
@property
|
|
131
|
+
def closed(self):
|
|
132
|
+
"""返回关闭状态。参数: 无。返回: bool。异常: 无。"""
|
|
133
|
+
return self._closed
|
|
134
|
+
|
|
135
|
+
def close(self):
|
|
136
|
+
"""只关闭本次必要文件,失败可重试。参数: 无。返回: None。异常: 原关闭错。"""
|
|
137
|
+
if self._closed:
|
|
138
|
+
return
|
|
139
|
+
for driver in tuple(self._files):
|
|
140
|
+
self._files[driver].close()
|
|
141
|
+
del self._files[driver]
|
|
142
|
+
_release_owned_ram(self,self._fixed_cost,'_fixed_cost')
|
|
143
|
+
self._closed=True
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"""只为需要回看范围的消费者保存计算值,一份实际时间和必要有效截止。
|
|
2
|
+
|
|
3
|
+
同一表达式/条件/驱动可共享此文件。最后一点留在内存,便于非驱动失效更新
|
|
4
|
+
它的截止;其余记录定长保存,可二分定位而无需全量核验或JSON重建。
|
|
5
|
+
"""
|
|
6
|
+
from struct import Struct
|
|
7
|
+
from tempfile import TemporaryFile
|
|
8
|
+
from ..core.numeric import ScalarValue
|
|
9
|
+
from ..core.types import SignalDType as D,QualityFlag as Q
|
|
10
|
+
from ..results.errors import ResultClosedError
|
|
11
|
+
from ..results.spool import _reserve_owned_ram,_release_owned_ram,_cleanup_owner
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RecordValueHistory:
|
|
15
|
+
"""拥有单个必要临时文件和最后一个计算点;没有原帧、原文或第二时间轴。"""
|
|
16
|
+
|
|
17
|
+
def __init__(self,budget,path,dtype,conditioned=False,*,sample_updates=False,labels=()):
|
|
18
|
+
"""预付有限读写状态,不立即建文件。
|
|
19
|
+
|
|
20
|
+
参数: 预算/专用路径/值类型/条件开关;sample_updates按需存真实更新标志,labels共享枚举域。
|
|
21
|
+
返回: owner。异常: 原构造错。
|
|
22
|
+
"""
|
|
23
|
+
self._budget,self._path,self._dtype,self._conditioned=budget,path,dtype,conditioned
|
|
24
|
+
self._sample_updates,self._labels=sample_updates,labels
|
|
25
|
+
self._held_cost=self._fixed_cost=0
|
|
26
|
+
self._file=self._last=None
|
|
27
|
+
self._count=0
|
|
28
|
+
self._closed=self._failed=False
|
|
29
|
+
try:
|
|
30
|
+
_reserve_owned_ram(self,65536,'_fixed_cost')
|
|
31
|
+
if type(sample_updates) is not bool:raise TypeError('样本标志开关需要bool')
|
|
32
|
+
if dtype is D.ENUM:
|
|
33
|
+
if type(labels) is not tuple or not labels:raise ValueError('枚举历史需要共享标签域')
|
|
34
|
+
_reserve_owned_ram(self,4096+sum(1024+64*len(label) for label in labels),'_fixed_cost')
|
|
35
|
+
code={D.FLOAT64:'d',D.INT64:'q',D.UINT64:'Q',D.BOOL:'?',D.ENUM:'I'}[dtype]
|
|
36
|
+
self._codec=Struct('>q'+code+'?Iq?'+('??Iq?' if conditioned else '')+('?' if sample_updates else ''))
|
|
37
|
+
except BaseException as error:
|
|
38
|
+
_cleanup_owner(self,error,'record_value_history_cleanup_owner','必要计算历史构造')
|
|
39
|
+
raise
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def count(self):
|
|
43
|
+
"""含内存末点的记录数。参数: 无。返回: int。异常: 无。"""
|
|
44
|
+
return self._count+(self._last is not None)
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def last_time(self):
|
|
48
|
+
"""最后真实驱动时刻。参数: 无。返回: int或None。异常: 无。"""
|
|
49
|
+
return None if self._last is None else self._last[0]
|
|
50
|
+
|
|
51
|
+
def _open(self):
|
|
52
|
+
"""拒绝失败/关闭后使用。参数: 无。返回: None。异常: ResultClosedError。"""
|
|
53
|
+
if self._closed or self._failed:
|
|
54
|
+
raise ResultClosedError('必要计算历史已关闭或失败')
|
|
55
|
+
|
|
56
|
+
def append(self,row,condition=None,*,actual_update=False):
|
|
57
|
+
"""写前一点并留下新点;输入是本执行器已验证的求值结果。
|
|
58
|
+
|
|
59
|
+
参数: row(time,ScalarValue,deadline),condition为同样三元组或None;actual_update标识真实值更新。
|
|
60
|
+
返回: None。异常: 顺序/短写/预算错误,失败后只能清理。
|
|
61
|
+
"""
|
|
62
|
+
self._open()
|
|
63
|
+
try:
|
|
64
|
+
if type(actual_update) is not bool:raise TypeError('真实更新标志需要bool')
|
|
65
|
+
time,value,deadline=row
|
|
66
|
+
if self._last is not None and time<=self._last[0]:
|
|
67
|
+
raise ValueError('必要计算历史时间须递增')
|
|
68
|
+
if self._last is not None:
|
|
69
|
+
if self._file is None:
|
|
70
|
+
self._file=TemporaryFile(mode='w+b',dir=self._path,prefix='calculation-values-')
|
|
71
|
+
t,v,d,c,cd=self._last[:5]
|
|
72
|
+
number=self._labels.index(v.value) if self._dtype is D.ENUM and v.valid else v.value if v.valid else 0
|
|
73
|
+
fields=(t,number,v.valid,int(v.quality),d or 0,d is not None)
|
|
74
|
+
if self._conditioned:
|
|
75
|
+
fields+=(bool(c.value) if c.valid else False,c.valid,int(c.quality),cd or 0,cd is not None)
|
|
76
|
+
if self._sample_updates:fields+=(self._last[5],)
|
|
77
|
+
payload=self._codec.pack(*fields)
|
|
78
|
+
self._budget.reserve_spool(len(payload))
|
|
79
|
+
self._file.seek(0,2)
|
|
80
|
+
if self._file.write(payload)!=len(payload):
|
|
81
|
+
raise OSError('必要计算历史短写')
|
|
82
|
+
self._count+=1
|
|
83
|
+
self._last=(time,value,deadline,None if condition is None else condition[1],
|
|
84
|
+
None if condition is None else condition[2])+((actual_update,) if self._sample_updates else ())
|
|
85
|
+
except BaseException:
|
|
86
|
+
self._failed=True
|
|
87
|
+
raise
|
|
88
|
+
|
|
89
|
+
def expire_at(self,time_ns,*,condition=False):
|
|
90
|
+
"""非驱动失效只裁最后点,不添加假记录。参数: 实际截止/条件标识。返回: None。异常: 时间回退。"""
|
|
91
|
+
self._open()
|
|
92
|
+
if self._last is None:
|
|
93
|
+
return
|
|
94
|
+
if time_ns<self._last[0]:
|
|
95
|
+
raise ValueError('必要计算历史截止回退')
|
|
96
|
+
index=4 if condition else 2
|
|
97
|
+
old=self._last[index]
|
|
98
|
+
self._last=self._last[:index]+(time_ns if old is None else min(old,time_ns),)+self._last[index+1:]
|
|
99
|
+
|
|
100
|
+
def at(self,index):
|
|
101
|
+
"""读取一个实际记录,不全量扫描。参数: 已登记索引。返回: 点及条件五元组。异常: 越界/短读。"""
|
|
102
|
+
self._open()
|
|
103
|
+
if not 0<=index<self.count:
|
|
104
|
+
raise IndexError('必要计算历史索引越界')
|
|
105
|
+
if index==self._count:
|
|
106
|
+
return self._last
|
|
107
|
+
self._file.seek(index*self._codec.size)
|
|
108
|
+
payload=self._file.read(self._codec.size)
|
|
109
|
+
if len(payload)!=self._codec.size:
|
|
110
|
+
raise ValueError('必要计算历史短读')
|
|
111
|
+
fields=self._codec.unpack(payload)
|
|
112
|
+
t,v,valid,quality,deadline,has_deadline=fields[:6]
|
|
113
|
+
value=ScalarValue((self._labels[v] if self._dtype is D.ENUM else v) if valid else None,
|
|
114
|
+
self._dtype,valid,Q(quality),self._labels)
|
|
115
|
+
selected=selected_deadline=None
|
|
116
|
+
if self._conditioned:
|
|
117
|
+
c,valid,quality,selected_deadline,has_end=fields[6:11]
|
|
118
|
+
selected=ScalarValue(c if valid else None,D.BOOL,valid,Q(quality))
|
|
119
|
+
if not has_end:
|
|
120
|
+
selected_deadline=None
|
|
121
|
+
return (t,value,deadline if has_deadline else None,selected,selected_deadline)+((fields[-1],) if self._sample_updates else ())
|
|
122
|
+
|
|
123
|
+
def lower(self,time_ns):
|
|
124
|
+
"""二分首个不早于time_ns的索引。参数: 实际时间。返回: int。异常: 原读取错。"""
|
|
125
|
+
lo,hi=0,self.count
|
|
126
|
+
while lo<hi:
|
|
127
|
+
mid=(lo+hi)//2
|
|
128
|
+
if self.at(mid)[0]<time_ns:
|
|
129
|
+
lo=mid+1
|
|
130
|
+
else:
|
|
131
|
+
hi=mid
|
|
132
|
+
return lo
|
|
133
|
+
|
|
134
|
+
def rows(self,start_ns,end_ns):
|
|
135
|
+
"""只借出范围两侧及其中的记录,保留裁剪分母。参数: 实际起止。返回: 迭代器。异常: 原读取错。"""
|
|
136
|
+
self._open()
|
|
137
|
+
if not self.count:
|
|
138
|
+
return
|
|
139
|
+
first=self.lower(start_ns)
|
|
140
|
+
if first==self.count or first>0 and self.at(first)[0]>start_ns:
|
|
141
|
+
first-=1
|
|
142
|
+
last=min(self.count-1,self.lower(end_ns))
|
|
143
|
+
for index in range(first,last+1):
|
|
144
|
+
yield self.at(index)
|
|
145
|
+
|
|
146
|
+
@property
|
|
147
|
+
def closed(self):
|
|
148
|
+
"""返回自有资源关闭状态。参数: 无。返回: bool。异常: 无。"""
|
|
149
|
+
return self._closed
|
|
150
|
+
|
|
151
|
+
def close(self):
|
|
152
|
+
"""关闭必要文件并退款,不碰原输入。参数: 无。返回: None。异常: 原关闭错,可重试。"""
|
|
153
|
+
if self._closed:
|
|
154
|
+
return
|
|
155
|
+
if self._file is not None:
|
|
156
|
+
self._file.close()
|
|
157
|
+
self._file=None
|
|
158
|
+
self._last=None
|
|
159
|
+
_release_owned_ram(self,self._fixed_cost,'_fixed_cost')
|
|
160
|
+
self._closed=True
|