lkj 0.1.41__py3-none-any.whl → 0.1.42__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.
- lkj/dicts.py +7 -2
- {lkj-0.1.41.dist-info → lkj-0.1.42.dist-info}/METADATA +1 -1
- {lkj-0.1.41.dist-info → lkj-0.1.42.dist-info}/RECORD +6 -6
- {lkj-0.1.41.dist-info → lkj-0.1.42.dist-info}/LICENSE +0 -0
- {lkj-0.1.41.dist-info → lkj-0.1.42.dist-info}/WHEEL +0 -0
- {lkj-0.1.41.dist-info → lkj-0.1.42.dist-info}/top_level.txt +0 -0
lkj/dicts.py
CHANGED
|
@@ -224,6 +224,10 @@ Comparison = Any
|
|
|
224
224
|
Comparator = Callable[[dict, dict], Comparison]
|
|
225
225
|
|
|
226
226
|
|
|
227
|
+
def _common_keys_list(dict1, dict2):
|
|
228
|
+
return [k for k in dict1.keys() if k in dict2.keys()]
|
|
229
|
+
|
|
230
|
+
|
|
227
231
|
def compare_field_values(
|
|
228
232
|
dict1,
|
|
229
233
|
dict2,
|
|
@@ -232,7 +236,8 @@ def compare_field_values(
|
|
|
232
236
|
default_comparator: Comparator = operator.eq,
|
|
233
237
|
aggregator: Callable[
|
|
234
238
|
[Dict[KT, Comparison]], Any
|
|
235
|
-
] = lambda d: d, # lambda d: np.mean(list(d.values()))
|
|
239
|
+
] = lambda d: d, # lambda d: np.mean(list(d.values())),
|
|
240
|
+
get_comparison_fields: Callable[[dict], Iterable[KT]] = _common_keys_list,
|
|
236
241
|
):
|
|
237
242
|
"""
|
|
238
243
|
Compare two dictionaries' values field by field
|
|
@@ -266,7 +271,7 @@ def compare_field_values(
|
|
|
266
271
|
0.5
|
|
267
272
|
|
|
268
273
|
"""
|
|
269
|
-
common_keys =
|
|
274
|
+
common_keys = get_comparison_fields(dict1, dict2)
|
|
270
275
|
|
|
271
276
|
comparisons = {}
|
|
272
277
|
for key in common_keys:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
lkj/__init__.py,sha256=Vceal0uY2jW1y0sQHOk1WHXc9aTAEXXOJ9vgyOmnrNk,6868
|
|
2
2
|
lkj/chunking.py,sha256=RpNdx5jEuO4mFg2qoTkD47iL35neBneuZ5xgQ_cBkiM,3755
|
|
3
|
-
lkj/dicts.py,sha256=
|
|
3
|
+
lkj/dicts.py,sha256=z2o7njvLNJkh1ZgSH-SLtz13SdW_YfUsTA1yTY-kVLE,10382
|
|
4
4
|
lkj/filesys.py,sha256=NbWDuc848h8O42gwX7d9yNJkrWBgzSFnkoEdSRgvBAg,8883
|
|
5
5
|
lkj/funcs.py,sha256=LXJlj3gMMsbD0t2gn2NZZ6mOqmW5bxM-94uGoYgrhzI,8930
|
|
6
6
|
lkj/importing.py,sha256=_BFBmdaKCBnk5broltWDeAPeEKG1dEkS8DhIdv6UhSI,3809
|
|
@@ -8,8 +8,8 @@ lkj/iterables.py,sha256=9jeO36w-IGiZryge7JKgXZOGZAgehUvhwKV3nHPcZWk,2801
|
|
|
8
8
|
lkj/loggers.py,sha256=ImmBdacz89Lvb3dg_xI5jOct_44rSRv0hNI_CVehy60,13706
|
|
9
9
|
lkj/misc.py,sha256=IZf05tkl0cgiMgBwCMH5cLSC59fRXwnemPRo8G0OxQg,1436
|
|
10
10
|
lkj/strings.py,sha256=3YjlxOWUfzWqwu51uq_pv9XZReLqRFvziGtRsdzEtw8,24662
|
|
11
|
-
lkj-0.1.
|
|
12
|
-
lkj-0.1.
|
|
13
|
-
lkj-0.1.
|
|
14
|
-
lkj-0.1.
|
|
15
|
-
lkj-0.1.
|
|
11
|
+
lkj-0.1.42.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
lkj-0.1.42.dist-info/METADATA,sha256=vvlxvyZs9Nz9Uk_9l5ZNToXTrViVa4WOKVH5YkDzsHU,4684
|
|
13
|
+
lkj-0.1.42.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
14
|
+
lkj-0.1.42.dist-info/top_level.txt,sha256=3DZOUwYmyurJFBXQCvCmEIVm8z2b42O5Sx3RDQyePfg,4
|
|
15
|
+
lkj-0.1.42.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|