hestia-earth-utils 0.16.16__py3-none-any.whl → 0.16.17__py3-none-any.whl

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.
@@ -51,6 +51,13 @@ def _combine_node_ids(nodes: list):
51
51
  return {"@id": ";".join([node.get("@id", node.get("id")) for node in nodes])}
52
52
 
53
53
 
54
+ _COMPACT_JSON_KEYS = ["boundary", "distribution", "covarianceMatrix"]
55
+
56
+
57
+ def _combine_json_compact(key: str, value: dict):
58
+ return json.dumps(value).replace(" ", "") if key in _COMPACT_JSON_KEYS else value
59
+
60
+
54
61
  def _base_pivoted_value(key: str, value, is_top_level: bool):
55
62
  # handle list of Nodes
56
63
  return (
@@ -58,13 +65,13 @@ def _base_pivoted_value(key: str, value, is_top_level: bool):
58
65
  _combine_node_ids(value)
59
66
  if isinstance(value[0], dict) and value[0].get("@type") in NODE_TYPES
60
67
  else (
61
- json.dumps(value, separators=(",", ":"))
62
- if any([is_top_level, key in ["distribution"]])
68
+ _combine_json_compact(key, value)
69
+ if any([is_top_level, key in _COMPACT_JSON_KEYS])
63
70
  else value
64
71
  )
65
72
  )
66
73
  if isinstance(value, list)
67
- else value
74
+ else _combine_json_compact(key, value)
68
75
  )
69
76
 
70
77
 
@@ -1 +1 @@
1
- VERSION = "0.16.16"
1
+ VERSION = "0.16.17"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hestia_earth_utils
3
- Version: 0.16.16
3
+ Version: 0.16.17
4
4
  Summary: HESTIA's utils library
5
5
  Home-page: https://gitlab.com/hestia-earth/hestia-utils
6
6
  Author: HESTIA Team
@@ -15,19 +15,19 @@ hestia_earth/utils/stats.py,sha256=vTNyKcMKmX0DoodM9QEG7HF8qm2Wf-4ckMWQFWZ1VgE,3
15
15
  hestia_earth/utils/table.py,sha256=MOJDo5fQPRDogAty_UXbO9-EXFwz97m0f7--mOM17lQ,2363
16
16
  hestia_earth/utils/term.py,sha256=aBVYuYv55nPqJPyt5mN4Fz652s_1hwUPckNUZX0pMP8,1064
17
17
  hestia_earth/utils/tools.py,sha256=WMx05cBtBR8mYQnLLBA2cgF1x2tI41514diFDeX4gLQ,7533
18
- hestia_earth/utils/version.py,sha256=SGKvksJDyfirCQnk3wbuotlbC2CvazXTR8lJe6kBC6U,20
18
+ hestia_earth/utils/version.py,sha256=yrNYFc1di1CmrRU185XXHiVyfsBROM9GnBuni4puan0,20
19
19
  hestia_earth/utils/pivot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  hestia_earth/utils/pivot/_shared.py,sha256=ZBmZRLbDN2JHODvQAh9jH_61Koh7Ts0C52xmiw_Bhpo,2827
21
21
  hestia_earth/utils/pivot/pivot_csv.py,sha256=1zGYuC_xlrLoX5FYSG3mt5HSc03CO-0p8J0oAmyI1VI,11778
22
- hestia_earth/utils/pivot/pivot_json.py,sha256=yWbsuFeTQJPk4H2b7ibVALGJa3qfKGyNuPeqM8yrcsI,11030
22
+ hestia_earth/utils/pivot/pivot_json.py,sha256=bqR3SmoHu9-Ij4UtUEbsZjEqtqq1jdS4Nx3CpyLN3Mc,11263
23
23
  hestia_earth/utils/storage/__init__.py,sha256=uNX6_EHWWnNUIm4Ng7L43-cQmuc6NGFAxXye85saIXQ,922
24
24
  hestia_earth/utils/storage/_azure_client.py,sha256=mseexhzjteRDzzoFe2fEXe9MYLmvjG3sfl9-eha4ZW0,1353
25
25
  hestia_earth/utils/storage/_local_client.py,sha256=KbYqTfniIU5R5J1m_unCQip9kOz9EGIGI0OH0QvD8eo,551
26
26
  hestia_earth/utils/storage/_s3_client.py,sha256=8TCxiHfxE7G8kdp3CnEFrxgmPwfPyci3-blsowE2T7o,3146
27
27
  hestia_earth/utils/storage/_sns_client.py,sha256=pvtXYw-sQ8ns3mlDz7ld9iZp3FYSm0xSXSXMJ5IPnBc,380
28
- hestia_earth_utils-0.16.16.data/scripts/hestia-format-upload,sha256=IhLAHHPJqRgUcht-M_EUEsRMbRbMfshig07o488zscM,703
29
- hestia_earth_utils-0.16.16.data/scripts/hestia-pivot-csv,sha256=0YBuGuyPO8rytod6iwWEKiQdSlr9JLuD001k6U5t6no,1163
30
- hestia_earth_utils-0.16.16.dist-info/METADATA,sha256=iOf4uwvgxtoZgFdSjW3uElhZfRf9vRQFJL_LC9ojvlM,1873
31
- hestia_earth_utils-0.16.16.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
32
- hestia_earth_utils-0.16.16.dist-info/top_level.txt,sha256=q0QxKEYx9uLpAD5ZtC7Ypq29smEPfOzEAn7Xv8XHGOQ,13
33
- hestia_earth_utils-0.16.16.dist-info/RECORD,,
28
+ hestia_earth_utils-0.16.17.data/scripts/hestia-format-upload,sha256=IhLAHHPJqRgUcht-M_EUEsRMbRbMfshig07o488zscM,703
29
+ hestia_earth_utils-0.16.17.data/scripts/hestia-pivot-csv,sha256=0YBuGuyPO8rytod6iwWEKiQdSlr9JLuD001k6U5t6no,1163
30
+ hestia_earth_utils-0.16.17.dist-info/METADATA,sha256=MaXvegUxz6wKFMNMEW7Uem0FdST2U0vX5mEL8z0FqU8,1873
31
+ hestia_earth_utils-0.16.17.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
32
+ hestia_earth_utils-0.16.17.dist-info/top_level.txt,sha256=q0QxKEYx9uLpAD5ZtC7Ypq29smEPfOzEAn7Xv8XHGOQ,13
33
+ hestia_earth_utils-0.16.17.dist-info/RECORD,,