antelope-interface 0.3.1__tar.gz → 0.3.2__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.
Files changed (43) hide show
  1. {antelope_interface-0.3.1/src/antelope_interface.egg-info → antelope_interface-0.3.2}/PKG-INFO +1 -1
  2. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/pyproject.toml +1 -1
  3. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/setup.py +2 -0
  4. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/__init__.py +1 -1
  5. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/ibackground.py +7 -0
  6. antelope_interface-0.3.2/src/antelope/qdb/qdb.py +32 -0
  7. antelope_interface-0.3.2/src/antelope/qdb/units.py +15 -0
  8. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/base.py +4 -1
  9. antelope_interface-0.3.2/src/antelope/refs/tests/__init__.py +0 -0
  10. {antelope_interface-0.3.1 → antelope_interface-0.3.2/src/antelope_interface.egg-info}/PKG-INFO +1 -1
  11. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope_interface.egg-info/SOURCES.txt +3 -0
  12. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/LICENSE +0 -0
  13. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/MANIFEST.in +0 -0
  14. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/README.md +0 -0
  15. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/setup.cfg +0 -0
  16. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/exchanges_from_spreadsheet.py +0 -0
  17. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/flows/__init__.py +0 -0
  18. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/flows/flow.py +0 -0
  19. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/flows/flow_interface.py +0 -0
  20. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/flows/openlca_locales.json +0 -0
  21. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/__init__.py +0 -0
  22. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/abstract_query.py +0 -0
  23. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/ibasic.py +0 -0
  24. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/iconfigure.py +0 -0
  25. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/iexchange.py +0 -0
  26. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/iforeground.py +0 -0
  27. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/iindex.py +0 -0
  28. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/interfaces/iquantity.py +0 -0
  29. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/models/__init__.py +0 -0
  30. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/models/auth.py +0 -0
  31. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/models/comparators.py +0 -0
  32. {antelope_interface-0.3.1/src/antelope/refs/tests → antelope_interface-0.3.2/src/antelope/qdb}/__init__.py +0 -0
  33. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/__init__.py +0 -0
  34. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/catalog_ref.py +0 -0
  35. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/exchange_ref.py +0 -0
  36. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/flow_ref.py +0 -0
  37. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/process_ref.py +0 -0
  38. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/quantity_ref.py +0 -0
  39. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/refs/tests/test_flows.py +0 -0
  40. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope/xdb_tokens.py +0 -0
  41. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope_interface.egg-info/dependency_links.txt +0 -0
  42. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope_interface.egg-info/requires.txt +0 -0
  43. {antelope_interface-0.3.1 → antelope_interface-0.3.2}/src/antelope_interface.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: antelope_interface
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: A common interface for accessing LCA data
5
5
  Author-email: Brandon Kuczenski <bkuczenski@ucsb.edu>
6
6
  License: BSD-3-Clause
@@ -22,7 +22,7 @@ classifiers = [
22
22
  "Topic :: Scientific/Engineering"
23
23
  ]
24
24
  dependencies = ["synonym_dict >= 0.2.4", "pydantic >= 2.5.0"]
25
- version = "0.3.1"
25
+ version = "0.3.2"
26
26
 
27
27
  [tool.setuptools.packages.find]
28
28
  where = ["src"]
@@ -5,6 +5,8 @@ setup()
5
5
 
