relib 1.0.0__py3-none-any.whl → 1.0.1__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.
relib/__init__.py CHANGED
@@ -13,6 +13,7 @@ from .utils import (
13
13
  tuple_by,
14
14
  flatten,
15
15
  transpose,
16
+ map_dict,
16
17
  deepen_dict,
17
18
  group,
18
19
  sized_partitions,
relib/utils.py CHANGED
@@ -3,6 +3,7 @@ import re
3
3
 
4
4
  T = TypeVar('T')
5
5
  U = TypeVar('U')
6
+ K = TypeVar('K')
6
7
 
7
8
  def list_split(l: list[T], sep: T) -> list[list[T]]:
8
9
  l = [sep, *l, sep]
@@ -87,6 +88,9 @@ def transpose(tuples, default_num_returns=0):
87
88
  return ([],) * default_num_returns
88
89
  return tuple(map(list, result))
89
90
 
91
+ def map_dict(fn: Callable[[T], U], d: dict[K, T]) -> dict[K, U]:
92
+ return {key: fn(value) for key, value in d.items()}
93
+
90
94
  def deepen_dict(d):
91
95
  result = {}
92
96
  for (*tail, head), value in d.items():
@@ -1,16 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: relib
3
- Version: 1.0.0
4
- Summary: UNKNOWN
3
+ Version: 1.0.1
5
4
  Home-page: https://github.com/Reddan/relib
6
5
  Author: Hampus Hallman
7
6
  Author-email: me@hampushallman.com
8
7
  License: MIT
9
- Platform: UNKNOWN
10
8
  Requires-Python: ~=3.10
11
9
  License-File: LICENSE.txt
12
10
  Requires-Dist: termcolor
13
11
  Requires-Dist: numpy
14
12
 
15
- UNKNOWN
16
-
@@ -0,0 +1,10 @@
1
+ relib/__init__.py,sha256=Mcy5O19R8A7zfdGeXFhrnLfqNlCWs-8LnnHtV0E7GnA,421
2
+ relib/hashing.py,sha256=6iAPRiJI_4jaSooZRFJnqK2limXqTmErzcwpd050LAA,8943
3
+ relib/measure_duration.py,sha256=jJa5Kh5FxaBysS__nkwqcnTt8Uc2niLucXfTzFE0j-E,555
4
+ relib/raypipe.py,sha256=ynEoXs1dnD-360_uQC8v89xjiilt3knpocXpFaQ3plA,1905
5
+ relib/utils.py,sha256=n2b5ntvgOIEwiwbX75hcD_-QEJii8Tn301-Afl7Z-RI,4100
6
+ relib-1.0.1.dist-info/LICENSE.txt,sha256=t9LfkVbmcvZjP0x3Sq-jR38UfTNbNtRQvc0Q8HWmLak,1054
7
+ relib-1.0.1.dist-info/METADATA,sha256=pXhcA9hlsGXnJrbTrceC1hM25-MdlFDUUOjq5T99khc,260
8
+ relib-1.0.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
9
+ relib-1.0.1.dist-info/top_level.txt,sha256=Yc96FwkbRYj4AQVatga8uK4hH9ATKI9XIyEH_1ba6KQ,6
10
+ relib-1.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.0)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- relib/__init__.py,sha256=iWRUAQIrz7dOM7Bki07MOBzhZaB9I_57WMLvM4R6cZk,409
2
- relib/hashing.py,sha256=6iAPRiJI_4jaSooZRFJnqK2limXqTmErzcwpd050LAA,8943
3
- relib/measure_duration.py,sha256=jJa5Kh5FxaBysS__nkwqcnTt8Uc2niLucXfTzFE0j-E,555
4
- relib/raypipe.py,sha256=ynEoXs1dnD-360_uQC8v89xjiilt3knpocXpFaQ3plA,1905
5
- relib/utils.py,sha256=Hak2WqcnNCGU70t67F18FIv7Q5G6bX3UAl7w0WxyBVI,3963
6
- relib-1.0.0.dist-info/LICENSE.txt,sha256=t9LfkVbmcvZjP0x3Sq-jR38UfTNbNtRQvc0Q8HWmLak,1054
7
- relib-1.0.0.dist-info/METADATA,sha256=6qgeEHMkxkamhEBwtr0u1M2c9O9QxetVq4bAaVQrXOw,304
8
- relib-1.0.0.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
9
- relib-1.0.0.dist-info/top_level.txt,sha256=Yc96FwkbRYj4AQVatga8uK4hH9ATKI9XIyEH_1ba6KQ,6
10
- relib-1.0.0.dist-info/RECORD,,