Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cavitation-Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Elijah Andrews
Cavitation-Analysis
Commits
c3f60fdf
Commit
c3f60fdf
authored
Oct 22, 2020
by
Elijah Andrews
Browse files
Options
Downloads
Patches
Plain Diff
Allow copying of invalid readings.
parent
729ef092
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
experimental/util/package_data.py
+20
-9
20 additions, 9 deletions
experimental/util/package_data.py
with
20 additions
and
9 deletions
experimental/util/package_data.py
+
20
−
9
View file @
c3f60fdf
...
@@ -7,6 +7,8 @@ from experimental.util.analysis_utils import load_readings
...
@@ -7,6 +7,8 @@ from experimental.util.analysis_utils import load_readings
input_dir
=
"
C:/Users/eda1g15/OneDrive - University of Southampton/Research/Slot Geometries/Data/SlotSweeps/
"
input_dir
=
"
C:/Users/eda1g15/OneDrive - University of Southampton/Research/Slot Geometries/Data/SlotSweeps/
"
output_dir
=
"
C:/Users/eda1g15/OneDrive - University of Southampton/Research/Slot Geometries/Data/Packaged/
"
output_dir
=
"
C:/Users/eda1g15/OneDrive - University of Southampton/Research/Slot Geometries/Data/Packaged/
"
include_invalid
=
True
os
.
makedirs
(
output_dir
)
os
.
makedirs
(
output_dir
)
for
geom_dir
in
os
.
listdir
(
input_dir
):
for
geom_dir
in
os
.
listdir
(
input_dir
):
...
@@ -18,10 +20,19 @@ for geom_dir in os.listdir(input_dir):
...
@@ -18,10 +20,19 @@ for geom_dir in os.listdir(input_dir):
shutil
.
copyfile
(
input_dir
+
geom_dir
+
"
/index.csv
"
,
output_dir
+
geom_dir
+
"
/index.csv
"
)
shutil
.
copyfile
(
input_dir
+
geom_dir
+
"
/index.csv
"
,
output_dir
+
geom_dir
+
"
/index.csv
"
)
shutil
.
copyfile
(
input_dir
+
geom_dir
+
"
/description.txt
"
,
output_dir
+
geom_dir
+
"
/description.txt
"
)
shutil
.
copyfile
(
input_dir
+
geom_dir
+
"
/description.txt
"
,
output_dir
+
geom_dir
+
"
/description.txt
"
)
# Copy
all valid reading
s.
# Copy
movies and plot
s.
readings
=
load_readings
(
input_dir
+
geom_dir
+
"
/readings_dump.csv
"
)
readings
=
load_readings
(
input_dir
+
geom_dir
+
"
/readings_dump.csv
"
)
idxs
=
set
([
r
.
idx
for
r
in
readings
])
idxs
=
set
([
r
.
idx
for
r
in
readings
])
prefix
=
get_prefix_from_idxs
(
input_dir
+
geom_dir
+
"
/
"
,
idxs
)
prefix
=
get_prefix_from_idxs
(
input_dir
+
geom_dir
+
"
/
"
,
idxs
)
if
include_invalid
:
for
idx
in
idxs
:
movie_dir
=
geom_dir
+
"
/
"
+
prefix
+
str
(
idx
).
rjust
(
4
,
'
0
'
)
+
"
/
"
os
.
makedirs
(
output_dir
+
movie_dir
,
exist_ok
=
True
)
for
f
in
os
.
listdir
(
input_dir
+
movie_dir
):
if
f
[
-
4
:]
==
'
.mp4
'
or
f
[
-
4
:]
==
'
.png
'
:
shutil
.
copyfile
(
input_dir
+
movie_dir
+
f
,
output_dir
+
movie_dir
+
f
)
else
:
for
reading
in
readings
:
for
reading
in
readings
:
movie_dir
=
geom_dir
+
"
/
"
+
prefix
+
str
(
reading
.
idx
).
rjust
(
4
,
'
0
'
)
+
"
/
"
movie_dir
=
geom_dir
+
"
/
"
+
prefix
+
str
(
reading
.
idx
).
rjust
(
4
,
'
0
'
)
+
"
/
"
os
.
makedirs
(
output_dir
+
movie_dir
,
exist_ok
=
True
)
os
.
makedirs
(
output_dir
+
movie_dir
,
exist_ok
=
True
)
...
...
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