bw-processing 0.9.5__tar.gz → 1.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.
- {bw_processing-0.9.5/bw_processing.egg-info → bw_processing-1.0}/PKG-INFO +2 -1
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/__init__.py +1 -1
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/constants.py +2 -1
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/datapackage.py +9 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/utils.py +4 -4
- {bw_processing-0.9.5 → bw_processing-1.0/bw_processing.egg-info}/PKG-INFO +2 -1
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing.egg-info/SOURCES.txt +13 -28
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing.egg-info/requires.txt +1 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/pyproject.toml +2 -0
- bw_processing-1.0/tests/test_array_creation.py +14 -0
- bw_processing-1.0/tests/test_datapackage.py +499 -0
- bw_processing-1.0/tests/test_filesystem.py +33 -0
- bw_processing-1.0/tests/test_filtered_datapackage.py +151 -0
- bw_processing-1.0/tests/test_indexing.py +384 -0
- bw_processing-1.0/tests/test_integration.py +472 -0
- bw_processing-1.0/tests/test_interfaces.py +113 -0
- bw_processing-1.0/tests/test_io_parquet_helpers.py +155 -0
- bw_processing-1.0/tests/test_io_pyarrow_helpers.py +66 -0
- bw_processing-1.0/tests/test_loading.py +64 -0
- bw_processing-1.0/tests/test_merging.py +369 -0
- bw_processing-1.0/tests/test_proxies.py +27 -0
- bw_processing-1.0/tests/test_unique_fields.py +139 -0
- bw_processing-0.9.5/bw_processing/examples/__pycache__/__init__.cpython-312.pyc +0 -0
- bw_processing-0.9.5/bw_processing/examples/datapackage_1/datapackage.json +0 -121
- bw_processing-0.9.5/dev/calculation_package.py +0 -179
- bw_processing-0.9.5/dev/loading.py +0 -85
- bw_processing-0.9.5/dev/processed_package.py +0 -261
- bw_processing-0.9.5/dev/resources.py +0 -32
- bw_processing-0.9.5/dev/speed_tests.py +0 -47
- bw_processing-0.9.5/docs/conf.py +0 -109
- bw_processing-0.9.5/tests/fixtures/basic_arrays.py +0 -42
- bw_processing-0.9.5/tests/helpers/__init__.py +0 -6
- bw_processing-0.9.5/tests/helpers/basic_array_helpers.py +0 -33
- {bw_processing-0.9.5 → bw_processing-1.0}/LICENSE +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/MANIFEST.in +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/README.md +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/array_creation.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/errors.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/__init__.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/another name.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.data.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.distributions.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.flip.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/some name.data.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/some name.flip.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_1/some name.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/datapackage_2.zip +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/interfaces.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/parquet_files.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/examples/simple.zip +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/filesystem.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/indexing.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/io_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/io_parquet_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/io_pyarrow_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/merging.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/proxies.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing/unique_fields.py +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing.egg-info/dependency_links.txt +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/bw_processing.egg-info/top_level.txt +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/setup.cfg +0 -0
- {bw_processing-0.9.5 → bw_processing-1.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bw_processing
|
|
3
|
-
Version: 0
|
|
3
|
+
Version: 1.0
|
|
4
4
|
Summary: Foo
|
|
5
5
|
Author-email: Chris Mutel <cmutel@gmail.com>
|
|
6
6
|
Maintainer-email: Chris Mutel <cmutel@gmail.com>
|
|
@@ -26,6 +26,7 @@ Requires-Dist: numpy
|
|
|
26
26
|
Requires-Dist: pandas
|
|
27
27
|
Provides-Extra: testing
|
|
28
28
|
Requires-Dist: bw_processing; extra == "testing"
|
|
29
|
+
Requires-Dist: pyarrow; extra == "testing"
|
|
29
30
|
Requires-Dist: pytest; extra == "testing"
|
|
30
31
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
31
32
|
Requires-Dist: python-coveralls; extra == "testing"
|
|
@@ -4,6 +4,7 @@ from enum import Enum
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
6
|
MAX_SIGNED_32BIT_INT = 2147483647
|
|
7
|
+
MAX_SIGNED_64BIT_INT = 9223372036854775807
|
|
7
8
|
|
|
8
9
|
# We could try to save space by not storing the columns
|
|
9
10
|
# `row_index` and `col_index`, and add them after loading from
|
|
@@ -20,7 +21,7 @@ UNCERTAINTY_DTYPE = [
|
|
|
20
21
|
("maximum", np.float32),
|
|
21
22
|
("negative", bool),
|
|
22
23
|
]
|
|
23
|
-
INDICES_DTYPE = [("row", np.
|
|
24
|
+
INDICES_DTYPE = [("row", np.int64), ("col", np.int64)]
|
|
24
25
|
|
|
25
26
|
NAME_RE = re.compile(r"^[\w\-\.]*$")
|
|
26
27
|
|
|
@@ -14,6 +14,8 @@ from morefs.dict import DictFS
|
|
|
14
14
|
from .constants import (
|
|
15
15
|
DEFAULT_LICENSES,
|
|
16
16
|
INDICES_DTYPE,
|
|
17
|
+
MAX_SIGNED_32BIT_INT,
|
|
18
|
+
MAX_SIGNED_64BIT_INT,
|
|
17
19
|
NUMPY_SERIALIZE_FORMAT_EXTENSION,
|
|
18
20
|
NUMPY_SERIALIZE_FORMAT_NAME,
|
|
19
21
|
PARQUET_SERIALIZE_FORMAT_EXTENSION,
|
|
@@ -257,6 +259,12 @@ class DatapackageBase(ABC):
|
|
|
257
259
|
|
|
258
260
|
self.data[index] = resource
|
|
259
261
|
|
|
262
|
+
def get_max_index_value(self) -> int:
|
|
263
|
+
"""Get maximum index value (max signed 32 or 64 bit integer) for this datapackage"""
|
|
264
|
+
if self.metadata.get("64_bit_indices"):
|
|
265
|
+
return MAX_SIGNED_64BIT_INT
|
|
266
|
+
return MAX_SIGNED_32BIT_INT
|
|
267
|
+
|
|
260
268
|
|
|
261
269
|
class FilteredDatapackage(DatapackageBase):
|
|
262
270
|
"""A subset of a datapackage. Used in matrix construction or other data manipulation operations.
|
|
@@ -360,6 +368,7 @@ class Datapackage(DatapackageBase):
|
|
|
360
368
|
"combinatorial": combinatorial,
|
|
361
369
|
"sequential": sequential,
|
|
362
370
|
"seed": seed,
|
|
371
|
+
"64_bit_indices": True,
|
|
363
372
|
"sum_intra_duplicates": sum_intra_duplicates,
|
|
364
373
|
"sum_inter_duplicates": sum_inter_duplicates,
|
|
365
374
|
"matrix_serialize_format_type": matrix_serialize_format_type.value,
|
|
@@ -58,10 +58,10 @@ def dictionary_formatter(row: dict) -> tuple:
|
|
|
58
58
|
row["amount"],
|
|
59
59
|
as_uncertainty_type(row),
|
|
60
60
|
row.get("loc", row["amount"]),
|
|
61
|
-
row.get("scale", np.
|
|
62
|
-
row.get("shape", np.
|
|
63
|
-
row.get("minimum", np.
|
|
64
|
-
row.get("maximum", np.
|
|
61
|
+
row.get("scale", np.nan),
|
|
62
|
+
row.get("shape", np.nan),
|
|
63
|
+
row.get("minimum", np.nan),
|
|
64
|
+
row.get("maximum", np.nan),
|
|
65
65
|
row.get("negative", False),
|
|
66
66
|
row.get("flip", False),
|
|
67
67
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bw_processing
|
|
3
|
-
Version: 0
|
|
3
|
+
Version: 1.0
|
|
4
4
|
Summary: Foo
|
|
5
5
|
Author-email: Chris Mutel <cmutel@gmail.com>
|
|
6
6
|
Maintainer-email: Chris Mutel <cmutel@gmail.com>
|
|
@@ -26,6 +26,7 @@ Requires-Dist: numpy
|
|
|
26
26
|
Requires-Dist: pandas
|
|
27
27
|
Provides-Extra: testing
|
|
28
28
|
Requires-Dist: bw_processing; extra == "testing"
|
|
29
|
+
Requires-Dist: pyarrow; extra == "testing"
|
|
29
30
|
Requires-Dist: pytest; extra == "testing"
|
|
30
31
|
Requires-Dist: pytest-cov; extra == "testing"
|
|
31
32
|
Requires-Dist: python-coveralls; extra == "testing"
|
|
@@ -2,32 +2,6 @@ LICENSE
|
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
4
|
pyproject.toml
|
|
5
|
-
./bw_processing/__init__.py
|
|
6
|
-
./bw_processing/array_creation.py
|
|
7
|
-
./bw_processing/constants.py
|
|
8
|
-
./bw_processing/datapackage.py
|
|
9
|
-
./bw_processing/errors.py
|
|
10
|
-
./bw_processing/filesystem.py
|
|
11
|
-
./bw_processing/indexing.py
|
|
12
|
-
./bw_processing/io_helpers.py
|
|
13
|
-
./bw_processing/io_parquet_helpers.py
|
|
14
|
-
./bw_processing/io_pyarrow_helpers.py
|
|
15
|
-
./bw_processing/merging.py
|
|
16
|
-
./bw_processing/proxies.py
|
|
17
|
-
./bw_processing/unique_fields.py
|
|
18
|
-
./bw_processing/utils.py
|
|
19
|
-
./bw_processing/examples/__init__.py
|
|
20
|
-
./bw_processing/examples/interfaces.py
|
|
21
|
-
./bw_processing/examples/parquet_files.py
|
|
22
|
-
./dev/calculation_package.py
|
|
23
|
-
./dev/loading.py
|
|
24
|
-
./dev/processed_package.py
|
|
25
|
-
./dev/resources.py
|
|
26
|
-
./dev/speed_tests.py
|
|
27
|
-
./docs/conf.py
|
|
28
|
-
./tests/fixtures/basic_arrays.py
|
|
29
|
-
./tests/helpers/__init__.py
|
|
30
|
-
./tests/helpers/basic_array_helpers.py
|
|
31
5
|
bw_processing/__init__.py
|
|
32
6
|
bw_processing/array_creation.py
|
|
33
7
|
bw_processing/constants.py
|
|
@@ -52,9 +26,7 @@ bw_processing/examples/datapackage_2.zip
|
|
|
52
26
|
bw_processing/examples/interfaces.py
|
|
53
27
|
bw_processing/examples/parquet_files.py
|
|
54
28
|
bw_processing/examples/simple.zip
|
|
55
|
-
bw_processing/examples/__pycache__/__init__.cpython-312.pyc
|
|
56
29
|
bw_processing/examples/datapackage_1/another name.indices.parquet
|
|
57
|
-
bw_processing/examples/datapackage_1/datapackage.json
|
|
58
30
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.data.parquet
|
|
59
31
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.distributions.parquet
|
|
60
32
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.flip.parquet
|
|
@@ -62,4 +34,17 @@ bw_processing/examples/datapackage_1/sa-data-vector-from-dict.indices.parquet
|
|
|
62
34
|
bw_processing/examples/datapackage_1/some name.data.parquet
|
|
63
35
|
bw_processing/examples/datapackage_1/some name.flip.parquet
|
|
64
36
|
bw_processing/examples/datapackage_1/some name.indices.parquet
|
|
37
|
+
tests/test_array_creation.py
|
|
38
|
+
tests/test_datapackage.py
|
|
39
|
+
tests/test_filesystem.py
|
|
40
|
+
tests/test_filtered_datapackage.py
|
|
41
|
+
tests/test_indexing.py
|
|
42
|
+
tests/test_integration.py
|
|
43
|
+
tests/test_interfaces.py
|
|
44
|
+
tests/test_io_parquet_helpers.py
|
|
45
|
+
tests/test_io_pyarrow_helpers.py
|
|
46
|
+
tests/test_loading.py
|
|
47
|
+
tests/test_merging.py
|
|
48
|
+
tests/test_proxies.py
|
|
49
|
+
tests/test_unique_fields.py
|
|
65
50
|
tests/test_utils.py
|
|
@@ -48,6 +48,7 @@ tracker = "https://github.com/brightway-lca/bw_processing/issues"
|
|
|
48
48
|
# seems to work, at least for now
|
|
49
49
|
testing = [
|
|
50
50
|
"bw_processing",
|
|
51
|
+
"pyarrow",
|
|
51
52
|
"pytest",
|
|
52
53
|
"pytest-cov",
|
|
53
54
|
"python-coveralls"
|
|
@@ -72,6 +73,7 @@ version = {attr = "bw_processing.__version__"}
|
|
|
72
73
|
|
|
73
74
|
[tool.pytest.ini_options]
|
|
74
75
|
addopts = "--cov bw_processing --cov-report term-missing --verbose"
|
|
76
|
+
log_cli = 1
|
|
75
77
|
norecursedirs = [
|
|
76
78
|
"dist",
|
|
77
79
|
"build",
|