Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Merge requests
!240
Fix _repr_svg_ and refactor sorting
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix _repr_svg_ and refactor sorting
sortrefactor
into
master
Overview
0
Commits
2
Pipelines
1
Changes
1
Merged
Oscar Gustafsson
requested to merge
sortrefactor
into
master
2 years ago
Overview
0
Commits
2
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
b138c5f9
2 commits,
2 years ago
1 file
+
8
−
3
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b_asic/resources.py
+
8
−
3
Options
@@ -24,8 +24,13 @@ _T = TypeVar('_T')
@@ -24,8 +24,13 @@ _T = TypeVar('_T')
def
_sorted_nicely
(
to_be_sorted
:
Iterable
[
_T
])
->
List
[
_T
]:
def
_sorted_nicely
(
to_be_sorted
:
Iterable
[
_T
])
->
List
[
_T
]:
"""
Sort the given iterable in the way that humans expect.
"""
"""
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
)
return
sorted
(
to_be_sorted
,
key
=
alphanum_key
)
@@ -517,7 +522,7 @@ class ProcessCollection:
@@ -517,7 +522,7 @@ class ProcessCollection:
e.g. Jupyter Qt console.
e.g. Jupyter Qt console.
"""
"""
fig
,
ax
=
plt
.
subplots
()
fig
,
ax
=
plt
.
subplots
()
self
.
draw_lifetime_char
t
(
ax
,
show_markers
=
False
)
self
.
plo
t
(
ax
,
show_markers
=
False
)
f
=
io
.
StringIO
()
f
=
io
.
StringIO
()
fig
.
savefig
(
f
,
format
=
"
svg
"
)
fig
.
savefig
(
f
,
format
=
"
svg
"
)
Loading