Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Binary paint shop problem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Jiří Kalvoda
Binary paint shop problem
Commits
6ba130c1
Commit
6ba130c1
authored
1 year ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
data_lib: Remove duplicity
parent
c92ea45d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data_lib.py
+8
-1
8 additions, 1 deletion
data_lib.py
prace/bakalarka/g.py
+1
-1
1 addition, 1 deletion
prace/bakalarka/g.py
with
9 additions
and
2 deletions
data_lib.py
+
8
−
1
View file @
6ba130c1
...
...
@@ -68,7 +68,7 @@ class Run:
return
self
.
algo_version
==
self
.
algo
.
current_version
class
Data
:
def
__init__
(
self
,
logfile
=
None
,
validate_versions
=
True
):
def
__init__
(
self
,
logfile
=
None
,
validate_versions
=
True
,
remove_duplications
=
False
):
self
.
validate_versions
=
validate_versions
logfile
=
logfile
or
os
.
environ
.
get
(
'
LOGFILE
'
,
'
log
'
)
raw_json
=
"
[
"
+
open
(
logfile
,
mode
=
'
r
'
).
read
()[
0
:
-
2
]
+
"
]
"
...
...
@@ -78,10 +78,17 @@ class Data:
self
.
pipelines
=
{}
self
.
runs
=
[]
duplication_checker
=
{}
for
it
in
raw_data
:
run
=
Run
(
self
,
it
)
self
.
runs
.
append
(
run
)
if
not
validate_versions
or
run
.
is_up_to_date
():
if
remove_duplications
:
key
=
(
run
.
n
,
run
.
seed
,
run
.
print_pipeline
())
if
key
in
duplication_checker
:
continue
duplication_checker
[
key
]
=
run
self
.
pipelines
.
setdefault
(
run
.
print_pipeline
(),
[])
self
.
pipelines
[
run
.
print_pipeline
()].
append
(
run
)
...
...
This diff is collapsed.
Click to expand it.
prace/bakalarka/g.py
+
1
−
1
View file @
6ba130c1
...
...
@@ -9,7 +9,7 @@ import sys, os
d
=
pathlib
.
Path
(
"
/
"
.
join
(
__file__
.
split
(
"
/
"
)[:
-
1
]))
def
load
(
name
):
return
data_lib
.
Data
(
d
/
name
,
validate_versions
=
False
)
return
data_lib
.
Data
(
d
/
name
,
validate_versions
=
False
,
remove_duplications
=
True
)
def
load_main_test
():
return
load
(
d
/
"
main_test/log
"
)
...
...
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