openepd 5.1.0__tar.gz → 5.2.0__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.
- {openepd-5.1.0 → openepd-5.2.0}/PKG-INFO +1 -1
- {openepd-5.1.0 → openepd-5.2.0}/pyproject.toml +1 -1
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/__version__.py +1 -1
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/common.py +43 -1
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/org.py +0 -1
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/concrete.py +11 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/enums.py +51 -3
- openepd-5.2.0/src/openepd/model/validation/enum.py +42 -0
- {openepd-5.1.0 → openepd-5.2.0}/LICENSE +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/README.md +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/average_dataset/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/average_dataset/generic_estimate_sync_api.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/average_dataset/industry_epd_sync_api.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/base_sync_client.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/category/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/category/dto.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/category/sync_api.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/common.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/base.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/common.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/meta.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/mf.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/dto/params.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/epd/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/epd/dto.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/epd/sync_api.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/errors.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/pcr/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/pcr/sync_api.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/sync_client.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/test/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/utils.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/bundle/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/bundle/base.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/bundle/model.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/bundle/reader.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/bundle/writer.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/compat/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/compat/compat_functional_validators.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/compat/pydantic.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/base.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/category.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/declaration.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/epd.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/factory.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/generic_estimate.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/geography.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/industry_epd.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/lcia.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/pcr.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/README.md +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/asphalt.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/base.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/concrete.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/accessories.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/aggregates.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/aluminium.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/asphalt.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/bulk_materials.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/cast_decks_and_underlayment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/cladding.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/cmu.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/common.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/conveying_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/electrical.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/electrical_transmission_and_distribution_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/electricity.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/finishes.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/fire_and_smoke_protection.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/furnishings.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/grouting.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/manufacturing_inputs.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/masonry.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/material_handling.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/mechanical.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/mechanical_insulation.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/mixins/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/mixins/conduit_mixin.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/network_infrastructure.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/openings.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/other_electrical_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/other_materials.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/plumbing.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/precast_concrete.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/sheathing.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/steel.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/thermal_moisture_protection.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/utility_piping.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/wood.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/wood_joists.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/accessories.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/aggregates.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/aluminium.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/asphalt.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/bulk_materials.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/cast_decks_and_underlayment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/cladding.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/cmu.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/concrete.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/conveying_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/electrical.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/electrical_transmission_and_distribution_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/electricity.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/finishes.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/fire_and_smoke_protection.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/furnishings.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/grouting.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/manufacturing_inputs.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/masonry.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/material_handling.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/mechanical.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/mechanical_insulation.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/network_infrastructure.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/openings.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/other_electrical_equipment.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/other_materials.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/plumbing.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/precast_concrete.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/sheathing.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/steel.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/thermal_moisture_protection.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/utility_piping.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/wood.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/wood_joists.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/standard.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/validation/__init__.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/validation/common.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/validation/numbers.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/validation/quantity.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/versioning.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/patch_pydantic.py +0 -0
- {openepd-5.1.0 → openepd-5.2.0}/src/openepd/py.typed +0 -0
@@ -38,6 +38,32 @@ class Amount(BaseOpenEpdSchema):
|
|
38
38
|
return f"{self.qty or ''} {self.unit or 'str'}".strip()
|
39
39
|
|
40
40
|
|
41
|
+
class Distribution(StrEnum):
|
42
|
+
"""
|
43
|
+
Distribution of the measured value.
|
44
|
+
|
45
|
+
* log-normal: Probability distribution of any random parameter whose natural log is normally distributed (the
|
46
|
+
PDF is gaussian).
|
47
|
+
* normal: Probability distribution of any random parameter whose value is normally distributed around the mean
|
48
|
+
(the PDF is gaussian).
|
49
|
+
* Continuous uniform probability distribution between minimum value and maximum value and "0" probability beyond
|
50
|
+
these.
|
51
|
+
* Probability distribution of any random parameter between minimum value and maximum value with the highest
|
52
|
+
probability at the average value of minimum plus maximum value. Linear change of probability between minimum,
|
53
|
+
maximum and average value.
|
54
|
+
* Means Impact is not known, but with >95% certainty the true value is below the declared value.
|
55
|
+
So [1e-6,"kgCFC11e",0,"max"] means the ODP was not exactly measured, but it is guaranteed to be below
|
56
|
+
1E-6 kg CO2e. It is acceptable to treat a 'max' distribution a normal or lognormal distribution with variation
|
57
|
+
0.1%. This is conservative, because the 'max' value is usually much greater than the true impact.
|
58
|
+
"""
|
59
|
+
|
60
|
+
LOG_NORMAL = "log-normal"
|
61
|
+
NORMAL = "normal"
|
62
|
+
UNIFORM = "uniform"
|
63
|
+
TRIANGULAR = "triangular"
|
64
|
+
MAX = "max"
|
65
|
+
|
66
|
+
|
41
67
|
class Measurement(BaseOpenEpdSchema):
|
42
68
|
"""A scientific value with units and uncertainty."""
|
43
69
|
|
@@ -46,7 +72,9 @@ class Measurement(BaseOpenEpdSchema):
|
|
46
72
|
rsd: pyd.PositiveFloat | None = pyd.Field(
|
47
73
|
description="Relative standard deviation, i.e. standard_deviation/mean", default=None
|
48
74
|
)
|
49
|
-
dist:
|
75
|
+
dist: Distribution | None = pyd.Field(
|
76
|
+
description="Statistical distribution of the measurement error.", default=None
|
77
|
+
)
|
50
78
|
|
51
79
|
|
52
80
|
class Ingredient(BaseOpenEpdSchema):
|
@@ -189,3 +217,17 @@ class RangeAmount(RangeFloat):
|
|
189
217
|
"""Structure representing a range of quantities."""
|
190
218
|
|
191
219
|
unit: str | None = pyd.Field(default=None, description="Unit of the range.")
|
220
|
+
|
221
|
+
|
222
|
+
class EnumGroupingAware:
|
223
|
+
"""
|
224
|
+
Mixin for enums to support groups.
|
225
|
+
|
226
|
+
With the groups, enum can group its values into more than one groups, so that the validator higher in code can check
|
227
|
+
for mutual exclusivity, for example that only one value from the group is permitted at the same time.
|
228
|
+
"""
|
229
|
+
|
230
|
+
@classmethod
|
231
|
+
def get_groupings(cls) -> list[list]:
|
232
|
+
"""Return logical groupings of the values."""
|
233
|
+
return []
|
@@ -69,7 +69,6 @@ class Plant(WithAttachmentsMixin, WithAltIdsMixin, BaseOpenEpdSchema):
|
|
69
69
|
description="Plus code (aka Open Location Code) of plant's location and "
|
70
70
|
"owner's web domain joined with `.`(dot).",
|
71
71
|
example="865P2W3V+3W.interface.com",
|
72
|
-
alias="pluscode",
|
73
72
|
default=None,
|
74
73
|
)
|
75
74
|
owner: Org | None = pyd.Field(description="Organization that owns the plant", default=None)
|
@@ -19,6 +19,7 @@ from openepd.compat.pydantic import pyd
|
|
19
19
|
from openepd.model.specs.base import BaseOpenEpdHierarchicalSpec, CodegenSpec
|
20
20
|
from openepd.model.specs.concrete import Cementitious, ConcreteTypicalApplication
|
21
21
|
from openepd.model.specs.generated.enums import AciExposureClass, CsaExposureClass, EnExposureClass
|
22
|
+
from openepd.model.validation.enum import exclusive_groups_validator_factory
|
22
23
|
from openepd.model.validation.numbers import RatioFloat
|
23
24
|
from openepd.model.validation.quantity import (
|
24
25
|
LengthInchStr,
|
@@ -172,3 +173,13 @@ class ConcreteV1(BaseOpenEpdHierarchicalSpec):
|
|
172
173
|
OilPatch: OilPatchV1 | None = None
|
173
174
|
ReadyMix: ReadyMixV1 | None = None
|
174
175
|
Shotcrete: ShotcreteV1 | None = None
|
176
|
+
|
177
|
+
_aci_exposure_classes_exclusive_groups_validator = pyd.validator("aci_exposure_classes", allow_reuse=True)(
|
178
|
+
exclusive_groups_validator_factory(AciExposureClass)
|
179
|
+
)
|
180
|
+
_en_exposure_classes_exclusive_groups_validator = pyd.validator("en_exposure_classes", allow_reuse=True)(
|
181
|
+
exclusive_groups_validator_factory(EnExposureClass)
|
182
|
+
)
|
183
|
+
_csa_exposure_classes_exclusive_groups_validator = pyd.validator("csa_exposure_classes", allow_reuse=True)(
|
184
|
+
exclusive_groups_validator_factory(CsaExposureClass)
|
185
|
+
)
|
@@ -15,6 +15,8 @@
|
|
15
15
|
#
|
16
16
|
from enum import StrEnum
|
17
17
|
|
18
|
+
from openepd.model.common import EnumGroupingAware
|
19
|
+
|
18
20
|
# Enums used
|
19
21
|
|
20
22
|
|
@@ -2182,7 +2184,7 @@ class FloorBoxFloorMaterial(StrEnum):
|
|
2182
2184
|
OTHER = "Other"
|
2183
2185
|
|
2184
2186
|
|
2185
|
-
class AciExposureClass(StrEnum):
|
2187
|
+
class AciExposureClass(EnumGroupingAware, StrEnum):
|
2186
2188
|
"""
|
2187
2189
|
American Concrete Institute concrete exposure classes.
|
2188
2190
|
|
@@ -2196,6 +2198,7 @@ class AciExposureClass(StrEnum):
|
|
2196
2198
|
* `aci.S2` - Exposed to <10000 ppm of SO4 in water and <2% SO4 in soil
|
2197
2199
|
* `aci.S3` - Exposed to >10000 ppm of SO4 in water or >2% SO4 in soil
|
2198
2200
|
|
2201
|
+
* `aci.C0` - Concrete dry or protected from moisture.
|
2199
2202
|
* `aci.C1` - Concrete in contact with moisture, but the external source of chloride does not reach it.
|
2200
2203
|
* `aci.C2` - Concrete subjected to moisture and an external source of chlorides such as deicing chemicals,
|
2201
2204
|
salt, brackish water, seawater, or spray from these sources.
|
@@ -2212,14 +2215,25 @@ class AciExposureClass(StrEnum):
|
|
2212
2215
|
S1 = "aci.S1"
|
2213
2216
|
S2 = "aci.S2"
|
2214
2217
|
S3 = "aci.S3"
|
2218
|
+
C0 = "aci.C1"
|
2215
2219
|
C1 = "aci.C1"
|
2216
2220
|
C2 = "aci.C2"
|
2217
2221
|
W0 = "aci.W0"
|
2218
2222
|
W1 = "aci.W1"
|
2219
2223
|
W2 = "aci.W2"
|
2220
2224
|
|
2225
|
+
@classmethod
|
2226
|
+
def get_groupings(cls) -> list[list]:
|
2227
|
+
"""Return logical groupings of the values."""
|
2228
|
+
return [
|
2229
|
+
[AciExposureClass.F0, AciExposureClass.F1, AciExposureClass.F2, AciExposureClass.F3],
|
2230
|
+
[AciExposureClass.S0, AciExposureClass.S1, AciExposureClass.S2, AciExposureClass.S3],
|
2231
|
+
[AciExposureClass.W0, AciExposureClass.W1],
|
2232
|
+
[AciExposureClass.C0, AciExposureClass.C1, AciExposureClass.C2],
|
2233
|
+
]
|
2234
|
+
|
2221
2235
|
|
2222
|
-
class CsaExposureClass(StrEnum):
|
2236
|
+
class CsaExposureClass(EnumGroupingAware, StrEnum):
|
2223
2237
|
"""
|
2224
2238
|
Canadian Standard Association concrete exposure classes.
|
2225
2239
|
|
@@ -2286,8 +2300,20 @@ class CsaExposureClass(StrEnum):
|
|
2286
2300
|
A_3 = "csa.A-3"
|
2287
2301
|
A_4 = "csa.A-4"
|
2288
2302
|
|
2303
|
+
@classmethod
|
2304
|
+
def get_groupings(cls) -> list[list]:
|
2305
|
+
"""Return logical groupings of the values."""
|
2306
|
+
return [
|
2307
|
+
[CsaExposureClass.C_XL],
|
2308
|
+
[CsaExposureClass.C_1, CsaExposureClass.C_2, CsaExposureClass.C_3, CsaExposureClass.C_4],
|
2309
|
+
[CsaExposureClass.F_1, CsaExposureClass.F2],
|
2310
|
+
[CsaExposureClass.N],
|
2311
|
+
[CsaExposureClass.A_1, CsaExposureClass.A_2, CsaExposureClass.A_3, CsaExposureClass.A_4],
|
2312
|
+
[CsaExposureClass.S_1, CsaExposureClass.S_2, CsaExposureClass.S_3],
|
2313
|
+
]
|
2289
2314
|
|
2290
|
-
|
2315
|
+
|
2316
|
+
class EnExposureClass(EnumGroupingAware, StrEnum):
|
2291
2317
|
"""
|
2292
2318
|
EN 206 Class (Europe).
|
2293
2319
|
|
@@ -2348,6 +2374,28 @@ class EnExposureClass(StrEnum):
|
|
2348
2374
|
en206_XA2 = "en206.XA2"
|
2349
2375
|
en206_XA3 = "en206.XA3"
|
2350
2376
|
|
2377
|
+
@classmethod
|
2378
|
+
def get_groupings(cls) -> list[list]:
|
2379
|
+
"""Return logical groupings of the values."""
|
2380
|
+
return [
|
2381
|
+
[EnExposureClass.en206_X0],
|
2382
|
+
[
|
2383
|
+
EnExposureClass.en206_XC1,
|
2384
|
+
EnExposureClass.en206_XC2,
|
2385
|
+
EnExposureClass.en206_XC3,
|
2386
|
+
EnExposureClass.en206_XC4,
|
2387
|
+
],
|
2388
|
+
[EnExposureClass.en206_XD1, EnExposureClass.en206_XD2, EnExposureClass.en206_XD3],
|
2389
|
+
[EnExposureClass.en206_XS1, EnExposureClass.en206_XS2, EnExposureClass.en206_XS3],
|
2390
|
+
[
|
2391
|
+
EnExposureClass.en206_XF1,
|
2392
|
+
EnExposureClass.en206_XF2,
|
2393
|
+
EnExposureClass.en206_XF3,
|
2394
|
+
EnExposureClass.en206_XF4,
|
2395
|
+
],
|
2396
|
+
[EnExposureClass.en206_XA1, EnExposureClass.en206_XA2, EnExposureClass.en206_XA3],
|
2397
|
+
]
|
2398
|
+
|
2351
2399
|
|
2352
2400
|
class AggregateWeightClassification(StrEnum):
|
2353
2401
|
"""
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#
|
2
|
+
# Copyright 2024 by C Change Labs Inc. www.c-change-labs.com
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
#
|
16
|
+
from typing import Any, Callable
|
17
|
+
|
18
|
+
from openepd.model.common import EnumGroupingAware
|
19
|
+
|
20
|
+
|
21
|
+
def exclusive_groups_validator_factory(enum_type: type[EnumGroupingAware]) -> Callable[[type, Any], Any]:
|
22
|
+
"""
|
23
|
+
Create an exclusive groups validator.
|
24
|
+
|
25
|
+
If we have a certain enum TheEnum, and a field of list[TheEnum], where list can contain only one value of each of
|
26
|
+
the groups, this validator should be used. For example, ACI exposure classes for concrete specify various
|
27
|
+
parameters such as water resistance, chemical resistance, etc., and the list of classes can have 0 or 1 from each
|
28
|
+
group.
|
29
|
+
|
30
|
+
:param enum_type:Enum type which supports groupings.
|
31
|
+
:return:value, or raises ValueError if not allowed combination is given.
|
32
|
+
"""
|
33
|
+
|
34
|
+
def enum_exclusive_grouping_validator(cls, value: list | None) -> list | None:
|
35
|
+
for grouping in enum_type.get_groupings():
|
36
|
+
matching_from_group = [v for v in (value or []) if v in grouping]
|
37
|
+
if len(matching_from_group) > 1:
|
38
|
+
raise ValueError(f"Values {', '.join(matching_from_group)} are not allowed together.")
|
39
|
+
|
40
|
+
return value
|
41
|
+
|
42
|
+
return enum_exclusive_grouping_validator
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/api/average_dataset/generic_estimate_sync_api.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
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/cast_decks_and_underlayment.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
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/fire_and_smoke_protection.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
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/other_electrical_equipment.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/generated/thermal_moisture_protection.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
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/cast_decks_and_underlayment.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
|
{openepd-5.1.0 → openepd-5.2.0}/src/openepd/model/specs/range/thermal_moisture_protection.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
|