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,662 @@
|
|
|
1
|
+
"""在独立信号CSV读取、引用记录累积和数组分配前申请共享预算。
|
|
2
|
+
|
|
3
|
+
输入沿用SignalCSVSpec、声明及ReadRequest;输出沿用原SignalBatch和CSVSourceRef。
|
|
4
|
+
原csv.reader/解析/文件顺序/批次边界保持;检查器只给内部入口提供资源申请。
|
|
5
|
+
物理行readline限制按当时剩余RAM计算,跨物理行的引用记录保守累计,超限失败。
|
|
6
|
+
原样本/ref、定宽Unicode提升、owned数组交接与协议pending副本分别计账。
|
|
7
|
+
close释放本来源/请求引用和预算,文件保留;不是全进程RSS或外部保留全部输出保证。
|
|
8
|
+
默认请求各自保存真实生成器、FD与用途费用槽,关闭取消后保留尚未完成的责任;
|
|
9
|
+
未返回构造以csv_source_cleanup_owner、csv_request_cleanup_owner或csv_resources_cleanup_owner恢复。
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# 新来源仍使用既有CSV解释和数值归一化,资源模型不依赖旧CAN链。
|
|
13
|
+
from collections.abc import Iterator
|
|
14
|
+
from ..results.budget import ResourceBudget
|
|
15
|
+
from ..results.errors import BudgetExceededError
|
|
16
|
+
from ..results.spool import _cleanup_owner, _reserve_owned_ram, _release_owned_ram
|
|
17
|
+
from ..sources.signal_csv import SignalCSVSourceAdapter
|
|
18
|
+
from ..sources.protocol import SourceClosedError, SourceReadError
|
|
19
|
+
from ..sources.models import ReadRequest, SignalBatch
|
|
20
|
+
from ..sources.csv_spec import SignalCSVSpec
|
|
21
|
+
from ..core.binding import SignalDefinition
|
|
22
|
+
from .history import _metadata_bytes
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class BudgetedSignalCSVSourceAdapter(SignalCSVSourceAdapter):
|
|
26
|
+
"""为各请求独立持有检查器,固定声明一次计账,关闭不删除输入。
|
|
27
|
+
|
|
28
|
+
_held_cost只含本来源_input_cost;请求与资源各自拥有自己的费用。
|
|
29
|
+
_closing拒绝继续读取,只有真实子资源及固定槽均已清完才closed。
|
|
30
|
+
未安装请求和检查器保留在明确字段,不借共享余额差额补账。
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(self, budget: ResourceBudget, spec: SignalCSVSpec, session_id: str,
|
|
34
|
+
signals: tuple[SignalDefinition, ...], *, backend: str = 'numpy', clock_only=(), retain_original=True):
|
|
35
|
+
"""先计声明,再建立不读取文件的原CSV适配器。
|
|
36
|
+
|
|
37
|
+
参数: budget为共享RAM账本;其余沿用原CSV入口,backend默认numpy。
|
|
38
|
+
clock_only只取时间;retain_original=False省去逐行原文引用,默认保留旧入口行为。
|
|
39
|
+
返回: 新预算CSV来源。异常: 类型/配置/预算失败;持续清理失败附csv_source_cleanup_owner。
|
|
40
|
+
"""
|
|
41
|
+
if not isinstance(budget, ResourceBudget) or not isinstance(spec, SignalCSVSpec) or type(signals) is not tuple:
|
|
42
|
+
raise TypeError('预算CSV需要ResourceBudget/SignalCSVSpec/信号tuple')
|
|
43
|
+
# 路径/元数据和choices固定容器在原适配器构造前保守计数。
|
|
44
|
+
# Path/tzinfo不是结果层可序列化模型;路径计原文本,时区只保留原对象引用。
|
|
45
|
+
declaration = (spec.name, spec.timebase,
|
|
46
|
+
spec.time_column, spec.unit, spec.offset_ns, spec.encoding, spec.delimiter,
|
|
47
|
+
spec.missing_values, session_id, signals)
|
|
48
|
+
# 逐路径计数避免在申请前再复制完整路径tuple;每次只持一个路径文本。
|
|
49
|
+
cost = 20480 + _metadata_bytes(declaration) * 16 + sum(512 + _metadata_bytes(str(path)) * 16 for path in spec.paths)
|
|
50
|
+
# 首次预算回调前建立可关闭的真实空壳;父构造尚未返回也不依赖未初始化字段。
|
|
51
|
+
self.budget = self._budget = budget
|
|
52
|
+
self._input_cost = self._held_cost = 0
|
|
53
|
+
self.closed = self._closing = False
|
|
54
|
+
self.spec, self.session_id, self.signals, self.backend, self.choices = spec, session_id, signals, backend, {}
|
|
55
|
+
self.active, self.handles = set(), set()
|
|
56
|
+
self._requests, self._resources = set(), set()
|
|
57
|
+
self._uninstalled_request = self._uninstalled_resources = None
|
|
58
|
+
try:
|
|
59
|
+
_reserve_owned_ram(self, cost, '_input_cost')
|
|
60
|
+
super().__init__(spec, session_id, signals, backend=backend,clock_only=clock_only,retain_original=retain_original)
|
|
61
|
+
except BaseException as exc:
|
|
62
|
+
_cleanup_owner(self, exc, 'csv_source_cleanup_owner', '预算CSV来源构造')
|
|
63
|
+
raise
|
|
64
|
+
|
|
65
|
+
def iter_batches(self, request: ReadRequest, *, observe_bounds=False) -> Iterator[SignalBatch]:
|
|
66
|
+
"""预留请求/validator固定结构,再建立原参数生成器。
|
|
67
|
+
|
|
68
|
+
参数: request为ReadRequest,投影/会话由原入口验证;observe_bounds仅收计算所需首末时刻。
|
|
69
|
+
返回: 独立预算游标,不生成额外观测报告。
|
|
70
|
+
异常: 关闭/配置/预算/读取错误传播;未返回请求持续清理失败保最高恢复owner,
|
|
71
|
+
无自动后端回退或批次缩小。
|
|
72
|
+
"""
|
|
73
|
+
self._ensure_open()
|
|
74
|
+
# 只限制创建新请求;已有其他活read仍可推进,不能覆盖尚未返回的最高子责任。
|
|
75
|
+
if self._uninstalled_request is not None or self._uninstalled_resources is not None:
|
|
76
|
+
raise SourceClosedError('预算CSV来源尚有未返回请求或资源待清理')
|
|
77
|
+
try:
|
|
78
|
+
iterator = _CSVRequest(self, request, observe_bounds=observe_bounds)
|
|
79
|
+
self._uninstalled_request = iterator
|
|
80
|
+
self._requests.add(iterator)
|
|
81
|
+
self._uninstalled_request = None
|
|
82
|
+
except BaseException as exc:
|
|
83
|
+
iterator = self._uninstalled_request or getattr(exc, 'csv_request_cleanup_owner', None)
|
|
84
|
+
if iterator is not None:
|
|
85
|
+
_cleanup_owner(iterator, exc, 'csv_request_cleanup_owner', '默认CSV请求登记')
|
|
86
|
+
if iterator.closed or iterator in self._requests:
|
|
87
|
+
self._uninstalled_request = None
|
|
88
|
+
else:
|
|
89
|
+
self._uninstalled_request = iterator
|
|
90
|
+
if not iterator.closed:
|
|
91
|
+
exc.csv_source_cleanup_owner = self
|
|
92
|
+
raise
|
|
93
|
+
return iterator
|
|
94
|
+
|
|
95
|
+
def iter_batches_with_observation(self, request: ReadRequest):
|
|
96
|
+
"""创建本次独立读取owner,完整耗尽并清理成功后才开放原时间行观测事实。
|
|
97
|
+
|
|
98
|
+
参数: request为原ReadRequest,不改变会话、投影、范围或batch_rows。
|
|
99
|
+
返回: CSVObservationRead;迭代交付原SignalBatch,真正StopIteration后
|
|
100
|
+
observation给出本read独立的首末时间、原行数、请求及读取身份。
|
|
101
|
+
异常: 原配置、预算、读取或取消错误;持续构造清理失败时从原异常的
|
|
102
|
+
csv_observation_read_cleanup_owner恢复close。
|
|
103
|
+
副作用: 增加本read自有固定预算,默认iter_batches不启用此采集。
|
|
104
|
+
"""
|
|
105
|
+
# 延迟导入避免预算来源与它的可选资源子类循环;默认入口不导入或构造新owner。
|
|
106
|
+
from .csv_observation import CSVObservationRead
|
|
107
|
+
from ..results.spool import _cleanup_owner
|
|
108
|
+
self._ensure_open()
|
|
109
|
+
# 可选观测同样不能越过默认路径遗留的未返回责任,但不改变其他read的开放检查。
|
|
110
|
+
if self._uninstalled_request is not None or self._uninstalled_resources is not None:
|
|
111
|
+
raise SourceClosedError('预算CSV来源尚有未返回请求或资源待清理')
|
|
112
|
+
read = CSVObservationRead(self, request)
|
|
113
|
+
try:
|
|
114
|
+
# 每个read按对象登记,同一request可独立同时扫描,不用request值作全局key。
|
|
115
|
+
self._requests.add(read)
|
|
116
|
+
except BaseException as exc:
|
|
117
|
+
# 未返回的登记失败也不是可恢复推进状态,最高read只保留关闭责任。
|
|
118
|
+
read._failed = True
|
|
119
|
+
_cleanup_owner(read, exc, 'csv_observation_read_cleanup_owner', 'CSV观测读取登记')
|
|
120
|
+
raise
|
|
121
|
+
return read
|
|
122
|
+
|
|
123
|
+
def _ensure_open(self) -> None:
|
|
124
|
+
"""在固定声明已释放后仍抛明确关闭错误,不访问已丢弃spec。
|
|
125
|
+
|
|
126
|
+
参数: 无。返回: None。异常: SourceClosedError为来源已关闭。
|
|
127
|
+
"""
|
|
128
|
+
if self.closed or self._closing:
|
|
129
|
+
raise SourceClosedError('预算CSV来源已关闭')
|
|
130
|
+
|
|
131
|
+
def _read_resources(self, request: ReadRequest) -> '_CSVResources':
|
|
132
|
+
"""在原迭代器实际打开文件前建立独立资源检查器。
|
|
133
|
+
|
|
134
|
+
参数: request为已校验请求。返回: _CSVResources。
|
|
135
|
+
异常: 固定预算不足或登记失败;持续清理失败保实际检查器及最高来源恢复owner。
|
|
136
|
+
"""
|
|
137
|
+
# 此入口只管理未被请求owner接管的原资源,禁止覆盖已有未安装检查器。
|
|
138
|
+
if self._uninstalled_resources is not None:
|
|
139
|
+
raise SourceClosedError('预算CSV来源尚有未返回资源待清理')
|
|
140
|
+
try:
|
|
141
|
+
resources = _CSVResources(self)
|
|
142
|
+
self._uninstalled_resources = resources
|
|
143
|
+
self._resources.add(resources)
|
|
144
|
+
self._uninstalled_resources = None
|
|
145
|
+
except BaseException as exc:
|
|
146
|
+
resources = self._uninstalled_resources or getattr(exc, 'csv_resources_cleanup_owner', None)
|
|
147
|
+
if resources is not None:
|
|
148
|
+
_cleanup_owner(resources, exc, 'csv_resources_cleanup_owner', '默认CSV资源登记')
|
|
149
|
+
self._uninstalled_resources = None if resources.closed or resources in self._resources else resources
|
|
150
|
+
if not resources.closed:
|
|
151
|
+
exc.csv_source_cleanup_owner = self
|
|
152
|
+
raise
|
|
153
|
+
return resources
|
|
154
|
+
|
|
155
|
+
def _close_handle(self, handle, primary):
|
|
156
|
+
"""仅在真实FD关闭后移除登记,业务根因不被附加清理错误覆盖。
|
|
157
|
+
|
|
158
|
+
参数: handle实际文件;primary已有原错或None。返回: None。
|
|
159
|
+
异常: 无主错或GeneratorExit时原关闭错误传播;其他主错只增加note。
|
|
160
|
+
"""
|
|
161
|
+
try:
|
|
162
|
+
handle.close()
|
|
163
|
+
except BaseException as cleanup:
|
|
164
|
+
if primary is None or isinstance(primary, GeneratorExit):
|
|
165
|
+
raise
|
|
166
|
+
primary.add_note(f'预算CSV文件关闭附加失败: {type(cleanup).__name__}')
|
|
167
|
+
finally:
|
|
168
|
+
if handle.closed:
|
|
169
|
+
self.handles.discard(handle)
|
|
170
|
+
|
|
171
|
+
def close(self) -> None:
|
|
172
|
+
"""关闭全部包装请求、原句柄与检查器,最后抵销固定声明预算。
|
|
173
|
+
|
|
174
|
+
参数: 无。返回: None,成功后幂等。异常: 首个关闭错误,仍尝试其他独立请求;
|
|
175
|
+
尚未结束的子责任及费用保留,恢复后可重复close。
|
|
176
|
+
"""
|
|
177
|
+
if self.closed:
|
|
178
|
+
return
|
|
179
|
+
self._closing = True
|
|
180
|
+
first_error = None
|
|
181
|
+
# 未登记子对象仍由本来源拥有;已在集合中的同一对象不会再保留第二个未安装槽。
|
|
182
|
+
if self._uninstalled_request is not None:
|
|
183
|
+
try:
|
|
184
|
+
self._uninstalled_request.close()
|
|
185
|
+
self._uninstalled_request = None
|
|
186
|
+
except BaseException as exc:
|
|
187
|
+
first_error = exc
|
|
188
|
+
# 一个生成器关闭失败也不能跳过其他独立请求及原句柄。
|
|
189
|
+
for iterator in tuple(self._requests):
|
|
190
|
+
try:
|
|
191
|
+
iterator.close()
|
|
192
|
+
except BaseException as exc:
|
|
193
|
+
if first_error is None:
|
|
194
|
+
first_error = exc
|
|
195
|
+
else:
|
|
196
|
+
first_error.add_note(f'其他预算CSV请求清理失败: {type(exc).__name__}')
|
|
197
|
+
# 活请求已经负责其生成器/FD/资源;这里只关闭没有更高请求owner的残留资源。
|
|
198
|
+
requests = tuple(self._requests) + (() if self._uninstalled_request is None else (self._uninstalled_request,))
|
|
199
|
+
for iterator in tuple(self.active):
|
|
200
|
+
if any(getattr(request, 'iterator', getattr(request, '_iterator', None)) is iterator for request in requests):
|
|
201
|
+
continue
|
|
202
|
+
try:
|
|
203
|
+
iterator.close()
|
|
204
|
+
self.active.discard(iterator)
|
|
205
|
+
except BaseException as exc:
|
|
206
|
+
if first_error is None:
|
|
207
|
+
first_error = exc
|
|
208
|
+
for handle in tuple(self.handles):
|
|
209
|
+
if any(getattr(request, '_handle', None) is handle for request in requests):
|
|
210
|
+
continue
|
|
211
|
+
try:
|
|
212
|
+
self._close_handle(handle, None)
|
|
213
|
+
except BaseException as exc:
|
|
214
|
+
if first_error is None:
|
|
215
|
+
first_error = exc
|
|
216
|
+
resources_to_close = tuple(self._resources) + (() if self._uninstalled_resources is None else (self._uninstalled_resources,))
|
|
217
|
+
for resources in resources_to_close:
|
|
218
|
+
if any(getattr(request, '_resources', None) is resources for request in requests):
|
|
219
|
+
continue
|
|
220
|
+
try:
|
|
221
|
+
resources.close()
|
|
222
|
+
if resources is self._uninstalled_resources:
|
|
223
|
+
self._uninstalled_resources = None
|
|
224
|
+
except BaseException as exc:
|
|
225
|
+
if first_error is None:
|
|
226
|
+
first_error = exc
|
|
227
|
+
children_closed = (not self._requests and not self._resources and not self.active and not self.handles
|
|
228
|
+
and self._uninstalled_request is None and self._uninstalled_resources is None)
|
|
229
|
+
if children_closed:
|
|
230
|
+
try:
|
|
231
|
+
_release_owned_ram(self, self._input_cost, '_input_cost')
|
|
232
|
+
except BaseException as exc:
|
|
233
|
+
if first_error is None:
|
|
234
|
+
first_error = exc
|
|
235
|
+
finally:
|
|
236
|
+
if self._input_cost == 0:
|
|
237
|
+
self.spec, self.signals, self.choices = None, (), {}
|
|
238
|
+
self.closed = True
|
|
239
|
+
if first_error is not None:
|
|
240
|
+
if not self.closed:
|
|
241
|
+
first_error.csv_source_cleanup_owner = self
|
|
242
|
+
raise first_error
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
class _CSVRequest:
|
|
246
|
+
"""拥有默认原生成器、真实FD和资源检查器,半关闭只允许重试close。"""
|
|
247
|
+
|
|
248
|
+
def __init__(self, owner, request, *, observe_bounds=False):
|
|
249
|
+
"""先预约原固定请求费用,再接住原生成器,未返回失败保实际恢复owner。
|
|
250
|
+
|
|
251
|
+
参数: owner为预算CSV来源;request沿原结构;observe_bounds按需保存两个时间整数。返回: 独立默认请求。
|
|
252
|
+
异常: 原配置、预算、取消或登记错误;持续清理失败附csv_request_cleanup_owner。
|
|
253
|
+
"""
|
|
254
|
+
if type(observe_bounds) is not bool:
|
|
255
|
+
raise TypeError("observe_bounds需要bool")
|
|
256
|
+
self.observe_bounds=observe_bounds
|
|
257
|
+
self.observed_start=self.observed_end=None
|
|
258
|
+
self.owner, self._budget = owner, owner.budget
|
|
259
|
+
self.closed = self._closing = False
|
|
260
|
+
self.current = self.iterator = self._resources = self._handle = None
|
|
261
|
+
self.cost = self._held_cost = 0
|
|
262
|
+
try:
|
|
263
|
+
# 金额与旧请求完全一致;resource_sink只接资源,不采集首末原行事实。
|
|
264
|
+
_reserve_owned_ram(self, 16384 + len(owner.signals) * 4096, 'cost')
|
|
265
|
+
self.iterator = SignalCSVSourceAdapter._request_batches(owner, request, resource_sink=self)
|
|
266
|
+
except BaseException as exc:
|
|
267
|
+
self._adopt_cleanup(exc)
|
|
268
|
+
_cleanup_owner(self, exc, 'csv_request_cleanup_owner', '默认CSV请求构造')
|
|
269
|
+
raise
|
|
270
|
+
|
|
271
|
+
def _adopt_cleanup(self, exc):
|
|
272
|
+
"""接住本次尚未返回的检查器,不接他请求或借用来源。
|
|
273
|
+
|
|
274
|
+
参数: exc原异常。返回: None。异常: 无预期异常。
|
|
275
|
+
"""
|
|
276
|
+
resources = getattr(exc, 'csv_resources_cleanup_owner', None)
|
|
277
|
+
if resources is not None and self._resources is None:
|
|
278
|
+
self._resources = resources
|
|
279
|
+
|
|
280
|
+
def _created_iterator(self, iterator):
|
|
281
|
+
"""在原活动登记前接住同一个实际生成器。
|
|
282
|
+
|
|
283
|
+
参数: iterator原生成器。返回: None。异常: 无预期异常。
|
|
284
|
+
"""
|
|
285
|
+
self.iterator = iterator
|
|
286
|
+
|
|
287
|
+
def _read_resources(self):
|
|
288
|
+
"""建立本请求唯一检查器,登记前失败仍由本请求保留责任。
|
|
289
|
+
|
|
290
|
+
参数: 无。返回: 真实_CSVResources。异常: 原预算、构造或集合登记错误。
|
|
291
|
+
"""
|
|
292
|
+
# 同一次原生成器只建立一个检查器;失败后的旧责任须先由同owner关闭。
|
|
293
|
+
if self._resources is not None:
|
|
294
|
+
raise SourceClosedError('默认CSV请求尚有资源待清理')
|
|
295
|
+
try:
|
|
296
|
+
self._resources = _CSVResources(self.owner)
|
|
297
|
+
self.owner._resources.add(self._resources)
|
|
298
|
+
except BaseException as exc:
|
|
299
|
+
self._adopt_cleanup(exc)
|
|
300
|
+
raise
|
|
301
|
+
return self._resources
|
|
302
|
+
|
|
303
|
+
def _opened_handle(self, handle):
|
|
304
|
+
"""在原handles集合登记前接住真实只读FD。
|
|
305
|
+
|
|
306
|
+
参数: handle实际文件。返回: None。异常: 无预期异常。
|
|
307
|
+
"""
|
|
308
|
+
self._handle = handle
|
|
309
|
+
|
|
310
|
+
def _close_handle(self, handle, primary):
|
|
311
|
+
"""执行原文件关闭责任,失败时保持本请求的实际FD引用。
|
|
312
|
+
|
|
313
|
+
参数: handle实际FD;primary已有业务原错或None。返回: None。
|
|
314
|
+
异常: 无主错或GeneratorExit时传播原关闭错误,其余主错保留并加note。
|
|
315
|
+
"""
|
|
316
|
+
try:
|
|
317
|
+
self.owner._close_handle(handle, primary)
|
|
318
|
+
finally:
|
|
319
|
+
if handle.closed:
|
|
320
|
+
self._handle = None
|
|
321
|
+
|
|
322
|
+
def _end_file(self, resources, primary):
|
|
323
|
+
"""抵销文件局部费用,已有业务原错或取消不被附加释放错误取代。
|
|
324
|
+
|
|
325
|
+
参数: resources本请求检查器;primary为生成器现场原错。
|
|
326
|
+
返回: None。异常: 正常结束或GeneratorExit时传播原清理错误。
|
|
327
|
+
"""
|
|
328
|
+
try:
|
|
329
|
+
resources.end_file()
|
|
330
|
+
except BaseException as cleanup:
|
|
331
|
+
if primary is None or isinstance(primary, GeneratorExit):
|
|
332
|
+
raise
|
|
333
|
+
primary.add_note(f'默认CSV文件费用清理附加失败: {type(cleanup).__name__}')
|
|
334
|
+
|
|
335
|
+
def _close_resources(self, primary):
|
|
336
|
+
"""仅在真实FD已关闭后清理本请求检查器,保留原主异常。
|
|
337
|
+
|
|
338
|
+
参数: primary原错或None。返回: None。异常: 正常关闭失败原样传播。
|
|
339
|
+
"""
|
|
340
|
+
if self._handle is not None:
|
|
341
|
+
if primary is None:
|
|
342
|
+
raise SourceReadError('默认CSV文件尚未成功关闭')
|
|
343
|
+
return
|
|
344
|
+
try:
|
|
345
|
+
self._resources.close()
|
|
346
|
+
except BaseException as cleanup:
|
|
347
|
+
if primary is None or isinstance(primary, GeneratorExit):
|
|
348
|
+
raise
|
|
349
|
+
primary.add_note(f'默认CSV资源关闭附加失败: {type(cleanup).__name__}')
|
|
350
|
+
|
|
351
|
+
def __iter__(self):
|
|
352
|
+
"""返回自有游标。参数: 无。返回: self。异常: 无。"""
|
|
353
|
+
return self
|
|
354
|
+
|
|
355
|
+
def __next__(self) -> SignalBatch:
|
|
356
|
+
"""推进原生成器,失败/EOF只清自有资源并保留原异常和最高恢复owner。
|
|
357
|
+
|
|
358
|
+
参数: 无。返回: 原SignalBatch。异常: 原关闭、EOF、预算、读取或取消错误。
|
|
359
|
+
"""
|
|
360
|
+
self.owner._ensure_open()
|
|
361
|
+
if self.closed:
|
|
362
|
+
raise StopIteration
|
|
363
|
+
if self._closing:
|
|
364
|
+
raise SourceClosedError('默认CSV请求正在清理')
|
|
365
|
+
# 结束上一批借引用,原生成器及检查器仍持有原费用直到原交接完成。
|
|
366
|
+
self.current = None
|
|
367
|
+
try:
|
|
368
|
+
self.current = next(self.iterator)
|
|
369
|
+
return self.current
|
|
370
|
+
except StopIteration:
|
|
371
|
+
# 真实EOF尚须本请求固定费用关闭成功;此时没有业务主错,不能用StopIteration遮蔽清理取消。
|
|
372
|
+
self.close()
|
|
373
|
+
raise
|
|
374
|
+
except BaseException as exc:
|
|
375
|
+
self._adopt_cleanup(exc)
|
|
376
|
+
_cleanup_owner(self, exc, 'csv_request_cleanup_owner', '默认CSV请求推进')
|
|
377
|
+
raise
|
|
378
|
+
|
|
379
|
+
def close(self) -> None:
|
|
380
|
+
"""依次关闭真实生成器/FD/检查器,最后抵销固定费用,成功后才closed。
|
|
381
|
+
|
|
382
|
+
参数: 无。返回: None,幂等。异常: 原关闭或预算错误;尚未清完附最高请求owner。
|
|
383
|
+
"""
|
|
384
|
+
if self.closed:
|
|
385
|
+
self.owner._requests.discard(self)
|
|
386
|
+
return
|
|
387
|
+
self._closing = True
|
|
388
|
+
first_error = None
|
|
389
|
+
# 生成器可能已在第一次close中退出finally,FD与检查器字段仍须独立重试。
|
|
390
|
+
if self.iterator is not None:
|
|
391
|
+
try:
|
|
392
|
+
self.iterator.close()
|
|
393
|
+
except BaseException as exc:
|
|
394
|
+
first_error = exc
|
|
395
|
+
if self._handle is not None:
|
|
396
|
+
try:
|
|
397
|
+
self.owner._close_handle(self._handle, None)
|
|
398
|
+
except BaseException as exc:
|
|
399
|
+
if first_error is None:
|
|
400
|
+
first_error = exc
|
|
401
|
+
finally:
|
|
402
|
+
if self._handle.closed:
|
|
403
|
+
self._handle = None
|
|
404
|
+
if self._handle is None and self._resources is not None:
|
|
405
|
+
try:
|
|
406
|
+
self._resources.close()
|
|
407
|
+
except BaseException as exc:
|
|
408
|
+
if first_error is None:
|
|
409
|
+
first_error = exc
|
|
410
|
+
finally:
|
|
411
|
+
if self._resources.closed:
|
|
412
|
+
self._resources = None
|
|
413
|
+
# 实际生成器已关闭且所有子责任结束才释放其固定请求槽;不抵销借用adapter费用。
|
|
414
|
+
iterator_closed = self.iterator is None or self.iterator.gi_frame is None
|
|
415
|
+
if iterator_closed and self._handle is None and self._resources is None:
|
|
416
|
+
self.owner.active.discard(self.iterator)
|
|
417
|
+
self.current = None
|
|
418
|
+
try:
|
|
419
|
+
_release_owned_ram(self, self.cost, 'cost')
|
|
420
|
+
except BaseException as exc:
|
|
421
|
+
if first_error is None:
|
|
422
|
+
first_error = exc
|
|
423
|
+
finally:
|
|
424
|
+
if self.cost == 0:
|
|
425
|
+
self.closed = True
|
|
426
|
+
self.iterator = None
|
|
427
|
+
self.owner._requests.discard(self)
|
|
428
|
+
if first_error is not None:
|
|
429
|
+
if not self.closed:
|
|
430
|
+
first_error.csv_request_cleanup_owner = self
|
|
431
|
+
raise first_error
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
class _CSVResources:
|
|
435
|
+
"""每请求按用途保存金额,固定读取缓冲、行/ref、数组和协议状态共同计账。
|
|
436
|
+
|
|
437
|
+
八个实际属性槽是付款依据,charges只提供兼容视图;_held_cost为槽位总和。
|
|
438
|
+
_closing后不再增加费用,所有用途真实抵销完成才closed并解除来源登记。
|
|
439
|
+
"""
|
|
440
|
+
|
|
441
|
+
def __init__(self, owner):
|
|
442
|
+
"""预留文件解码缓冲及资源容器,不在申请前打开文件。
|
|
443
|
+
|
|
444
|
+
参数: owner为预算CSV来源。返回: 独立检查器。异常: BudgetExceededError。
|
|
445
|
+
"""
|
|
446
|
+
self.owner, self.budget, self.closed = owner, owner.budget, False
|
|
447
|
+
self._budget, self._held_cost, self._closing = owner.budget, 0, False
|
|
448
|
+
self._fixed_cost = self._reading_cost = self._header_cost = self._row_cost = 0
|
|
449
|
+
self._pending_cost = self._work_cost = self._array_cost = self._protocol_cost = 0
|
|
450
|
+
self.charges, self.line_source, self.array_cost = {}, None, 0
|
|
451
|
+
# TextIO解码缓冲和固定容器保守64KiB,不声称整进程RSS。
|
|
452
|
+
try:
|
|
453
|
+
self._add('fixed', 65536)
|
|
454
|
+
except BaseException as exc:
|
|
455
|
+
# 可选观测子类已有同一真实恢复边界,默认构造只处理自己的未返回资源。
|
|
456
|
+
if type(self) is _CSVResources:
|
|
457
|
+
_cleanup_owner(self, exc, 'csv_resources_cleanup_owner', '默认CSV资源构造')
|
|
458
|
+
raise
|
|
459
|
+
|
|
460
|
+
def _sync(self, key):
|
|
461
|
+
"""把真实付款槽同步到兼容charges视图,不从视图反推所有权。
|
|
462
|
+
|
|
463
|
+
参数: key为八个固定用途之一。返回: None。异常: 原字典登记错误可重试。
|
|
464
|
+
"""
|
|
465
|
+
amount = getattr(self, '_' + key + '_cost')
|
|
466
|
+
if amount:
|
|
467
|
+
self.charges[key] = amount
|
|
468
|
+
else:
|
|
469
|
+
self.charges.pop(key, None)
|
|
470
|
+
|
|
471
|
+
def _add(self, key, amount):
|
|
472
|
+
"""事务式登记一次真实预约,未入账超限不增加自有金额。
|
|
473
|
+
|
|
474
|
+
参数: key为用途;amount为bytes。返回: None。异常: 账本超限/金额错误/取消;
|
|
475
|
+
实际已入账而返回取消时仍保留真实付款槽。
|
|
476
|
+
"""
|
|
477
|
+
if self.closed or self._closing:
|
|
478
|
+
raise SourceClosedError('默认CSV资源已关闭或正在清理')
|
|
479
|
+
try:
|
|
480
|
+
_reserve_owned_ram(self, amount, '_' + key + '_cost')
|
|
481
|
+
finally:
|
|
482
|
+
self._sync(key)
|
|
483
|
+
|
|
484
|
+
def _release_amount(self, key, amount):
|
|
485
|
+
"""只抵销本用途真实费用,释放前后取消均保留正确槽位。
|
|
486
|
+
|
|
487
|
+
参数: key固定用途;amount不超过本槽bytes。返回: None。异常: 原释放或取消。
|
|
488
|
+
"""
|
|
489
|
+
try:
|
|
490
|
+
_release_owned_ram(self, amount, '_' + key + '_cost')
|
|
491
|
+
finally:
|
|
492
|
+
self._sync(key)
|
|
493
|
+
|
|
494
|
+
def _move(self, source, target, amount):
|
|
495
|
+
"""转移已付款责任槽,总费用不变,不申请或归还共享余额。
|
|
496
|
+
|
|
497
|
+
参数: source/target固定用途,amount为真实已有bytes。返回: None。异常: 金额矛盾ValueError。
|
|
498
|
+
"""
|
|
499
|
+
source_slot, target_slot = '_' + source + '_cost', '_' + target + '_cost'
|
|
500
|
+
if amount < 0 or amount > getattr(self, source_slot):
|
|
501
|
+
raise ValueError('默认CSV费用交接超出原用途余额')
|
|
502
|
+
setattr(self, source_slot, getattr(self, source_slot) - amount)
|
|
503
|
+
setattr(self, target_slot, getattr(self, target_slot) + amount)
|
|
504
|
+
self._sync(source)
|
|
505
|
+
self._sync(target)
|
|
506
|
+
|
|
507
|
+
def _release(self, key):
|
|
508
|
+
"""抵销某用途全部预留。参数: key用途。返回: None。异常: 账本一致性错误。"""
|
|
509
|
+
self._release_amount(key, getattr(self, '_' + key + '_cost'))
|
|
510
|
+
|
|
511
|
+
def lines(self, handle):
|
|
512
|
+
"""把真实TextIO交给限长物理行迭代器,不自己解释CSV。
|
|
513
|
+
|
|
514
|
+
参数: handle为原适配器只读文件。返回: _PhysicalLines。异常: 构造错误传播。
|
|
515
|
+
"""
|
|
516
|
+
self.line_source = _PhysicalLines(self, handle)
|
|
517
|
+
return self.line_source
|
|
518
|
+
|
|
519
|
+
def records(self, reader):
|
|
520
|
+
"""保持原reader的物理计数和解释,为表头/当前逻辑记录保存累积预算。
|
|
521
|
+
|
|
522
|
+
参数: reader为原csv.reader。返回: _CSVRecords。异常: 构造错误传播。
|
|
523
|
+
"""
|
|
524
|
+
return _CSVRecords(self, reader)
|
|
525
|
+
|
|
526
|
+
def before_sample(self, time_text, text, path):
|
|
527
|
+
"""在值解析/CSVSourceRef创建/原记录append前预留引用与原文本。
|
|
528
|
+
|
|
529
|
+
参数: time_text/text原单元格;path实际文件。返回: None。异常: 预算超限。
|
|
530
|
+
"""
|
|
531
|
+
# 每样本固定容器加原字符串/路径;共享文本也保守重复计数。
|
|
532
|
+
self._add('pending', 8192 + _metadata_bytes((time_text, text, str(path))) * 16)
|
|
533
|
+
|
|
534
|
+
def before_pack(self, pending, validator):
|
|
535
|
+
"""预留(N,)数组/掩码副本、Unicode定宽提升及validator集合副本。
|
|
536
|
+
|
|
537
|
+
参数: pending为原缓冲;validator为本请求协议状态。返回: None。
|
|
538
|
+
异常: 超限在pack_decoded/validator.accept之前失败,无丢样本或回退。
|
|
539
|
+
"""
|
|
540
|
+
count = sum(len(records) for records in pending.values())
|
|
541
|
+
# 4096/sample覆盖数值数组nbytes、归一化副本、分组/装箱与输出模型检查。
|
|
542
|
+
array_cost = 65536 + len(pending) * 8192 + count * 4096
|
|
543
|
+
if self.owner.backend == 'numpy':
|
|
544
|
+
for records in pending.values():
|
|
545
|
+
# 同列str分组会按最长字符提升为UTF32,八份保守计入临时副本。
|
|
546
|
+
widths = [len(item[2]) for item in records if type(item[2]) is str]
|
|
547
|
+
array_cost += len(widths) * max(widths, default=0) * 4 * 8
|
|
548
|
+
# old pending在accept内部复制;N可能全在同刻,增长不能从预算中漏掉。
|
|
549
|
+
identities = sum(len(state[1]) for state in validator.pending.values())
|
|
550
|
+
state_cost = 4096 + len(self.owner.signals) * 512 + identities * 256 + count * 512
|
|
551
|
+
self._add('work', array_cost + state_cost)
|
|
552
|
+
self.array_cost = array_cost
|
|
553
|
+
|
|
554
|
+
def after_pack(self, validator):
|
|
555
|
+
"""校验完成后把工作预留转为当前owned数组和保留协议状态。
|
|
556
|
+
|
|
557
|
+
参数: validator为已accept状态。返回: None。异常: 内部账本一致性错误。
|
|
558
|
+
"""
|
|
559
|
+
state_cost = sum(512 + len(state[1]) * 256 for state in validator.pending.values())
|
|
560
|
+
# 旧batch已被原生成器和包装游标交接;新数组预留早已申请,不重复申请。
|
|
561
|
+
self._release('array')
|
|
562
|
+
self._release('protocol')
|
|
563
|
+
self._move('work', 'array', self.array_cost)
|
|
564
|
+
self._move('work', 'protocol', state_cost)
|
|
565
|
+
self._release('work')
|
|
566
|
+
|
|
567
|
+
def clear_pending(self):
|
|
568
|
+
"""原生成器yield恢复且清空缓冲后抵销原记录预留。
|
|
569
|
+
|
|
570
|
+
参数: 无。返回: None。异常: 账本一致性错误。
|
|
571
|
+
"""
|
|
572
|
+
self._release('pending')
|
|
573
|
+
|
|
574
|
+
def end_file(self):
|
|
575
|
+
"""局部行/表头引用丢弃后抵销预算,跨文件样本与协议预算保留。
|
|
576
|
+
|
|
577
|
+
参数: 无。返回: None。异常: 账本一致性错误。
|
|
578
|
+
"""
|
|
579
|
+
self.line_source = None
|
|
580
|
+
for key in ('reading', 'header', 'row'):
|
|
581
|
+
self._release(key)
|
|
582
|
+
|
|
583
|
+
def close(self):
|
|
584
|
+
"""释放本请求全部金额,不关闭他请求或删除输入文件。
|
|
585
|
+
|
|
586
|
+
参数: 无。返回: None,幂等。异常: 账本一致性错误。
|
|
587
|
+
"""
|
|
588
|
+
if self.closed:
|
|
589
|
+
return
|
|
590
|
+
self._closing = True
|
|
591
|
+
self.line_source = None
|
|
592
|
+
for key in ('fixed', 'reading', 'header', 'row', 'pending', 'work', 'array', 'protocol'):
|
|
593
|
+
self._release(key)
|
|
594
|
+
if self._held_cost == 0:
|
|
595
|
+
self.closed = True
|
|
596
|
+
self.owner._resources.discard(self)
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
class _PhysicalLines:
|
|
600
|
+
"""每次readline前按剩余RAM申请上限;引用记录跨行继续累积reading金额。"""
|
|
601
|
+
|
|
602
|
+
def __init__(self, resources, handle):
|
|
603
|
+
"""保存真实只读句柄。参数: resources检查器/handle文件。返回: 新行游标。异常: 无。"""
|
|
604
|
+
self.resources, self.handle = resources, handle
|
|
605
|
+
|
|
606
|
+
def __iter__(self):
|
|
607
|
+
"""返回物理行游标。参数: 无。返回: self。异常: 无。"""
|
|
608
|
+
return self
|
|
609
|
+
|
|
610
|
+
def __next__(self):
|
|
611
|
+
"""有界读完整物理行,超限不把截断内容交给csv.reader。
|
|
612
|
+
|
|
613
|
+
参数: 无。返回: 含原换行的str;EOF停止。异常: BudgetExceededError/原I/O错误。
|
|
614
|
+
"""
|
|
615
|
+
budget = self.resources.budget
|
|
616
|
+
# 64/字符覆盖UTF32文本、csv字符缓冲、短字段对象/指针及记录交接。
|
|
617
|
+
capacity = (budget.memory_budget_bytes - budget.ram_bytes - 8192) // 64 - 1
|
|
618
|
+
if capacity <= 0:
|
|
619
|
+
raise BudgetExceededError('CSV物理行/引用记录累积超出剩余RAM估算')
|
|
620
|
+
amount = 8192 + (capacity + 1) * 64
|
|
621
|
+
self.resources._add('reading', amount)
|
|
622
|
+
try:
|
|
623
|
+
# 多读一字符仅判别完整物理行,不能把部分未闭合引号当另一记录。
|
|
624
|
+
text = self.handle.readline(capacity + 1)
|
|
625
|
+
except BaseException as exc:
|
|
626
|
+
try:
|
|
627
|
+
self.resources._release_amount('reading', amount)
|
|
628
|
+
except BaseException as cleanup:
|
|
629
|
+
exc.add_note(f'默认CSV物理行清理附加失败: {type(cleanup).__name__}')
|
|
630
|
+
raise
|
|
631
|
+
retained = 0 if not text else 8192 + len(text) * 64
|
|
632
|
+
self.resources._release_amount('reading', amount - retained)
|
|
633
|
+
if len(text) > capacity:
|
|
634
|
+
raise BudgetExceededError('CSV物理行超过剩余RAM允许长度,未解析截断行')
|
|
635
|
+
if not text:
|
|
636
|
+
raise StopIteration
|
|
637
|
+
return text
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
class _CSVRecords:
|
|
641
|
+
"""包装原csv.reader,表头固定持有,当前/下一逻辑记录读取时预算重叠。"""
|
|
642
|
+
|
|
643
|
+
def __init__(self, resources, reader):
|
|
644
|
+
"""保存原解析器。参数: resources检查器/reader原csv.reader。返回: 新记录游标。异常: 无。"""
|
|
645
|
+
self.resources, self.reader, self.first = resources, reader, True
|
|
646
|
+
|
|
647
|
+
def __iter__(self):
|
|
648
|
+
"""返回记录游标。参数: 无。返回: self。异常: 无。"""
|
|
649
|
+
return self
|
|
650
|
+
|
|
651
|
+
def __next__(self):
|
|
652
|
+
"""推进原解析器,跨物理行累积到一条完整记录再转移预算。
|
|
653
|
+
|
|
654
|
+
参数: 无。返回: 原单元格list。异常: EOF/原csv错误/预算或I/O错误。
|
|
655
|
+
"""
|
|
656
|
+
# 上一cells在调用next期间仍由原生成器保存,先完成新解析再释放旧行预算。
|
|
657
|
+
cells = next(self.reader)
|
|
658
|
+
key = 'header' if self.first else 'row'
|
|
659
|
+
self.resources._release(key)
|
|
660
|
+
self.resources._move('reading', key, self.resources._reading_cost)
|
|
661
|
+
self.first = False
|
|
662
|
+
return cells
|