Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
2019194a
Commit
2019194a
authored
5 years ago
by
Felix Kleinert
Browse files
Options
Downloads
Patches
Plain Diff
update pop_list fuction to behave like dict_pop
parent
a3f714b7
No related branches found
No related tags found
3 merge requests
!90
WIP: new release update
,
!89
Resolve "release branch / CI on gpu"
,
!84
Felix issue080 testing test helpers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/helpers.py
+6
-8
6 additions, 8 deletions
src/helpers.py
with
6 additions
and
8 deletions
src/helpers.py
+
6
−
8
View file @
2019194a
...
@@ -201,19 +201,17 @@ def float_round(number: float, decimals: int = 0, round_type: Callable = math.ce
...
@@ -201,19 +201,17 @@ def float_round(number: float, decimals: int = 0, round_type: Callable = math.ce
return
round_type
(
number
*
multiplier
)
/
multiplier
return
round_type
(
number
*
multiplier
)
/
multiplier
def
dict_pop
(
dict
:
Dict
,
pop_keys
):
pop_keys
=
to_list
(
pop_keys
)
return
{
k
:
v
for
k
,
v
in
dict
.
items
()
if
k
not
in
pop_keys
}
def
list_pop
(
list_full
:
list
,
pop_items
):
def
list_pop
(
list_full
:
list
,
pop_items
):
pop_items
=
to_list
(
pop_items
)
pop_items
=
to_list
(
pop_items
)
if
len
(
pop_items
)
>
1
:
if
len
(
pop_items
)
>
1
:
return
[
e
for
e
in
list_full
if
e
not
in
pop_items
]
return
[
e
for
e
in
list_full
if
e
not
in
pop_items
]
else
:
else
:
list_pop
=
list_full
.
copy
()
l_pop
=
list_full
.
copy
()
list_pop
.
remove
(
pop_items
[
0
])
try
:
return
list_pop
l_pop
.
remove
(
pop_items
[
0
])
except
ValueError
:
pass
return
l_pop
def
dict_pop
(
dict_orig
:
Dict
,
pop_keys
):
def
dict_pop
(
dict_orig
:
Dict
,
pop_keys
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment