lkj 0.1.41__tar.gz → 0.1.42__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lkj
3
- Version: 0.1.41
3
+ Version: 0.1.42
4
4
  Summary: A dump of homeless useful utils
5
5
  Home-page: https://github.com/thorwhalen/lkj
6
6
  Author: Thor Whalen
@@ -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 = [k for k in dict1.keys() if k in dict2.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
  Metadata-Version: 2.1
2
2
  Name: lkj
3
- Version: 0.1.41
3
+ Version: 0.1.42
4
4
  Summary: A dump of homeless useful utils
5
5
  Home-page: https://github.com/thorwhalen/lkj
6
6
  Author: Thor Whalen
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = lkj
3
- version = 0.1.41
3
+ version = 0.1.42
4
4
  url = https://github.com/thorwhalen/lkj
5
5
  platforms = any
6
6
  description_file = README.md
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes