hestia-earth-utils 0.15.4__tar.gz → 0.15.5__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 (44) hide show
  1. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/PKG-INFO +1 -1
  2. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/blank_node.py +3 -2
  3. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/pipeline.py +5 -5
  4. hestia_earth_utils-0.15.5/hestia_earth/utils/version.py +1 -0
  5. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth_utils.egg-info/PKG-INFO +1 -1
  6. hestia_earth_utils-0.15.4/hestia_earth/utils/version.py +0 -1
  7. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/MANIFEST.in +0 -0
  8. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/README.md +0 -0
  9. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/bin/hestia-format-upload +0 -0
  10. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/bin/hestia-pivot-csv +0 -0
  11. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/__init__.py +0 -0
  12. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/__init__.py +0 -0
  13. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/api.py +0 -0
  14. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/calculation_status.py +0 -0
  15. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/cycle.py +0 -0
  16. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/date.py +0 -0
  17. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/descriptive_stats.py +0 -0
  18. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/emission.py +0 -0
  19. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/lookup.py +0 -0
  20. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/lookup_utils.py +0 -0
  21. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/model.py +0 -0
  22. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/pivot/__init__.py +0 -0
  23. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/pivot/_shared.py +0 -0
  24. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/pivot/pivot_csv.py +0 -0
  25. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/pivot/pivot_json.py +0 -0
  26. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/request.py +0 -0
  27. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/stats.py +0 -0
  28. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/storage/__init__.py +0 -0
  29. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/storage/_azure_client.py +0 -0
  30. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/storage/_local_client.py +0 -0
  31. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/storage/_s3_client.py +0 -0
  32. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/storage/_sns_client.py +0 -0
  33. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/table.py +0 -0
  34. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/term.py +0 -0
  35. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth/utils/tools.py +0 -0
  36. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth_utils.egg-info/SOURCES.txt +0 -0
  37. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth_utils.egg-info/dependency_links.txt +0 -0
  38. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth_utils.egg-info/requires.txt +0 -0
  39. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/hestia_earth_utils.egg-info/top_level.txt +0 -0
  40. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/setup.cfg +0 -0
  41. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/setup.py +0 -0
  42. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/tests/pivot/__init__.py +0 -0
  43. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/tests/pivot/test_pivot_csv.py +0 -0
  44. {hestia_earth_utils-0.15.4 → hestia_earth_utils-0.15.5}/tests/pivot/test_pivot_json.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia_earth_utils
3
- Version: 0.15.4
3
+ Version: 0.15.5
4
4
  Summary: HESTIA's utils library
5
5
  Home-page: https://gitlab.com/hestia-earth/hestia-utils
6
6
  Author: HESTIA Team
@@ -144,8 +144,9 @@ def get_node_value(
144
144
  )] if isinstance(value, list) and len(value) > 0 else None
145
145
 
146
146
  return reducer(value) if reducer else (
147
- value if any([isinstance(value, float), isinstance(value, int), isinstance(value, bool)])
148
- else (value or default)
147
+ value if any([isinstance(value, float), isinstance(value, int), isinstance(value, bool)]) else
148
+ default if value is None else
149
+ value
149
150
  )
150
151
 
151
152
 
@@ -156,15 +156,15 @@ def _node_id(node: dict): return node.get('@id', node.get('id'))
156
156
  def _node_path(node: dict, folder: str = ''): return join(folder, _node_type(node), f"{_node_id(node)}.jsonld")
157
157
 
158
158
 
159
- def is_calculating(bucket: str, node: dict):
160
- return _read_metadata(bucket, _node_path(node)).get(METADATA_PROGRESS_KEY, 'false') == 'true'
159
+ def is_calculating(bucket: str, node: dict, folder: str = ''):
160
+ return _read_metadata(bucket, _node_path(node, folder)).get(METADATA_PROGRESS_KEY, 'false') == 'true'
161
161
 
162
162
 
163
- def set_calculating(bucket: str, node: dict, in_progress: bool):
164
- return _update_metadata(bucket, _node_path(node), {METADATA_PROGRESS_KEY: str(in_progress).lower()})
163
+ def set_calculating(bucket: str, node: dict, in_progress: bool, folder: str = ''):
164
+ return _update_metadata(bucket, _node_path(node, folder), {METADATA_PROGRESS_KEY: str(in_progress).lower()})
165
165
 
166
166
 
167
- def get_stage(bucket: str, node: dict):
167
+ def get_stage(bucket: str, node: dict, folder: str = CALC_FOLDER):
168
168
  stage = _read_metadata(bucket, _node_path(node, folder=CALC_FOLDER)).get(METADATA_STAGE_KEY)
169
169
  return int(stage) if stage else stage
170
170
 
@@ -0,0 +1 @@
1
+ VERSION = '0.15.5'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hestia-earth-utils
3
- Version: 0.15.4
3
+ Version: 0.15.5
4
4
  Summary: HESTIA's utils library
5
5
  Home-page: https://gitlab.com/hestia-earth/hestia-utils
6
6
  Author: HESTIA Team
@@ -1 +0,0 @@
1
- VERSION = '0.15.4'