bw-processing 0.9.5__tar.gz → 0.9.6__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-0.9.6}/PKG-INFO +2 -1
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/__init__.py +1 -1
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/utils.py +4 -4
- {bw_processing-0.9.5 → bw_processing-0.9.6/bw_processing.egg-info}/PKG-INFO +2 -1
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing.egg-info/SOURCES.txt +0 -8
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing.egg-info/requires.txt +1 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/pyproject.toml +2 -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/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-0.9.6}/LICENSE +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/MANIFEST.in +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/README.md +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/array_creation.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/constants.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/datapackage.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/errors.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/__init__.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/another name.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.data.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.distributions.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.flip.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/sa-data-vector-from-dict.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/some name.data.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/some name.flip.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_1/some name.indices.parquet +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/datapackage_2.zip +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/interfaces.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/parquet_files.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/examples/simple.zip +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/filesystem.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/indexing.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/io_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/io_parquet_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/io_pyarrow_helpers.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/merging.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/proxies.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing/unique_fields.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing.egg-info/dependency_links.txt +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/bw_processing.egg-info/top_level.txt +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/dev/calculation_package.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/dev/loading.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/dev/processed_package.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/dev/resources.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/dev/speed_tests.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/docs/conf.py +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/setup.cfg +0 -0
- {bw_processing-0.9.5 → bw_processing-0.9.6}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bw_processing
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.6
|
|
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"
|
|
@@ -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.9.
|
|
3
|
+
Version: 0.9.6
|
|
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"
|
|
@@ -10,24 +10,18 @@ pyproject.toml
|
|
|
10
10
|
./bw_processing/filesystem.py
|
|
11
11
|
./bw_processing/indexing.py
|
|
12
12
|
./bw_processing/io_helpers.py
|
|
13
|
-
./bw_processing/io_parquet_helpers.py
|
|
14
|
-
./bw_processing/io_pyarrow_helpers.py
|
|
15
13
|
./bw_processing/merging.py
|
|
16
14
|
./bw_processing/proxies.py
|
|
17
15
|
./bw_processing/unique_fields.py
|
|
18
16
|
./bw_processing/utils.py
|
|
19
17
|
./bw_processing/examples/__init__.py
|
|
20
18
|
./bw_processing/examples/interfaces.py
|
|
21
|
-
./bw_processing/examples/parquet_files.py
|
|
22
19
|
./dev/calculation_package.py
|
|
23
20
|
./dev/loading.py
|
|
24
21
|
./dev/processed_package.py
|
|
25
22
|
./dev/resources.py
|
|
26
23
|
./dev/speed_tests.py
|
|
27
24
|
./docs/conf.py
|
|
28
|
-
./tests/fixtures/basic_arrays.py
|
|
29
|
-
./tests/helpers/__init__.py
|
|
30
|
-
./tests/helpers/basic_array_helpers.py
|
|
31
25
|
bw_processing/__init__.py
|
|
32
26
|
bw_processing/array_creation.py
|
|
33
27
|
bw_processing/constants.py
|
|
@@ -52,9 +46,7 @@ bw_processing/examples/datapackage_2.zip
|
|
|
52
46
|
bw_processing/examples/interfaces.py
|
|
53
47
|
bw_processing/examples/parquet_files.py
|
|
54
48
|
bw_processing/examples/simple.zip
|
|
55
|
-
bw_processing/examples/__pycache__/__init__.cpython-312.pyc
|
|
56
49
|
bw_processing/examples/datapackage_1/another name.indices.parquet
|
|
57
|
-
bw_processing/examples/datapackage_1/datapackage.json
|
|
58
50
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.data.parquet
|
|
59
51
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.distributions.parquet
|
|
60
52
|
bw_processing/examples/datapackage_1/sa-data-vector-from-dict.flip.parquet
|
|
@@ -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",
|
|
Binary file
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"profile": "data-package",
|
|
3
|
-
"name": "ac5010ce6fee4160a59e2d0f3616067d",
|
|
4
|
-
"id": "bf24c6cd8a9340acbc1c6d3b18283bd0",
|
|
5
|
-
"licenses": [
|
|
6
|
-
{
|
|
7
|
-
"name": "ODC-PDDL-1.0",
|
|
8
|
-
"path": "http://opendatacommons.org/licenses/pddl/",
|
|
9
|
-
"title": "Open Data Commons Public Domain Dedication and License v1.0"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"resources": [
|
|
13
|
-
{
|
|
14
|
-
"profile": "data-resource",
|
|
15
|
-
"format": "pqt",
|
|
16
|
-
"mediatype": "application/octet-stream",
|
|
17
|
-
"name": "some name.indices",
|
|
18
|
-
"matrix": "some name",
|
|
19
|
-
"kind": "indices",
|
|
20
|
-
"path": "some name.indices.parquet",
|
|
21
|
-
"group": "some name",
|
|
22
|
-
"category": "vector",
|
|
23
|
-
"nrows": 3
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"profile": "data-resource",
|
|
27
|
-
"format": "pqt",
|
|
28
|
-
"mediatype": "application/octet-stream",
|
|
29
|
-
"name": "some name.data",
|
|
30
|
-
"matrix": "some name",
|
|
31
|
-
"kind": "data",
|
|
32
|
-
"path": "some name.data.parquet",
|
|
33
|
-
"group": "some name",
|
|
34
|
-
"category": "vector",
|
|
35
|
-
"nrows": 3
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"profile": "data-resource",
|
|
39
|
-
"format": "pqt",
|
|
40
|
-
"mediatype": "application/octet-stream",
|
|
41
|
-
"name": "some name.flip",
|
|
42
|
-
"matrix": "some name",
|
|
43
|
-
"kind": "flip",
|
|
44
|
-
"path": "some name.flip.parquet",
|
|
45
|
-
"group": "some name",
|
|
46
|
-
"category": "vector",
|
|
47
|
-
"nrows": 3
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"profile": "data-resource",
|
|
51
|
-
"format": "pqt",
|
|
52
|
-
"mediatype": "application/octet-stream",
|
|
53
|
-
"name": "another name.indices",
|
|
54
|
-
"matrix": "another_matrix",
|
|
55
|
-
"kind": "indices",
|
|
56
|
-
"path": "another name.indices.parquet",
|
|
57
|
-
"group": "another name",
|
|
58
|
-
"category": "vector",
|
|
59
|
-
"nrows": 3
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"profile": "data-resource",
|
|
63
|
-
"format": "pqt",
|
|
64
|
-
"mediatype": "application/octet-stream",
|
|
65
|
-
"name": "sa-data-vector-from-dict.indices",
|
|
66
|
-
"matrix": "sa_matrix",
|
|
67
|
-
"kind": "indices",
|
|
68
|
-
"path": "sa-data-vector-from-dict.indices.parquet",
|
|
69
|
-
"group": "sa-data-vector-from-dict",
|
|
70
|
-
"nrows": 2,
|
|
71
|
-
"foo": "bar",
|
|
72
|
-
"category": "vector"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"profile": "data-resource",
|
|
76
|
-
"format": "pqt",
|
|
77
|
-
"mediatype": "application/octet-stream",
|
|
78
|
-
"name": "sa-data-vector-from-dict.data",
|
|
79
|
-
"matrix": "sa_matrix",
|
|
80
|
-
"kind": "data",
|
|
81
|
-
"path": "sa-data-vector-from-dict.data.parquet",
|
|
82
|
-
"group": "sa-data-vector-from-dict",
|
|
83
|
-
"nrows": 2,
|
|
84
|
-
"foo": "bar",
|
|
85
|
-
"category": "vector"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"profile": "data-resource",
|
|
89
|
-
"format": "pqt",
|
|
90
|
-
"mediatype": "application/octet-stream",
|
|
91
|
-
"name": "sa-data-vector-from-dict.distributions",
|
|
92
|
-
"matrix": "sa_matrix",
|
|
93
|
-
"kind": "distributions",
|
|
94
|
-
"path": "sa-data-vector-from-dict.distributions.parquet",
|
|
95
|
-
"group": "sa-data-vector-from-dict",
|
|
96
|
-
"nrows": 2,
|
|
97
|
-
"foo": "bar",
|
|
98
|
-
"category": "vector"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
"profile": "data-resource",
|
|
102
|
-
"format": "pqt",
|
|
103
|
-
"mediatype": "application/octet-stream",
|
|
104
|
-
"name": "sa-data-vector-from-dict.flip",
|
|
105
|
-
"matrix": "sa_matrix",
|
|
106
|
-
"kind": "flip",
|
|
107
|
-
"path": "sa-data-vector-from-dict.flip.parquet",
|
|
108
|
-
"group": "sa-data-vector-from-dict",
|
|
109
|
-
"nrows": 2,
|
|
110
|
-
"foo": "bar",
|
|
111
|
-
"category": "vector"
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
"created": "2023-09-08T01:17:50.635817Z",
|
|
115
|
-
"combinatorial": false,
|
|
116
|
-
"sequential": false,
|
|
117
|
-
"seed": null,
|
|
118
|
-
"sum_intra_duplicates": true,
|
|
119
|
-
"sum_inter_duplicates": false,
|
|
120
|
-
"matrix_serialize_format_type": "numpy"
|
|
121
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Some basic array fixtures.
|
|
4
|
-
|
|
5
|
-
We also save these arrays into `parquet` files.
|
|
6
|
-
"""
|
|
7
|
-
import numpy as np
|
|
8
|
-
import pytest
|
|
9
|
-
|
|
10
|
-
from bw_processing.constants import INDICES_DTYPE, UNCERTAINTY_DTYPE
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@pytest.fixture(scope="session")
|
|
14
|
-
def indices_vector():
|
|
15
|
-
return np.array([(1, 4), (2, 5), (3, 6)], dtype=INDICES_DTYPE)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@pytest.fixture(scope="session")
|
|
19
|
-
def flip_vector():
|
|
20
|
-
return np.array([True, False, False])
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@pytest.fixture(scope="session")
|
|
24
|
-
def distributions_vector():
|
|
25
|
-
return np.array(
|
|
26
|
-
[
|
|
27
|
-
(0, 1, np.NaN, np.NaN, np.NaN, np.NaN, False),
|
|
28
|
-
(0, 1, np.NaN, np.NaN, np.NaN, np.NaN, False),
|
|
29
|
-
(0, 1, np.NaN, np.NaN, np.NaN, np.NaN, False),
|
|
30
|
-
(
|
|
31
|
-
5,
|
|
32
|
-
237,
|
|
33
|
-
np.NaN,
|
|
34
|
-
np.NaN,
|
|
35
|
-
200,
|
|
36
|
-
300,
|
|
37
|
-
False,
|
|
38
|
-
), # triangular uncertainty from 200 to 300
|
|
39
|
-
(5, 2.5, np.NaN, np.NaN, 2, 3, False), # triangular uncertainty from 2 to 3
|
|
40
|
-
],
|
|
41
|
-
dtype=UNCERTAINTY_DTYPE,
|
|
42
|
-
)
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
"""
|
|
3
|
-
Some helpers to deal with basic arrays.
|
|
4
|
-
|
|
5
|
-
Some functions could become fixtures but at the same time it might not be the hassle
|
|
6
|
-
to convert them as fixtures.
|
|
7
|
-
"""
|
|
8
|
-
import numpy as np
|
|
9
|
-
|
|
10
|
-
from bw_processing.constants import UNCERTAINTY_DTYPE
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def data_vector(dtype):
|
|
14
|
-
return np.array([1, 2, 3], dtype=dtype)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def data_matrix(dtype):
|
|
18
|
-
return np.arange(12, dtype=dtype).reshape((3, 4))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def vector_equal_with_uncertainty_dtype(A, B, equal_nan=True):
|
|
22
|
-
if A.dtype != UNCERTAINTY_DTYPE or B.dtype != UNCERTAINTY_DTYPE:
|
|
23
|
-
return False
|
|
24
|
-
if A.shape != B.shape:
|
|
25
|
-
return False
|
|
26
|
-
for e, l in zip(A, B):
|
|
27
|
-
for i, j in zip(e, l):
|
|
28
|
-
if equal_nan:
|
|
29
|
-
if np.isnan(i) and np.isnan(j):
|
|
30
|
-
continue
|
|
31
|
-
if i != j:
|
|
32
|
-
return False
|
|
33
|
-
return True
|
|
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
|