openepd 6.14.0__py3-none-any.whl → 6.15.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.
Files changed (60) hide show
  1. openepd/__version__.py +1 -1
  2. openepd/api/average_dataset/generic_estimate_sync_api.py +2 -1
  3. openepd/api/average_dataset/industry_epd_sync_api.py +2 -1
  4. openepd/api/base_sync_client.py +10 -8
  5. openepd/api/common.py +17 -11
  6. openepd/api/dto/common.py +1 -1
  7. openepd/api/epd/sync_api.py +2 -1
  8. openepd/bundle/base.py +5 -4
  9. openepd/bundle/reader.py +13 -7
  10. openepd/bundle/writer.py +11 -6
  11. openepd/compat/pydantic.py +1 -1
  12. openepd/m49/__init__.py +2 -0
  13. openepd/m49/const.py +1 -1
  14. openepd/m49/utils.py +16 -10
  15. openepd/model/base.py +19 -15
  16. openepd/model/common.py +22 -19
  17. openepd/model/declaration.py +2 -2
  18. openepd/model/epd.py +2 -1
  19. openepd/model/factory.py +5 -3
  20. openepd/model/lcia.py +7 -6
  21. openepd/model/org.py +6 -3
  22. openepd/model/pcr.py +2 -2
  23. openepd/model/specs/__init__.py +36 -0
  24. openepd/model/specs/asphalt.py +3 -3
  25. openepd/model/specs/base.py +2 -1
  26. openepd/model/specs/enums.py +695 -695
  27. openepd/model/specs/range/accessories.py +1 -1
  28. openepd/model/specs/range/aluminium.py +1 -1
  29. openepd/model/specs/range/cladding.py +10 -10
  30. openepd/model/specs/range/cmu.py +0 -3
  31. openepd/model/specs/range/concrete.py +1 -1
  32. openepd/model/specs/range/conveying_equipment.py +2 -2
  33. openepd/model/specs/range/electrical.py +18 -18
  34. openepd/model/specs/range/electrical_transmission_and_distribution_equipment.py +1 -1
  35. openepd/model/specs/range/finishes.py +16 -16
  36. openepd/model/specs/range/fire_and_smoke_protection.py +3 -3
  37. openepd/model/specs/range/furnishings.py +7 -7
  38. openepd/model/specs/range/manufacturing_inputs.py +4 -4
  39. openepd/model/specs/range/masonry.py +1 -1
  40. openepd/model/specs/range/mechanical.py +6 -6
  41. openepd/model/specs/range/network_infrastructure.py +3 -3
  42. openepd/model/specs/range/openings.py +17 -17
  43. openepd/model/specs/range/other_materials.py +4 -4
  44. openepd/model/specs/range/plumbing.py +5 -5
  45. openepd/model/specs/range/precast_concrete.py +2 -2
  46. openepd/model/specs/range/steel.py +16 -11
  47. openepd/model/specs/range/thermal_moisture_protection.py +12 -12
  48. openepd/model/specs/range/wood.py +4 -7
  49. openepd/model/specs/singular/__init__.py +109 -1
  50. openepd/model/specs/singular/aluminium.py +2 -1
  51. openepd/model/specs/singular/steel.py +10 -2
  52. openepd/model/validation/common.py +10 -6
  53. openepd/model/validation/enum.py +4 -2
  54. openepd/model/validation/quantity.py +8 -1
  55. openepd/model/versioning.py +8 -6
  56. openepd/patch_pydantic.py +2 -1
  57. {openepd-6.14.0.dist-info → openepd-6.15.0.dist-info}/METADATA +1 -3
  58. {openepd-6.14.0.dist-info → openepd-6.15.0.dist-info}/RECORD +60 -60
  59. {openepd-6.14.0.dist-info → openepd-6.15.0.dist-info}/WHEEL +1 -1
  60. {openepd-6.14.0.dist-info → openepd-6.15.0.dist-info}/LICENSE +0 -0
openepd/model/lcia.py CHANGED
@@ -202,14 +202,15 @@ class ScopeSet(BaseOpenEpdSchema):
202
202
  def _unit_validator(cls, values: dict[str, Any]) -> dict[str, Any]:
203
203
  all_units = set()
204
204
 
205
- for k, v in values.items():
205
+ for _k, v in values.items():
206
206
  if isinstance(v, Measurement):
207
207
  all_units.add(v.unit)
208
208
 
209
209
  if not cls.allowed_units:
210
210
  # For unknown units - only units should be the same across all measurements (textually)
211
211
  if len(all_units) > 1:
212
- raise ValueError("All scopes and measurements should be expressed in the same unit.")
212
+ msg = "All scopes and measurements should be expressed in the same unit."
213
+ raise ValueError(msg)
213
214
  else:
214
215
  # might be multiple variations of the same unit (kgCFC-11e, kgCFC11e)
215
216
  if len(all_units) > 1 and ExternalValidationConfig.QUANTITY_VALIDATOR:
@@ -231,9 +232,8 @@ class ScopeSet(BaseOpenEpdSchema):
231
232
  except ValueError:
232
233
  ...
233
234
  if not matched_unit:
234
- raise ValueError(
235
- f"'{', '.join(allowed_units)}' is only allowed unit for this scopeset. Provided '{unit}'"
236
- )
235
+ msg = f"'{', '.join(allowed_units)}' is only allowed unit for this scopeset. Provided '{unit}'"
236
+ raise ValueError(msg)
237
237
 
238
238
  return values
239
239
 
@@ -288,7 +288,8 @@ class ScopesetByNameBase(BaseOpenEpdSchema, extra="allow"):
288
288
  case dict():
289
289
  values[f] = ScopeSet(**extra_scopeset)
290
290
  case _:
291
- raise ValueError(f"{f} must be a ScopeSet schema")
291
+ msg = f"{f} must be a ScopeSet schema"
292
+ raise ValueError(msg)
292
293
 
293
294
  return values
294
295
 
openepd/model/org.py CHANGED
@@ -124,13 +124,16 @@ class Plant(PlantRef, WithAttachmentsMixin, WithAltIdsMixin):
124
124
  try:
125
125
  pluscode, web_domain = v.split(".", maxsplit=1)
126
126
  except ValueError as e:
127
- raise ValueError("Incorrectly formed id: should be pluscode.owner_web_domain") from e
127
+ msg = "Incorrectly formed id: should be pluscode.owner_web_domain"
128
+ raise ValueError(msg) from e
128
129
 
129
130
  if not openlocationcode.isValid(pluscode):
130
- raise ValueError("Incorrect pluscode for plant")
131
+ msg = "Incorrect pluscode for plant"
132
+ raise ValueError(msg)
131
133
 
132
134
  if not web_domain:
133
- raise ValueError("Incorrect web_domain for plant")
135
+ msg = "Incorrect web_domain for plant"
136
+ raise ValueError(msg)
134
137
  return v
135
138
 
136
139
  class Config(BaseOpenEpdSchema.Config):
openepd/model/pcr.py CHANGED
@@ -91,12 +91,12 @@ class Pcr(WithAttachmentsMixin, WithAltIdsMixin, BaseOpenEpdSchema):
91
91
  default=None,
92
92
  )
93
93
  date_of_issue: datetime.datetime | None = pyd.Field(
94
- example=datetime.datetime(day=11, month=9, year=2019, tzinfo=datetime.timezone.utc),
94
+ example=datetime.datetime(day=11, month=9, year=2019, tzinfo=datetime.UTC),
95
95
  default=None,
96
96
  description="First day on which the document is valid",
97
97
  )
98
98
  valid_until: datetime.datetime | None = pyd.Field(
99
- example=datetime.datetime(day=11, month=9, year=2019, tzinfo=datetime.timezone.utc),
99
+ example=datetime.datetime(day=11, month=9, year=2019, tzinfo=datetime.UTC),
100
100
  default=None,
101
101
  description="Last day on which the document is valid",
102
102
  )
@@ -13,6 +13,42 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
+ __all__ = [
17
+ "CMUV1",
18
+ "AccessoriesV1",
19
+ "AggregatesV1",
20
+ "AluminiumV1",
21
+ "AsphaltV1",
22
+ "BulkMaterialsV1",
23
+ "CastDecksAndUnderlaymentV1",
24
+ "CladdingV1",
25
+ "ConcreteV1",
26
+ "ConveyingEquipmentV1",
27
+ "ElectricalTransmissionAndDistributionEquipmentV1",
28
+ "ElectricalV1",
29
+ "ElectricityV1",
30
+ "FinishesV1",
31
+ "FireAndSmokeProtectionV1",
32
+ "FurnishingsV1",
33
+ "GroutingV1",
34
+ "ManufacturingInputsV1",
35
+ "MasonryV1",
36
+ "MaterialHandlingV1",
37
+ "MechanicalInsulationV1",
38
+ "MechanicalV1",
39
+ "NetworkInfrastructureV1",
40
+ "OpeningsV1",
41
+ "OtherElectricalEquipmentV1",
42
+ "OtherMaterialsV1",
43
+ "PlumbingV1",
44
+ "PrecastConcreteV1",
45
+ "SheathingV1",
46
+ "SteelV1",
47
+ "ThermalMoistureProtectionV1",
48
+ "UtilityPipingV1",
49
+ "WoodJoistsV1",
50
+ "WoodV1",
51
+ ]
16
52
 
17
53
  from openepd.model.specs.singular.accessories import AccessoriesV1
18
54
  from openepd.model.specs.singular.aggregates import AggregatesV1
@@ -50,13 +50,13 @@ class AsphaltV1(BaseOpenEpdHierarchicalSpec):
50
50
  )
51
51
 
52
52
  asphalt_rap: RatioFloat | None = pyd.Field(
53
- default=None, description="Percent of mixture that has been replaced by recycled " "asphalt pavement (RAP)."
53
+ default=None, description="Percent of mixture that has been replaced by recycled asphalt pavement (RAP)."
54
54
  )
55
55
  asphalt_ras: RatioFloat | None = pyd.Field(
56
- default=None, description="Percent of mixture that has been replaced by recycled " "asphalt shingles (RAS)."
56
+ default=None, description="Percent of mixture that has been replaced by recycled asphalt shingles (RAS)."
57
57
  )
58
58
  asphalt_ground_tire_rubber: RatioFloat | None = pyd.Field(
59
- default=None, description="Percent of mixture that has been replaced " "by ground tire rubber (GTR)."
59
+ default=None, description="Percent of mixture that has been replaced by ground tire rubber (GTR)."
60
60
  )
61
61
 
62
62
  asphalt_max_temperature: TemperatureCStr | None = pyd.Field(
@@ -38,7 +38,8 @@ class BaseOpenEpdHierarchicalSpec(BaseOpenEpdSpec, WithExtVersionMixin):
38
38
  # ensure that all the concrete spec objects fail on creations if they dont have _EXT_VERSION declared to
39
39
  # something meaningful
40
40
  if not hasattr(self, "_EXT_VERSION") or self._EXT_VERSION is None:
41
- raise ValueError(f"Class {self.__class__} must declare an extension version")
41
+ msg = f"Class {self.__class__} must declare an extension version"
42
+ raise ValueError(msg)
42
43
  Version.parse_version(self._EXT_VERSION) # validate format correctness
43
44
  super().__init__(**{"ext_version": self._EXT_VERSION, **data})
44
45