photo-stack-finder 0.1.7__py3-none-any.whl → 0.1.8__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.
- orchestrator/__init__.py +2 -2
- orchestrator/app.py +6 -11
- orchestrator/build_pipeline.py +19 -21
- orchestrator/orchestrator_runner.py +11 -8
- orchestrator/pipeline_builder.py +126 -126
- orchestrator/pipeline_orchestrator.py +604 -604
- orchestrator/review_persistence.py +162 -162
- orchestrator/static/orchestrator.css +76 -76
- orchestrator/static/orchestrator.html +11 -5
- orchestrator/static/orchestrator.js +3 -1
- overlap_metrics/__init__.py +1 -1
- overlap_metrics/config.py +135 -135
- overlap_metrics/core.py +284 -284
- overlap_metrics/estimators.py +292 -292
- overlap_metrics/metrics.py +307 -307
- overlap_metrics/registry.py +99 -99
- overlap_metrics/utils.py +104 -104
- photo_compare/__init__.py +1 -1
- photo_compare/base.py +285 -285
- photo_compare/config.py +225 -225
- photo_compare/distance.py +15 -15
- photo_compare/feature_methods.py +173 -173
- photo_compare/file_hash.py +29 -29
- photo_compare/hash_methods.py +99 -99
- photo_compare/histogram_methods.py +118 -118
- photo_compare/pixel_methods.py +58 -58
- photo_compare/structural_methods.py +104 -104
- photo_compare/types.py +28 -28
- {photo_stack_finder-0.1.7.dist-info → photo_stack_finder-0.1.8.dist-info}/METADATA +21 -22
- photo_stack_finder-0.1.8.dist-info/RECORD +75 -0
- scripts/orchestrate.py +12 -10
- utils/__init__.py +4 -3
- utils/base_pipeline_stage.py +171 -171
- utils/base_ports.py +176 -176
- utils/benchmark_utils.py +823 -823
- utils/channel.py +74 -74
- utils/comparison_gates.py +40 -21
- utils/compute_benchmarks.py +355 -355
- utils/compute_identical.py +94 -24
- utils/compute_indices.py +235 -235
- utils/compute_perceptual_hash.py +127 -127
- utils/compute_perceptual_match.py +240 -240
- utils/compute_sha_bins.py +64 -20
- utils/compute_template_similarity.py +1 -1
- utils/compute_versions.py +483 -483
- utils/config.py +8 -5
- utils/data_io.py +83 -83
- utils/graph_context.py +44 -44
- utils/logger.py +2 -2
- utils/models.py +2 -2
- utils/photo_file.py +90 -91
- utils/pipeline_graph.py +334 -334
- utils/pipeline_stage.py +408 -408
- utils/plot_helpers.py +123 -123
- utils/ports.py +136 -136
- utils/progress.py +415 -415
- utils/report_builder.py +139 -139
- utils/review_types.py +55 -55
- utils/review_utils.py +10 -19
- utils/sequence.py +10 -8
- utils/sequence_clustering.py +1 -1
- utils/template.py +57 -57
- utils/template_parsing.py +71 -0
- photo_stack_finder-0.1.7.dist-info/RECORD +0 -74
- {photo_stack_finder-0.1.7.dist-info → photo_stack_finder-0.1.8.dist-info}/WHEEL +0 -0
- {photo_stack_finder-0.1.7.dist-info → photo_stack_finder-0.1.8.dist-info}/entry_points.txt +0 -0
- {photo_stack_finder-0.1.7.dist-info → photo_stack_finder-0.1.8.dist-info}/licenses/LICENSE +0 -0
- {photo_stack_finder-0.1.7.dist-info → photo_stack_finder-0.1.8.dist-info}/top_level.txt +0 -0
overlap_metrics/config.py
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
"""Self-contained configuration for overlap_metrics library.
|
|
2
|
-
|
|
3
|
-
This module provides internal configuration with frozen dataclasses.
|
|
4
|
-
Parent projects can customize settings via the configure() function.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from __future__ import annotations
|
|
8
|
-
|
|
9
|
-
from dataclasses import dataclass
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@dataclass(frozen=True)
|
|
13
|
-
class NumericsConfig:
|
|
14
|
-
"""Numerical computation constants."""
|
|
15
|
-
|
|
16
|
-
# Floating point precision
|
|
17
|
-
DTYPE_FLOAT: str = "float64"
|
|
18
|
-
|
|
19
|
-
# Safe floors for logarithms and divisions
|
|
20
|
-
LOG_FLOOR: float = 1e-300
|
|
21
|
-
DIVISION_FLOOR: float = 1e-300
|
|
22
|
-
|
|
23
|
-
# Integration tolerance for PDF normalization check
|
|
24
|
-
INTEGRAL_TOLERANCE: float = 1e-3
|
|
25
|
-
|
|
26
|
-
# Default clipping bounds for scores
|
|
27
|
-
SCORE_MIN: float = 0.0
|
|
28
|
-
SCORE_MAX: float = 1.0
|
|
29
|
-
|
|
30
|
-
# Default epsilon for Beta/Logit transforms
|
|
31
|
-
TRANSFORM_EPS: float = 1e-6
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@dataclass(frozen=True)
|
|
35
|
-
class DefaultConfig:
|
|
36
|
-
"""Default parameters for estimators and metrics."""
|
|
37
|
-
|
|
38
|
-
# Grid parameters
|
|
39
|
-
DEFAULT_N_GRID: int = 2000
|
|
40
|
-
DEFAULT_GRID_MODE: str = "uniform"
|
|
41
|
-
|
|
42
|
-
# Histogram estimator
|
|
43
|
-
HIST_N_BINS: int = 100
|
|
44
|
-
HIST_SMOOTH: bool = True
|
|
45
|
-
|
|
46
|
-
# Beta estimator
|
|
47
|
-
BETA_EPS: float = 1e-6
|
|
48
|
-
|
|
49
|
-
# Logit KDE estimator
|
|
50
|
-
LOGIT_KDE_EPS: float = 1e-6
|
|
51
|
-
|
|
52
|
-
# Bootstrap parameters
|
|
53
|
-
BOOTSTRAP_N_BOOT: int = 500
|
|
54
|
-
BOOTSTRAP_CI: float = 0.95
|
|
55
|
-
BOOTSTRAP_RANDOM_STATE: int = 42
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
@dataclass(frozen=True)
|
|
59
|
-
class ValidationConfig:
|
|
60
|
-
"""Validation and error checking parameters."""
|
|
61
|
-
|
|
62
|
-
# Minimum sample sizes
|
|
63
|
-
MIN_SAMPLES: int = 2
|
|
64
|
-
|
|
65
|
-
# Maximum allowed grid size (memory protection)
|
|
66
|
-
MAX_GRID_SIZE: int = 100_000
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
@dataclass(frozen=True)
|
|
70
|
-
class OverlapMetricsConfig:
|
|
71
|
-
"""Complete configuration for overlap_metrics library."""
|
|
72
|
-
|
|
73
|
-
numerics: NumericsConfig
|
|
74
|
-
defaults: DefaultConfig
|
|
75
|
-
validation: ValidationConfig
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# Global configuration instance (can be replaced via configure())
|
|
79
|
-
_config = OverlapMetricsConfig(numerics=NumericsConfig(), defaults=DefaultConfig(), validation=ValidationConfig())
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def get_config() -> OverlapMetricsConfig:
|
|
83
|
-
"""Get current configuration instance.
|
|
84
|
-
|
|
85
|
-
Returns:
|
|
86
|
-
Current OverlapMetricsConfig instance
|
|
87
|
-
"""
|
|
88
|
-
return _config
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def _update_convenience_accessors() -> None:
|
|
92
|
-
"""Update module-level convenience accessors after configure()."""
|
|
93
|
-
global NUMERICS, DEFAULTS, VALIDATION # noqa: PLW0603
|
|
94
|
-
# Standard library config pattern (like logging.basicConfig)
|
|
95
|
-
config = get_config()
|
|
96
|
-
NUMERICS = config.numerics
|
|
97
|
-
DEFAULTS = config.defaults
|
|
98
|
-
VALIDATION = config.validation
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def configure(
|
|
102
|
-
numerics: NumericsConfig | None = None,
|
|
103
|
-
defaults: DefaultConfig | None = None,
|
|
104
|
-
validation: ValidationConfig | None = None,
|
|
105
|
-
) -> None:
|
|
106
|
-
"""Configure overlap_metrics library settings.
|
|
107
|
-
|
|
108
|
-
Creates new frozen config instances and updates the global configuration.
|
|
109
|
-
Pass None for any section to keep existing settings.
|
|
110
|
-
|
|
111
|
-
Args:
|
|
112
|
-
numerics: Numerical computation settings
|
|
113
|
-
defaults: Default parameters for estimators/metrics
|
|
114
|
-
validation: Validation parameters
|
|
115
|
-
|
|
116
|
-
Example:
|
|
117
|
-
>>> from overlap_metrics.config import configure, DefaultConfig
|
|
118
|
-
>>> configure(defaults=DefaultConfig(DEFAULT_N_GRID=5000))
|
|
119
|
-
"""
|
|
120
|
-
global _config # noqa: PLW0603
|
|
121
|
-
# Standard library config pattern (like logging.basicConfig)
|
|
122
|
-
|
|
123
|
-
new_numerics = numerics if numerics is not None else _config.numerics
|
|
124
|
-
new_defaults = defaults if defaults is not None else _config.defaults
|
|
125
|
-
new_validation = validation if validation is not None else _config.validation
|
|
126
|
-
|
|
127
|
-
_config = OverlapMetricsConfig(numerics=new_numerics, defaults=new_defaults, validation=new_validation)
|
|
128
|
-
|
|
129
|
-
_update_convenience_accessors()
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
# Convenience accessors for backward compatibility
|
|
133
|
-
NUMERICS = get_config().numerics
|
|
134
|
-
DEFAULTS = get_config().defaults
|
|
135
|
-
VALIDATION = get_config().validation
|
|
1
|
+
"""Self-contained configuration for overlap_metrics library.
|
|
2
|
+
|
|
3
|
+
This module provides internal configuration with frozen dataclasses.
|
|
4
|
+
Parent projects can customize settings via the configure() function.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class NumericsConfig:
|
|
14
|
+
"""Numerical computation constants."""
|
|
15
|
+
|
|
16
|
+
# Floating point precision
|
|
17
|
+
DTYPE_FLOAT: str = "float64"
|
|
18
|
+
|
|
19
|
+
# Safe floors for logarithms and divisions
|
|
20
|
+
LOG_FLOOR: float = 1e-300
|
|
21
|
+
DIVISION_FLOOR: float = 1e-300
|
|
22
|
+
|
|
23
|
+
# Integration tolerance for PDF normalization check
|
|
24
|
+
INTEGRAL_TOLERANCE: float = 1e-3
|
|
25
|
+
|
|
26
|
+
# Default clipping bounds for scores
|
|
27
|
+
SCORE_MIN: float = 0.0
|
|
28
|
+
SCORE_MAX: float = 1.0
|
|
29
|
+
|
|
30
|
+
# Default epsilon for Beta/Logit transforms
|
|
31
|
+
TRANSFORM_EPS: float = 1e-6
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass(frozen=True)
|
|
35
|
+
class DefaultConfig:
|
|
36
|
+
"""Default parameters for estimators and metrics."""
|
|
37
|
+
|
|
38
|
+
# Grid parameters
|
|
39
|
+
DEFAULT_N_GRID: int = 2000
|
|
40
|
+
DEFAULT_GRID_MODE: str = "uniform"
|
|
41
|
+
|
|
42
|
+
# Histogram estimator
|
|
43
|
+
HIST_N_BINS: int = 100
|
|
44
|
+
HIST_SMOOTH: bool = True
|
|
45
|
+
|
|
46
|
+
# Beta estimator
|
|
47
|
+
BETA_EPS: float = 1e-6
|
|
48
|
+
|
|
49
|
+
# Logit KDE estimator
|
|
50
|
+
LOGIT_KDE_EPS: float = 1e-6
|
|
51
|
+
|
|
52
|
+
# Bootstrap parameters
|
|
53
|
+
BOOTSTRAP_N_BOOT: int = 500
|
|
54
|
+
BOOTSTRAP_CI: float = 0.95
|
|
55
|
+
BOOTSTRAP_RANDOM_STATE: int = 42
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass(frozen=True)
|
|
59
|
+
class ValidationConfig:
|
|
60
|
+
"""Validation and error checking parameters."""
|
|
61
|
+
|
|
62
|
+
# Minimum sample sizes
|
|
63
|
+
MIN_SAMPLES: int = 2
|
|
64
|
+
|
|
65
|
+
# Maximum allowed grid size (memory protection)
|
|
66
|
+
MAX_GRID_SIZE: int = 100_000
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@dataclass(frozen=True)
|
|
70
|
+
class OverlapMetricsConfig:
|
|
71
|
+
"""Complete configuration for overlap_metrics library."""
|
|
72
|
+
|
|
73
|
+
numerics: NumericsConfig
|
|
74
|
+
defaults: DefaultConfig
|
|
75
|
+
validation: ValidationConfig
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# Global configuration instance (can be replaced via configure())
|
|
79
|
+
_config = OverlapMetricsConfig(numerics=NumericsConfig(), defaults=DefaultConfig(), validation=ValidationConfig())
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def get_config() -> OverlapMetricsConfig:
|
|
83
|
+
"""Get current configuration instance.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
Current OverlapMetricsConfig instance
|
|
87
|
+
"""
|
|
88
|
+
return _config
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _update_convenience_accessors() -> None:
|
|
92
|
+
"""Update module-level convenience accessors after configure()."""
|
|
93
|
+
global NUMERICS, DEFAULTS, VALIDATION # noqa: PLW0603
|
|
94
|
+
# Standard library config pattern (like logging.basicConfig)
|
|
95
|
+
config = get_config()
|
|
96
|
+
NUMERICS = config.numerics
|
|
97
|
+
DEFAULTS = config.defaults
|
|
98
|
+
VALIDATION = config.validation
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def configure(
|
|
102
|
+
numerics: NumericsConfig | None = None,
|
|
103
|
+
defaults: DefaultConfig | None = None,
|
|
104
|
+
validation: ValidationConfig | None = None,
|
|
105
|
+
) -> None:
|
|
106
|
+
"""Configure overlap_metrics library settings.
|
|
107
|
+
|
|
108
|
+
Creates new frozen config instances and updates the global configuration.
|
|
109
|
+
Pass None for any section to keep existing settings.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
numerics: Numerical computation settings
|
|
113
|
+
defaults: Default parameters for estimators/metrics
|
|
114
|
+
validation: Validation parameters
|
|
115
|
+
|
|
116
|
+
Example:
|
|
117
|
+
>>> from overlap_metrics.config import configure, DefaultConfig
|
|
118
|
+
>>> configure(defaults=DefaultConfig(DEFAULT_N_GRID=5000))
|
|
119
|
+
"""
|
|
120
|
+
global _config # noqa: PLW0603
|
|
121
|
+
# Standard library config pattern (like logging.basicConfig)
|
|
122
|
+
|
|
123
|
+
new_numerics = numerics if numerics is not None else _config.numerics
|
|
124
|
+
new_defaults = defaults if defaults is not None else _config.defaults
|
|
125
|
+
new_validation = validation if validation is not None else _config.validation
|
|
126
|
+
|
|
127
|
+
_config = OverlapMetricsConfig(numerics=new_numerics, defaults=new_defaults, validation=new_validation)
|
|
128
|
+
|
|
129
|
+
_update_convenience_accessors()
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# Convenience accessors for backward compatibility
|
|
133
|
+
NUMERICS = get_config().numerics
|
|
134
|
+
DEFAULTS = get_config().defaults
|
|
135
|
+
VALIDATION = get_config().validation
|