mergeron 2024.738963.0__py3-none-any.whl → 2024.738973.0__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.
Potentially problematic release.
This version of mergeron might be problematic. Click here for more details.
- mergeron/core/__init__.py +18 -8
- mergeron/core/guidelines_boundaries.py +87 -897
- mergeron/core/guidelines_boundary_functions.py +826 -0
- mergeron/core/{guidelines_boundaries_specialized_functions.py → guidelines_boundary_functions_extra.py} +48 -9
- mergeron/gen/__init__.py +20 -37
- mergeron/gen/{_data_generation_functions_nonpublic.py → _data_generation_functions.py} +77 -19
- mergeron/gen/data_generation.py +17 -14
- mergeron/gen/market_sample.py +79 -0
- mergeron/gen/upp_tests.py +99 -66
- {mergeron-2024.738963.0.dist-info → mergeron-2024.738973.0.dist-info}/METADATA +1 -1
- {mergeron-2024.738963.0.dist-info → mergeron-2024.738973.0.dist-info}/RECORD +12 -10
- {mergeron-2024.738963.0.dist-info → mergeron-2024.738973.0.dist-info}/WHEEL +0 -0
mergeron/core/__init__.py
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from dataclasses import dataclass
|
|
3
4
|
from importlib.metadata import version
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
import numpy as np
|
|
7
|
+
from attrs import Attribute, field, frozen, validators
|
|
8
|
+
from numpy.typing import NDArray
|
|
6
9
|
|
|
7
10
|
from .. import _PKG_NAME, RECConstants, UPPAggrSelector # noqa: TID252
|
|
8
11
|
|
|
9
12
|
__version__ = version(_PKG_NAME)
|
|
10
13
|
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class GuidelinesBoundary:
|
|
17
|
+
coordinates: NDArray[np.float64]
|
|
18
|
+
area: float
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _divr_value_validator(
|
|
13
22
|
_instance: UPPBoundarySpec, _attribute: Attribute[float], _value: float, /
|
|
14
23
|
) -> None:
|
|
15
24
|
if not 0 <= _value <= 1:
|
|
@@ -38,15 +47,15 @@ def _rec_spec_validator(
|
|
|
38
47
|
)
|
|
39
48
|
|
|
40
49
|
|
|
41
|
-
@
|
|
50
|
+
@frozen
|
|
42
51
|
class UPPBoundarySpec:
|
|
43
|
-
|
|
52
|
+
diversion_ratio: float = field(
|
|
44
53
|
kw_only=False,
|
|
45
|
-
default=0.
|
|
46
|
-
validator=(validators.instance_of(float),
|
|
54
|
+
default=0.045,
|
|
55
|
+
validator=(validators.instance_of(float), _divr_value_validator),
|
|
47
56
|
)
|
|
48
57
|
rec: float = field(
|
|
49
|
-
kw_only=False, default=0.
|
|
58
|
+
kw_only=False, default=0.855, validator=validators.instance_of(float)
|
|
50
59
|
)
|
|
51
60
|
|
|
52
61
|
agg_method: UPPAggrSelector = field(
|
|
@@ -54,11 +63,12 @@ class UPPBoundarySpec:
|
|
|
54
63
|
default=UPPAggrSelector.MAX,
|
|
55
64
|
validator=validators.instance_of(UPPAggrSelector),
|
|
56
65
|
)
|
|
66
|
+
|
|
57
67
|
recapture_form: RECConstants | None = field(
|
|
58
68
|
kw_only=True,
|
|
59
69
|
default=RECConstants.INOUT,
|
|
60
70
|
validator=(
|
|
61
|
-
validators.
|
|
71
|
+
validators.instance_of((type(None), RECConstants)),
|
|
62
72
|
_rec_spec_validator,
|
|
63
73
|
),
|
|
64
74
|
)
|