relib 1.0.7__py3-none-any.whl → 1.0.8__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
@@ -1,4 +1,5 @@
1
1
  from .utils import (
2
+ non_none,
2
3
  list_split,
3
4
  drop_none,
4
5
  distinct,
relib/measure_duration.py CHANGED
@@ -6,16 +6,15 @@ active_mds = []
6
6
  class measure_duration:
7
7
  def __init__(self, name):
8
8
  self.name = name
9
- self.start = time()
10
9
  active_mds.append(self)
11
10
 
12
11
  def __enter__(self):
13
- pass
12
+ self.start = time()
14
13
 
15
14
  def __exit__(self, *_):
16
15
  duration = round(time() - self.start, 4)
17
- indent_level = len(active_mds) - 1
18
- indentatation = ('──' * indent_level) + (' ' * (indent_level > 0))
16
+ depth = len(active_mds) - 1
17
+ indent = ('──' * depth) + (' ' * (depth > 0))
19
18
  text = '{}: {} seconds'.format(self.name, duration)
20
- print(colored(indentatation + text, attrs=['dark']))
19
+ print(colored(indent + text, attrs=['dark']))
21
20
  active_mds.remove(self)
relib/utils.py CHANGED
@@ -65,6 +65,8 @@ def make_combinations_by_dict(des, keys=None, pairs=[]):
65
65
  ])
66
66
 
67
67
  def merge_dicts(*dicts: dict[K, T]) -> dict[K, T]:
68
+ if len(dicts) == 1:
69
+ return dicts[0]
68
70
  result = {}
69
71
  for d in dicts:
70
72
  result.update(d)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: relib
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Home-page: https://github.com/Reddan/relib
5
5
  Author: Hampus Hallman
6
6
  Author-email: me@hampushallman.com
@@ -0,0 +1,10 @@
1
+ relib/__init__.py,sha256=nz5c2tIomUVXKzQshrt4s9dS_HirItWNa9Aem-9q368,483
2
+ relib/hashing.py,sha256=6iAPRiJI_4jaSooZRFJnqK2limXqTmErzcwpd050LAA,8943
3
+ relib/measure_duration.py,sha256=mTFvqGxKN2vTuHXEaWGHqZ-zm68Gbynxt1u6BHzKEQ8,511
4
+ relib/raypipe.py,sha256=ynEoXs1dnD-360_uQC8v89xjiilt3knpocXpFaQ3plA,1905
5
+ relib/utils.py,sha256=c173SXdFNKC_Mqk5uYBjON1fiQ7yhWB2ebN7AevKgnA,6313
6
+ relib-1.0.8.dist-info/LICENSE.txt,sha256=t9LfkVbmcvZjP0x3Sq-jR38UfTNbNtRQvc0Q8HWmLak,1054
7
+ relib-1.0.8.dist-info/METADATA,sha256=Uzg6-sdBFSerWr-FpdVnea4o8sysG4ZNnofIqgcl9bw,260
8
+ relib-1.0.8.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
9
+ relib-1.0.8.dist-info/top_level.txt,sha256=Yc96FwkbRYj4AQVatga8uK4hH9ATKI9XIyEH_1ba6KQ,6
10
+ relib-1.0.8.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- relib/__init__.py,sha256=4yr8xPi3VMbiFlApussB4OXU_U6wzhje06qD0Ad3Gq4,471
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=II0PikMmpc9Ds2F3jPRXuIFD5RTUk7Bk2-8C4gvL0T8,6271
6
- relib-1.0.7.dist-info/LICENSE.txt,sha256=t9LfkVbmcvZjP0x3Sq-jR38UfTNbNtRQvc0Q8HWmLak,1054
7
- relib-1.0.7.dist-info/METADATA,sha256=Lax2ex1ap8pZJrXzKA4Dc5qnSBt2FqHOS5XK51WJNQQ,260
8
- relib-1.0.7.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
9
- relib-1.0.7.dist-info/top_level.txt,sha256=Yc96FwkbRYj4AQVatga8uK4hH9ATKI9XIyEH_1ba6KQ,6
10
- relib-1.0.7.dist-info/RECORD,,
File without changes