hestia-earth-utils 0.16.2__py3-none-any.whl → 0.16.3__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.
- hestia_earth/utils/lookup.py +4 -2
- hestia_earth/utils/version.py +1 -1
- {hestia_earth_utils-0.16.2.dist-info → hestia_earth_utils-0.16.3.dist-info}/METADATA +1 -1
- {hestia_earth_utils-0.16.2.dist-info → hestia_earth_utils-0.16.3.dist-info}/RECORD +8 -8
- {hestia_earth_utils-0.16.2.data → hestia_earth_utils-0.16.3.data}/scripts/hestia-format-upload +0 -0
- {hestia_earth_utils-0.16.2.data → hestia_earth_utils-0.16.3.data}/scripts/hestia-pivot-csv +0 -0
- {hestia_earth_utils-0.16.2.dist-info → hestia_earth_utils-0.16.3.dist-info}/WHEEL +0 -0
- {hestia_earth_utils-0.16.2.dist-info → hestia_earth_utils-0.16.3.dist-info}/top_level.txt +0 -0
hestia_earth/utils/lookup.py
CHANGED
|
@@ -142,7 +142,7 @@ def _get_multiple_table_values(data: Union[dict, numpy.recarray], col_match: str
|
|
|
142
142
|
return reduce(reducer, enumerate(col_match), data)[col_val][0]
|
|
143
143
|
|
|
144
144
|
|
|
145
|
-
def get_table_value(lookup: Union[dict, numpy.recarray], col_match: str, col_match_with, col_val):
|
|
145
|
+
def get_table_value(lookup: Union[dict, numpy.recarray], col_match: str, col_match_with, col_val, default_value=''):
|
|
146
146
|
"""
|
|
147
147
|
Get a value matched by one or more columns from a `numpy.recarray`.
|
|
148
148
|
|
|
@@ -158,6 +158,8 @@ def get_table_value(lookup: Union[dict, numpy.recarray], col_match: str, col_mat
|
|
|
158
158
|
Can be a single `str` or a list of `str`. If a list is used, must be the same length as `col_match`.
|
|
159
159
|
col_val: str
|
|
160
160
|
The column which contains the value to look for.
|
|
161
|
+
default_value : Any
|
|
162
|
+
A value to return when none if found in the data.
|
|
161
163
|
|
|
162
164
|
Returns
|
|
163
165
|
-------
|
|
@@ -170,7 +172,7 @@ def get_table_value(lookup: Union[dict, numpy.recarray], col_match: str, col_mat
|
|
|
170
172
|
_get_single_table_value(lookup, col_match, col_match_with, col_val) if single else
|
|
171
173
|
_get_multiple_table_values(lookup, col_match, col_match_with, col_val)
|
|
172
174
|
)
|
|
173
|
-
return
|
|
175
|
+
return default_value if is_missing_value(value) else _parse_value(value)
|
|
174
176
|
except Exception:
|
|
175
177
|
return None
|
|
176
178
|
|
hestia_earth/utils/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '0.16.
|
|
1
|
+
VERSION = '0.16.3'
|
|
@@ -7,7 +7,7 @@ hestia_earth/utils/cycle.py,sha256=rFLRL9X4KQ1UrE6fEPA_gV8KmwzrZpR3Ce56zg41lRk,1
|
|
|
7
7
|
hestia_earth/utils/date.py,sha256=SPQ69uxHiv1o3BqIkBKkM5XX_CmS20CB7g6u2rhsdh8,1807
|
|
8
8
|
hestia_earth/utils/descriptive_stats.py,sha256=EMVwFvg2OnZgKRAfireAoWY2EbrSvqR0V0bK9B53p28,1583
|
|
9
9
|
hestia_earth/utils/emission.py,sha256=BhBitooLTxZSh82S982v2QfPxxTF1kmGClG_uHyWdz4,1981
|
|
10
|
-
hestia_earth/utils/lookup.py,sha256=
|
|
10
|
+
hestia_earth/utils/lookup.py,sha256=iZnNQn13_WWFWc3LyL4qPTiL2IA48Db3y4eat5kmcuw,9599
|
|
11
11
|
hestia_earth/utils/lookup_utils.py,sha256=_k3RZ1pK-gw7jq8wn9HrPWfDl4FlEWRb8bXmgaARu0w,6716
|
|
12
12
|
hestia_earth/utils/model.py,sha256=uUcrF07XmBzqLni8VSaP0HoebJnQ57kk0EOmhwYMbfI,4637
|
|
13
13
|
hestia_earth/utils/pipeline.py,sha256=O-6DPtK0U1lJ51LFGa1gM6pjkBJUfxOjNjY8LxQPXV0,9588
|
|
@@ -16,7 +16,7 @@ hestia_earth/utils/stats.py,sha256=4t3op10xDJbGxWJEY1Jtyl302PYWyMFwLpsSkMlzQn8,3
|
|
|
16
16
|
hestia_earth/utils/table.py,sha256=MOJDo5fQPRDogAty_UXbO9-EXFwz97m0f7--mOM17lQ,2363
|
|
17
17
|
hestia_earth/utils/term.py,sha256=6LiUSc6KX3IOkfWF6fYkQ2tENCO8ENljcdDypxU6WtA,1060
|
|
18
18
|
hestia_earth/utils/tools.py,sha256=9GaUJwxL-CTzEOGnRFkUQDVFelPevQSxXrf25vssCVo,4990
|
|
19
|
-
hestia_earth/utils/version.py,sha256=
|
|
19
|
+
hestia_earth/utils/version.py,sha256=2f5woLdAmKvk1TRWtU3KMO3z6ac2wJDnGXIOq8M0TMk,19
|
|
20
20
|
hestia_earth/utils/pivot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
hestia_earth/utils/pivot/_shared.py,sha256=JnyIOzpans45DE2hSa9-4yvNhq8t08lx1IAWGJi6WPQ,1397
|
|
22
22
|
hestia_earth/utils/pivot/pivot_csv.py,sha256=7f6kMqeb1b3RKANLGeDgVu8G5WC-vXIijHnsJhO-CjI,12022
|
|
@@ -26,9 +26,9 @@ hestia_earth/utils/storage/_azure_client.py,sha256=sevCZni04eknMql2DgUsWG23f7u0K
|
|
|
26
26
|
hestia_earth/utils/storage/_local_client.py,sha256=IbzziUKY0QS3ybHFfgEpELqvafa7hQnZ-DdGdjQuypE,515
|
|
27
27
|
hestia_earth/utils/storage/_s3_client.py,sha256=B2yTsf-VfHcRLCKTMes4S_nCXxrZad9umyZx3b5Pu_c,3181
|
|
28
28
|
hestia_earth/utils/storage/_sns_client.py,sha256=LowUatj78Egu6_Id6Rr7hZjfZx1WguS3lozB3yAwSps,347
|
|
29
|
-
hestia_earth_utils-0.16.
|
|
30
|
-
hestia_earth_utils-0.16.
|
|
31
|
-
hestia_earth_utils-0.16.
|
|
32
|
-
hestia_earth_utils-0.16.
|
|
33
|
-
hestia_earth_utils-0.16.
|
|
34
|
-
hestia_earth_utils-0.16.
|
|
29
|
+
hestia_earth_utils-0.16.3.data/scripts/hestia-format-upload,sha256=IhLAHHPJqRgUcht-M_EUEsRMbRbMfshig07o488zscM,703
|
|
30
|
+
hestia_earth_utils-0.16.3.data/scripts/hestia-pivot-csv,sha256=0YBuGuyPO8rytod6iwWEKiQdSlr9JLuD001k6U5t6no,1163
|
|
31
|
+
hestia_earth_utils-0.16.3.dist-info/METADATA,sha256=mP1MsmL8u1Ybatz47kHMAEzVi3hdSXMsrJXfCPfVglg,2030
|
|
32
|
+
hestia_earth_utils-0.16.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
33
|
+
hestia_earth_utils-0.16.3.dist-info/top_level.txt,sha256=q0QxKEYx9uLpAD5ZtC7Ypq29smEPfOzEAn7Xv8XHGOQ,13
|
|
34
|
+
hestia_earth_utils-0.16.3.dist-info/RECORD,,
|
{hestia_earth_utils-0.16.2.data → hestia_earth_utils-0.16.3.data}/scripts/hestia-format-upload
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|