hestia-earth-utils 0.15.8__tar.gz → 0.15.9__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.
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/PKG-INFO +1 -1
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/_shared.py +6 -1
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/pivot_json.py +10 -4
- hestia_earth_utils-0.15.9/hestia_earth/utils/version.py +1 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/PKG-INFO +1 -1
- hestia_earth_utils-0.15.8/hestia_earth/utils/version.py +0 -1
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/MANIFEST.in +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/README.md +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/bin/hestia-format-upload +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/bin/hestia-pivot-csv +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/__init__.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/__init__.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/api.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/blank_node.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/calculation_status.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/cycle.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/date.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/descriptive_stats.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/emission.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/lookup.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/lookup_utils.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/model.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pipeline.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/__init__.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/pivot_csv.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/request.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/stats.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/__init__.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_azure_client.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_local_client.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_s3_client.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_sns_client.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/table.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/term.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/tools.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/SOURCES.txt +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/dependency_links.txt +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/requires.txt +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/top_level.txt +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/setup.cfg +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/setup.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/tests/pivot/__init__.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/tests/pivot/test_pivot_csv.py +0 -0
- {hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/tests/pivot/test_pivot_json.py +0 -0
|
@@ -3,7 +3,12 @@ import numpy as np
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
EXCLUDE_FIELDS = ["@type", "type", "@context"]
|
|
6
|
-
EXCLUDE_PRIVATE_FIELDS = [
|
|
6
|
+
EXCLUDE_PRIVATE_FIELDS = [
|
|
7
|
+
"added", "addedVersion",
|
|
8
|
+
"updated", "updatedVersion",
|
|
9
|
+
"aggregatedVersion",
|
|
10
|
+
"_cache"
|
|
11
|
+
]
|
|
7
12
|
|
|
8
13
|
|
|
9
14
|
def _with_csv_formatting(dct):
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/pivot_json.py
RENAMED
|
@@ -38,10 +38,15 @@ def _combine_node_ids(nodes: list):
|
|
|
38
38
|
return {"@id": ";".join([node.get("@id", node.get("id")) for node in nodes])}
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def _base_pivoted_value(value):
|
|
41
|
+
def _base_pivoted_value(key: str, value, is_top_level: bool):
|
|
42
42
|
# handle list of Nodes
|
|
43
43
|
return (
|
|
44
|
-
_combine_node_ids(value) if isinstance(value[0], dict) and value[0].get('@type') in NODE_TYPES else
|
|
44
|
+
_combine_node_ids(value) if isinstance(value[0], dict) and value[0].get('@type') in NODE_TYPES else
|
|
45
|
+
json.dumps(value, separators=(',', ':')) if any([
|
|
46
|
+
is_top_level,
|
|
47
|
+
key in ['distribution']
|
|
48
|
+
]) else
|
|
49
|
+
value
|
|
45
50
|
) if isinstance(value, list) else value
|
|
46
51
|
|
|
47
52
|
|
|
@@ -51,11 +56,12 @@ def _do_pivot(node, parent_node_type=None, parent_field=None, level=0): # noqa:
|
|
|
51
56
|
if node_type not in ADAPTED_UNIQUENESS_FIELDS:
|
|
52
57
|
return node
|
|
53
58
|
pivoted_node = {
|
|
54
|
-
field: _base_pivoted_value(value)
|
|
59
|
+
field: _base_pivoted_value(field, value, level==0)
|
|
55
60
|
for field, value in node.items()
|
|
56
61
|
if all([
|
|
57
62
|
field not in ADAPTED_UNIQUENESS_FIELDS[node_type],
|
|
58
|
-
node_type != 'Term' or field not in term_exclude_fields
|
|
63
|
+
node_type != 'Term' or field not in term_exclude_fields,
|
|
64
|
+
field not in EXCLUDE_PRIVATE_FIELDS
|
|
59
65
|
])
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '0.15.9'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '0.15.8'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/calculation_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/descriptive_stats.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/__init__.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/pivot/pivot_csv.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/__init__.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_azure_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_local_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_s3_client.py
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth/utils/storage/_sns_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{hestia_earth_utils-0.15.8 → hestia_earth_utils-0.15.9}/hestia_earth_utils.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|