6
6
  """
7
7
  Version History:
8
+ 0.3.2 2025/08/01 - 0.3.2 release. better background handling.
9
+
8
10
  0.3.1 2025/06/18 - 0.3.1 release. small tweaks to method signatures.
9
11
 
10
12
  0.3.0 2024/10/24 - 0.3.0 release. add comparators.
@@ -11,7 +11,7 @@ from .interfaces.ibasic import BasicInterface, EntityNotFound, NoAccessToEntity,
11
11
  from .interfaces.iconfigure import ConfigureInterface
12
12
  from .interfaces.iexchange import ExchangeInterface, ExchangeRequired
13
13
  from .interfaces.iindex import IndexInterface, IndexRequired, directions, comp_dir, num_dir, check_direction, valid_sense, comp_sense
14
- from .interfaces.ibackground import BackgroundInterface, BackgroundRequired
14
+ from .interfaces.ibackground import BackgroundInterface, BackgroundRequired, LinkingError
15
15
  from .interfaces.iquantity import QuantityInterface, QuantityRequired, NoFactorsFound, ConversionReferenceMismatch, FlowableMismatch
16
16
  from .interfaces.iforeground import ForegroundInterface
17
17
 
@@ -26,6 +26,13 @@ class BackgroundRequired(Exception):
26
26
  pass
27
27
 
28
28
 
29
+ class LinkingError(Exception):
30
+ """
31
+ To be returned when a strict linking strategy cannot be implemented
32
+ """
33
+ pass
34
+
35
+
29
36
  _interface = 'background'
30
37
 
31
38
  BACKGROUND_VALUES_REQUIRED = {'dependencies', 'emissions', 'cutoffs', 'lci', 'sys_lci', 'foreground', 'ad', 'bf'}
@@ -0,0 +1,32 @@
1
+ """
2
+ An interface specification for a quantity database. This was originally conceived as being *the* quantity
3
+ interface, but as things have developed it's become clear that the qdb does more (and less) than the
4
+ quantity interface governs, and many (even most) of the operations of qdb are not even part of the antelope
5
+ interface spec.
6
+
7
+ For that reason, we are putting this *still in* antelope interface but *outside of* the abstract query framework,
8
+ and making it a straight abstract base class.
9
+ """
10
+
11
+ from abc import ABC
12
+
13
+
14
+ class QdbInterface(ABC):
15
+ """
16
+ The main purpose of the qdb is to maintain a free-standing database of quantities and flows. This will
17
+ most likely be implemented as a graph, but the interface for interacting with it is not going to care about
18
+ that. Here we brainstorm about all the things we would want the qdb to do.
19
+
20
+ # quantities
21
+
22
+ Quantities are a fundamental concept in physical science; yet my implementation of them is basically made up
23
+ based on my experience and intuition. We distinguish between reference quantities, which are directly measurable,
24
+ and which are [within qdb] *strictly* canonical and can therefore only be created or altered by privileged users,
25
+ and *indicators*, which are quantities that may or may not be directly measurable but are owned by users and
26
+ therefore not canonical.
27
+
28
+
29
+ In qdb, we only store *reference* quantities (right? or do we allow users
30
+ to make their own quantities? we allow users to make their own *indicators*. Only privileged users can c
31
+ """
32
+ pass
@@ -0,0 +1,15 @@
1
+ """
2
+ this belongs in the implementation, not the interface
3
+ """
4
+
5
+ from pint import UnitRegistry
6
+
7
+
8
+ U = UnitRegistry()
9
+
10
+
11
+ comp_units = {
12
+ 'm3': U.meter ** 3,
13
+ 'm2a': U.meter ** 2 * U.year,
14
+ 'tkm': U.tonne * U.kilometer,
15
+ }
@@ -140,7 +140,10 @@ class BaseRef(BaseEntity):
140
140
  return item in self._d
141
141
 
142
142
  def __setitem__(self, key, value):
143
- self._d[key] = value
143
+ if value is None:
144
+ self._d.pop(key, None)
145
+ else:
146
+ self._d[key] = value
144
147
 
145
148
  @property
146
149
  def _name(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: antelope_interface
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: A common interface for accessing LCA data
5
5
  Author-email: Brandon Kuczenski <bkuczenski@ucsb.edu>
6
6
  License: BSD-3-Clause
@@ -22,6 +22,9 @@ src/antelope/interfaces/iquantity.py
22
22
  src/antelope/models/__init__.py
23
23
  src/antelope/models/auth.py
24
24
  src/antelope/models/comparators.py
25
+ src/antelope/qdb/__init__.py
26
+ src/antelope/qdb/qdb.py
27
+ src/antelope/qdb/units.py
25
28
  src/antelope/refs/__init__.py
26
29
  src/antelope/refs/base.py
27
30
  src/antelope/refs/catalog_ref.py