bdo-toolkit 1.0.13__tar.gz → 1.0.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bdo_toolkit-1.0.13/src/bdo_toolkit.egg-info → bdo_toolkit-1.0.14}/PKG-INFO +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_version.py +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_detail_learning.py +94 -12
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_discovery.py +2 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14/src/bdo_toolkit.egg-info}/PKG-INFO +1 -1
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_learning_adversarial.py +45 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_replay.py +3 -3
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/LICENSE +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/README.md +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/pyproject.toml +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/setup.cfg +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_async_sessions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_async_utils.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/_formatting.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/_records.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/analysis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/companions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/live.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/observations.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/persistence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/progress.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_calibration/workflow.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_capture_backend.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_capture_options.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_capture_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_deposit_origin.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_engine.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_framing.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/_records.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/assembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/formatting.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/inventory.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_item_state/storage.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_observation_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_origin/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_origin/discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_origin/manual.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_origin/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_origin/tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_profile_io.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_profile_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_protocol.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_reassembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_record_geometry.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_specs.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_storage_destination_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_storage_hydration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_tracked_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/_calibration_models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/_discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/_profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/async_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/agris/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/capture_diagnosis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/character_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/diagnostics.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/events.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/filters.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/grind/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/grind/_pipeline.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/grind/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/grind/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/item_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/origin_learning.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/py.typed +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/raw/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/raw/_collector.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/raw/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/raw/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/raw/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/remote_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_constants.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_details.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_live_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_replay_capture.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_result.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_scanner.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/async_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/solare/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/writers.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/__init__.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/xp/session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit.egg-info/SOURCES.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit.egg-info/dependency_links.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit.egg-info/entry_points.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit.egg-info/requires.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit.egg-info/top_level.txt +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_async.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_discovery.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_evidence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_models.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_agris_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_async_sessions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration_conveniences.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration_lifecycle.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration_persistence.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration_progress.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_calibration_retention.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_capture_backend.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_capture_diagnosis.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_capture_replay.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_capture_runtime.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_character_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_cli.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_decoder_diagnostics.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_deposit_origin.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_direction.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_dynamic_storage_calibration_matrix.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_engine.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_examples_and_writers.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_explicit_profile.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_fixture_catalog.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_fixture_regressions.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_framing.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_grind.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_initial_load_storage.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_inventory_snapshots.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_item_state.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_live_capture_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_origin_learning.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_package_layout.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_profile_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_raw.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_reassembly.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_remote_profiles.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_api.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_details.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_equipment.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_learning.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_real_captures.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_solare_session.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_storage_destination_validation.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_storage_events.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_storage_hydration_tracker.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_storage_unknown_destination_calibration.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_toolkit_api.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_xp.py +0 -0
- {bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_xp_profiles.py +0 -0
|
@@ -16,7 +16,7 @@ import itertools
|
|
|
16
16
|
import re
|
|
17
17
|
from collections import Counter
|
|
18
18
|
from dataclasses import dataclass, replace
|
|
19
|
-
from typing import Mapping, Optional, Sequence
|
|
19
|
+
from typing import Callable, Mapping, Optional, Sequence
|
|
20
20
|
|
|
21
21
|
from bdo_toolkit._protocol import BDOFrame
|
|
22
22
|
|
|
@@ -558,6 +558,7 @@ def _balanced_counter_solution(
|
|
|
558
558
|
occupancies: Sequence[int],
|
|
559
559
|
*,
|
|
560
560
|
records: Optional[_RecordTable] = None,
|
|
561
|
+
validate: Optional[Callable[[int, tuple[int, int, int]], bool]] = None,
|
|
561
562
|
) -> Optional[tuple[int, tuple[int, int, int]]]:
|
|
562
563
|
record_size = len(rows[0])
|
|
563
564
|
occupied_activity = [0] * _CLASS_SLOT_COUNT
|
|
@@ -624,15 +625,13 @@ def _balanced_counter_solution(
|
|
|
624
625
|
ordered = sorted(
|
|
625
626
|
(left_offset, right_offset, third_offset)
|
|
626
627
|
)
|
|
627
|
-
solutions.add(
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
(ordered[0], ordered[1], ordered[2]),
|
|
631
|
-
)
|
|
632
|
-
)
|
|
633
|
-
if len(solutions) > 1:
|
|
628
|
+
solutions.add((matches_offset, (ordered[0], ordered[1], ordered[2])))
|
|
629
|
+
# Never truncate a search and claim uniqueness.
|
|
630
|
+
if len(solutions) > 64:
|
|
634
631
|
return None
|
|
635
|
-
|
|
632
|
+
supported = [candidate for candidate in sorted(solutions)
|
|
633
|
+
if validate is None or validate(*candidate)]
|
|
634
|
+
return supported[0] if len(supported) == 1 else None
|
|
636
635
|
|
|
637
636
|
|
|
638
637
|
def _history_candidates(
|
|
@@ -794,20 +793,87 @@ def _companion_outcomes_agree(
|
|
|
794
793
|
return shared >= 20 and discriminating_names >= _MIN_HISTORY_DISCRIMINATORS
|
|
795
794
|
|
|
796
795
|
|
|
796
|
+
def _counter_geometry_check(
|
|
797
|
+
records: _RecordTable, class_offset: int, occupancies: tuple[int, ...],
|
|
798
|
+
source: _RecordTable, source_class: int, source_occupancies: tuple[int, ...],
|
|
799
|
+
) -> Optional[Callable[[int, tuple[int, int, int]], bool]]:
|
|
800
|
+
# Establish numerical geometry without assigning any W/D/L labels.
|
|
801
|
+
# An ambiguous source cannot corroborate another ambiguous response.
|
|
802
|
+
counters = _balanced_counter_solution(
|
|
803
|
+
source.rows, source_occupancies, records=source,
|
|
804
|
+
)
|
|
805
|
+
if counters is None:
|
|
806
|
+
return None
|
|
807
|
+
source_matches, source_outcomes = counters
|
|
808
|
+
if len(_history_candidates(source.rows, source_occupancies, source_matches)) != 1:
|
|
809
|
+
return None
|
|
810
|
+
by_name = {name: i for i, name in enumerate(source.names)}
|
|
811
|
+
|
|
812
|
+
def agrees(matches: int, outcomes: tuple[int, int, int]) -> bool:
|
|
813
|
+
shared = 0
|
|
814
|
+
for row, name, rank, occupied in zip(
|
|
815
|
+
records.rows, records.names, records.ranks, occupancies,
|
|
816
|
+
):
|
|
817
|
+
ordinal = by_name.get(name)
|
|
818
|
+
if ordinal is None:
|
|
819
|
+
continue
|
|
820
|
+
other = source.rows[ordinal]
|
|
821
|
+
if rank != source.ranks[ordinal] or occupied != source_occupancies[ordinal]:
|
|
822
|
+
return False
|
|
823
|
+
for slot in range(occupied):
|
|
824
|
+
if row[class_offset + slot] != other[source_class + slot]:
|
|
825
|
+
return False
|
|
826
|
+
if _u32le(row, matches + slot * 4) != _u32le(other, source_matches + slot * 4):
|
|
827
|
+
return False
|
|
828
|
+
if sorted(_u32le(row, off + slot * 4) for off in outcomes) != sorted(
|
|
829
|
+
_u32le(other, off + slot * 4) for off in source_outcomes
|
|
830
|
+
):
|
|
831
|
+
return False
|
|
832
|
+
shared += 1
|
|
833
|
+
return shared >= 20
|
|
834
|
+
return agrees
|
|
835
|
+
|
|
836
|
+
|
|
797
837
|
def _learn_performance_offsets(
|
|
798
838
|
records: _RecordTable,
|
|
799
839
|
class_offset: int,
|
|
800
840
|
occupancies: tuple[int, ...],
|
|
801
841
|
*,
|
|
802
842
|
companion: Optional[tuple[_RecordTable, _PerformanceOffsets]] = None,
|
|
843
|
+
counter_check: Optional[Callable[[int, tuple[int, int, int]], bool]] = None,
|
|
803
844
|
) -> Optional[_PerformanceOffsets]:
|
|
804
845
|
spec_offset = _learn_spec_offset(records.rows, occupancies)
|
|
846
|
+
if spec_offset is None:
|
|
847
|
+
return None
|
|
848
|
+
|
|
849
|
+
def validate(matches: int, outcomes: tuple[int, int, int]) -> bool:
|
|
850
|
+
if counter_check is not None and not counter_check(matches, outcomes):
|
|
851
|
+
return False
|
|
852
|
+
return _validate_performance_candidate(
|
|
853
|
+
records, class_offset, occupancies, spec_offset, matches, outcomes,
|
|
854
|
+
companion=companion,
|
|
855
|
+
) is not None
|
|
805
856
|
counters = _balanced_counter_solution(
|
|
806
|
-
records.rows, occupancies, records=records,
|
|
857
|
+
records.rows, occupancies, records=records, validate=validate,
|
|
807
858
|
)
|
|
808
|
-
if
|
|
859
|
+
if counters is None:
|
|
809
860
|
return None
|
|
810
|
-
|
|
861
|
+
return _validate_performance_candidate(
|
|
862
|
+
records, class_offset, occupancies, spec_offset, *counters,
|
|
863
|
+
companion=companion,
|
|
864
|
+
)
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
def _validate_performance_candidate(
|
|
868
|
+
records: _RecordTable,
|
|
869
|
+
class_offset: int,
|
|
870
|
+
occupancies: tuple[int, ...],
|
|
871
|
+
spec_offset: int,
|
|
872
|
+
matches_offset: int,
|
|
873
|
+
outcome_offsets: tuple[int, int, int],
|
|
874
|
+
*,
|
|
875
|
+
companion: Optional[tuple[_RecordTable, _PerformanceOffsets]] = None,
|
|
876
|
+
) -> Optional[_PerformanceOffsets]:
|
|
811
877
|
histories = _history_candidates(
|
|
812
878
|
records.rows,
|
|
813
879
|
occupancies,
|
|
@@ -840,6 +906,11 @@ def _learn_performance_offsets(
|
|
|
840
906
|
oriented = supported[0]
|
|
841
907
|
if oriented is None:
|
|
842
908
|
return None
|
|
909
|
+
if companion is not None and not _companion_outcomes_agree(
|
|
910
|
+
records, class_offset, occupancies, matches_offset, oriented,
|
|
911
|
+
companion[0], companion[1],
|
|
912
|
+
):
|
|
913
|
+
return None
|
|
843
914
|
wins_offset, draws_offset, losses_offset = oriented
|
|
844
915
|
active = tuple(
|
|
845
916
|
(offset, vector) for offset in outcome_offsets
|
|
@@ -1743,6 +1814,17 @@ def learn_unknown_solare_details(
|
|
|
1743
1814
|
and overall_class is not None
|
|
1744
1815
|
else None
|
|
1745
1816
|
)
|
|
1817
|
+
if (learn_overall and overall_performance is None and rich_performance is None
|
|
1818
|
+
and overall_class is not None and rich.class_offset is not None
|
|
1819
|
+
and rich_occupancies is not None):
|
|
1820
|
+
check = _counter_geometry_check(
|
|
1821
|
+
overall_records, overall_class[0], overall_class[1],
|
|
1822
|
+
rich_records, rich.class_offset, rich_occupancies,
|
|
1823
|
+
)
|
|
1824
|
+
if check is not None:
|
|
1825
|
+
overall_performance = _learn_performance_offsets(
|
|
1826
|
+
overall_records, overall_class[0], overall_class[1], counter_check=check,
|
|
1827
|
+
)
|
|
1746
1828
|
if learn_overall and overall_performance is None and rich_performance is not None and overall_class is not None:
|
|
1747
1829
|
overall_performance = _learn_performance_offsets(
|
|
1748
1830
|
overall_records, overall_class[0], overall_class[1],
|
|
@@ -204,7 +204,8 @@ def _read_player_identifier(data: bytes, offset: int, max_chars: int = 32) -> st
|
|
|
204
204
|
return data[offset:position].decode("utf-16-le")
|
|
205
205
|
if not _is_player_identifier_codepoint(code):
|
|
206
206
|
return ""
|
|
207
|
-
if position == offset and unicodedata.category(chr(code)).startswith("M")
|
|
207
|
+
if (position == offset and unicodedata.category(chr(code)).startswith("M")
|
|
208
|
+
and not 0x0E48 <= code <= 0x0E4B):
|
|
208
209
|
return ""
|
|
209
210
|
if (0xFE00 <= code <= 0xFE0F or 0xE0100 <= code <= 0xE01EF) and not (
|
|
210
211
|
unicodedata.name(chr(previous_code), "").startswith(
|
|
@@ -972,3 +972,48 @@ def test_zero_aggregate_requires_independent_header_and_counter_proof(damage):
|
|
|
972
972
|
rows[-1] = bytes(row)
|
|
973
973
|
assert learning._learn_aggregate(replace(table, rows=tuple(rows)), perf,
|
|
974
974
|
companion=companion) is None
|
|
975
|
+
|
|
976
|
+
@pytest.mark.parametrize("damage", (None, "counter", "rank", "class", "few_shared", "ambiguous_source"))
|
|
977
|
+
def test_unoriented_counter_geometry_requires_independent_exact_joins(damage):
|
|
978
|
+
source, performance = _performance_rows(duplicate_counters=damage == "ambiguous_source")
|
|
979
|
+
source = _table(source.rows * 2)
|
|
980
|
+
occupied = performance.occupancies * 2
|
|
981
|
+
target = _table(source.rows)
|
|
982
|
+
if damage == "counter":
|
|
983
|
+
row = bytearray(target.rows[0])
|
|
984
|
+
row[performance.matches_offset] ^= 1
|
|
985
|
+
target = replace(target, rows=(bytes(row),) + target.rows[1:])
|
|
986
|
+
elif damage == "rank":
|
|
987
|
+
target = replace(target, ranks=(999,) + target.ranks[1:])
|
|
988
|
+
elif damage == "class":
|
|
989
|
+
row = bytearray(target.rows[0]); row[_CLASS_OFFSET] = 30
|
|
990
|
+
target = replace(target, rows=(bytes(row),) + target.rows[1:])
|
|
991
|
+
elif damage == "few_shared":
|
|
992
|
+
target = replace(target, names=tuple(n if i < 19 else "Other" + n for i, n in enumerate(target.names)))
|
|
993
|
+
check = learning._counter_geometry_check(
|
|
994
|
+
target, _CLASS_OFFSET, occupied, source, _CLASS_OFFSET, occupied,
|
|
995
|
+
)
|
|
996
|
+
if damage == "ambiguous_source":
|
|
997
|
+
assert check is None
|
|
998
|
+
else:
|
|
999
|
+
assert check is not None
|
|
1000
|
+
outcomes = (performance.losses_offset, performance.draws_offset, performance.wins_offset)
|
|
1001
|
+
assert check(performance.matches_offset, outcomes) is (damage is None)
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
def test_counter_solver_applies_evidence_before_rejecting_multiple_alignments():
|
|
1005
|
+
records, performance = _performance_rows(duplicate_counters=True)
|
|
1006
|
+
calls = []
|
|
1007
|
+
def validate(matches, outcomes):
|
|
1008
|
+
calls.append((matches, outcomes))
|
|
1009
|
+
return matches == performance.matches_offset and set(outcomes) == {
|
|
1010
|
+
performance.wins_offset, performance.draws_offset, performance.losses_offset,
|
|
1011
|
+
}
|
|
1012
|
+
result = learning._balanced_counter_solution(
|
|
1013
|
+
records.rows, performance.occupancies, validate=validate,
|
|
1014
|
+
)
|
|
1015
|
+
assert result is not None and result[0] == performance.matches_offset
|
|
1016
|
+
assert len(calls) > 1
|
|
1017
|
+
assert learning._balanced_counter_solution(
|
|
1018
|
+
records.rows, performance.occupancies, validate=lambda *args: True,
|
|
1019
|
+
) is None
|
|
@@ -344,7 +344,7 @@ def test_korean_name_reader_preserves_full_identifiers_and_rejects_suffixes(name
|
|
|
344
344
|
|
|
345
345
|
|
|
346
346
|
@pytest.mark.parametrize("prefix", (
|
|
347
|
-
"ผู้กล้า", "ひらがな", "カタカナ", "日本語", "简体汉字", "繁體漢字",
|
|
347
|
+
"\u0e48\u0e48Example", "\u0e49ไทย", "\u0e4bSample", "ผู้กล้า", "ひらがな", "カタカナ", "日本語", "简体汉字", "繁體漢字",
|
|
348
348
|
"𠮷野家", "ガ", "か\u3099", "葛\U000e0100", "KR한_ไทย漢カ",
|
|
349
349
|
))
|
|
350
350
|
def test_asian_script_names_confirm_complete_tables_without_normalization(prefix):
|
|
@@ -359,7 +359,7 @@ def test_asian_script_names_confirm_complete_tables_without_normalization(prefix
|
|
|
359
359
|
assert result.evidence.overall_layout.name_offset == 30
|
|
360
360
|
|
|
361
361
|
|
|
362
|
-
@pytest.mark.parametrize("name", ("ผู้กล้า", "𠮷野家", "葛\U000e0100", "か\u3099", "繁體汉字"))
|
|
362
|
+
@pytest.mark.parametrize("name", ("\u0e48\u0e48Example", "\u0e49ไทย", "\u0e4bSample", "ผู้กล้า", "𠮷野家", "葛\U000e0100", "か\u3099", "繁體汉字"))
|
|
363
363
|
def test_asian_name_readers_reject_every_suffix(name):
|
|
364
364
|
from bdo_toolkit.solare._details import _read_name
|
|
365
365
|
from bdo_toolkit.solare._discovery import _identifier_starts_here
|
|
@@ -371,7 +371,7 @@ def test_asian_name_readers_reject_every_suffix(name):
|
|
|
371
371
|
|
|
372
372
|
|
|
373
373
|
@pytest.mark.parametrize("name", (
|
|
374
|
-
"\u0e00", "\u0e3f", "\u3040", "\u30fb",
|
|
374
|
+
"\u0e00", "\u0e3f", "\u3040", "\u30fb",
|
|
375
375
|
"\u3099かな", "\u3000漢", "漢\u200b字", "A\ufe00", "A\U000e0100",
|
|
376
376
|
"\U0001f600", "\ue000", "𠮷" * 16, "ก" * 32,
|
|
377
377
|
))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/src/bdo_toolkit/_storage_destination_validation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bdo_toolkit-1.0.13 → bdo_toolkit-1.0.14}/tests/test_storage_unknown_destination_calibration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|