Skip to content
Snippets Groups Projects
Commit b469625a authored by Daniel Guderian's avatar Daniel Guderian
Browse files

Merge remote-tracking branch 'origin/master' into concatenate_scripts

parents 88707a1a 6a16ea6f
No related branches found
No related tags found
1 merge request!14revive make_data_split
...@@ -20,7 +20,7 @@ def h5shuffle2( ...@@ -20,7 +20,7 @@ def h5shuffle2(
iterations=None, iterations=None,
datasets=("x", "y"), datasets=("x", "y"),
max_ram_fraction=0.25, max_ram_fraction=0.25,
**kwargs, max_ram=None,
): ):
if output_file is None: if output_file is None:
output_file = get_filepath_output(input_file, shuffle=True) output_file = get_filepath_output(input_file, shuffle=True)
...@@ -29,6 +29,7 @@ def h5shuffle2( ...@@ -29,6 +29,7 @@ def h5shuffle2(
input_file, input_file,
datasets=datasets, datasets=datasets,
max_ram_fraction=max_ram_fraction, max_ram_fraction=max_ram_fraction,
max_ram=max_ram,
) )
np.random.seed(42) np.random.seed(42)
for i in range(iterations): for i in range(iterations):
...@@ -63,10 +64,10 @@ def h5shuffle2( ...@@ -63,10 +64,10 @@ def h5shuffle2(
} }
shuffle_file( shuffle_file(
datasets=datasets, datasets=datasets,
max_ram=max_ram,
max_ram_fraction=max_ram_fraction, max_ram_fraction=max_ram_fraction,
chunks=True, chunks=True,
**stgs, **stgs,
**kwargs,
) )
...@@ -370,4 +371,11 @@ def run_parser(): ...@@ -370,4 +371,11 @@ def run_parser():
default=None, default=None,
help="Shuffle the file this many times. Default: Auto choose best number.", help="Shuffle the file this many times. Default: Auto choose best number.",
) )
parser.add_argument(
"--max_ram",
type=int,
default=None,
help="Available ram in bytes. Default: Use fraction of maximum "
"available instead (see max_ram_fraction).",
)
h5shuffle2(**vars(parser.parse_args())) h5shuffle2(**vars(parser.parse_args()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment