From fb74c182df6f30845d63a37f4ce90f77cb01a401 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Mon, 27 Feb 2023 20:08:47 +0100
Subject: [PATCH 1/2] Fix _repr_svg_ for ProcessCollection

---
 b_asic/resources.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/b_asic/resources.py b/b_asic/resources.py
index 2d85c2b8..63b6f7bf 100644
--- a/b_asic/resources.py
+++ b/b_asic/resources.py
@@ -517,7 +517,7 @@ class ProcessCollection:
         e.g. Jupyter Qt console.
         """
         fig, ax = plt.subplots()
-        self.draw_lifetime_chart(ax, show_markers=False)
+        self.plot(ax, show_markers=False)
         f = io.StringIO()
         fig.savefig(f, format="svg")
 
-- 
GitLab


From b138c5f947943f3d13dc70ca3c475411e5152816 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Mon, 27 Feb 2023 20:24:11 +0100
Subject: [PATCH 2/2] Refactor code based on recommendation

---
 b_asic/resources.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/b_asic/resources.py b/b_asic/resources.py
index 63b6f7bf..9a56b514 100644
--- a/b_asic/resources.py
+++ b/b_asic/resources.py
@@ -24,8 +24,13 @@ _T = TypeVar('_T')
 
 def _sorted_nicely(to_be_sorted: Iterable[_T]) -> List[_T]:
     """Sort the given iterable in the way that humans expect."""
-    convert = lambda text: int(text) if text.isdigit() else text
-    alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', str(key))]
+
+    def convert(text):
+        return int(text) if text.isdigit() else text
+
+    def alphanum_key(key):
+        return [convert(c) for c in re.split('([0-9]+)', str(key))]
+
     return sorted(to_be_sorted, key=alphanum_key)
 
 
-- 
GitLab