Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
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
ift
resolve
Commits
0cd05395
Commit
0cd05395
authored
Sep 2, 2021
by
Simon Ding
Browse files
Options
Downloads
Patches
Plain Diff
better default params
parent
081fbfd8
No related branches found
No related tags found
1 merge request
!26
Observation slicing
Pipeline
#109078
passed
Sep 2, 2021
Stage: build_docker
Stage: testing
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
resolve/data/observation.py
+4
-4
4 additions, 4 deletions
resolve/data/observation.py
with
4 additions
and
4 deletions
resolve/data/observation.py
+
4
−
4
View file @
0cd05395
...
...
@@ -355,22 +355,22 @@ class Observation(BaseObservation):
)
@staticmethod
def
split_data_file
(
data_path
,
ntask
,
target_folder
,
base_name
,
nwork
):
def
split_data_file
(
data_path
,
ntask
,
target_folder
,
base_name
,
nwork
,
compress
):
from
os
import
makedirs
makedirs
(
target_folder
,
exist_ok
=
True
)
for
rank
in
range
(
ntask
):
lo
,
hi
=
ift
.
utilities
.
shareRange
(
nwork
,
ntask
,
rank
)
obs
=
Observation
.
load
(
data_path
,
(
lo
,
hi
))
obs
.
save
(
f
"
{
target_folder
}
/
{
base_name
}
_
{
rank
}
.npz
"
,
compress
=
False
)
obs
.
save
(
f
"
{
target_folder
}
/
{
base_name
}
_
{
rank
}
.npz
"
,
compress
=
compress
)
@staticmethod
def
mpi_load
(
data_folder
,
base_name
,
full_data_set
,
nwork
,
comm
=
None
):
def
mpi_load
(
data_folder
,
base_name
,
full_data_set
,
nwork
,
comm
=
None
,
compress
=
False
):
if
master
:
from
os.path
import
isdir
if
not
isdir
(
data_folder
):
Observation
.
split_data_file
(
full_data_set
,
comm
.
Get_size
(),
data_folder
,
base_name
,
nwork
)
Observation
.
split_data_file
(
full_data_set
,
comm
.
Get_size
(),
data_folder
,
base_name
,
nwork
,
compress
)
if
comm
is
None
:
return
Observation
.
load
(
full_data_set
)
...
...
...
...
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
sign in
to comment