Skip to content

Commit

Permalink
Style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasadesus committed Aug 9, 2021
1 parent 579f993 commit 4a44cd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dislib/commons/rf/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,15 @@ def _fill_samples_file(samples_path, row_blocks, start_idx):
rows_samples = Array._merge_blocks(row_blocks)
rows_samples = rows_samples.astype(dtype="float32", casting="same_kind")
samples = np.lib.format.open_memmap(samples_path, mode="r+")
samples[start_idx : start_idx + rows_samples.shape[0]] = rows_samples
samples[start_idx: start_idx + rows_samples.shape[0]] = rows_samples


@task(samples_path=FILE_INOUT, row_blocks={Type: COLLECTION_IN, Depth: 2})
def _fill_features_file(samples_path, row_blocks, start_idx):
rows_samples = Array._merge_blocks(row_blocks)
rows_samples = rows_samples.astype(dtype="float32", casting="same_kind")
samples = np.lib.format.open_memmap(samples_path, mode="r+")
samples[:, start_idx : start_idx + rows_samples.shape[0]] = rows_samples.T
samples[:, start_idx: start_idx + rows_samples.shape[0]] = rows_samples.T


@task(targets_path=FILE_INOUT, row_blocks={Type: COLLECTION_IN, Depth: 2})
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _fill_samples_file(samples_path, row_blocks, start_idx, fortran_order):
samples = np.lib.format.open_memmap(
samples_path, mode="r+", fortran_order=fortran_order
)
samples[start_idx : start_idx + rows_samples.shape[0]] = rows_samples
samples[start_idx: start_idx + rows_samples.shape[0]] = rows_samples


def _fill_features_file(samples_path, row_blocks, start_idx, fortran_order):
Expand All @@ -152,7 +152,7 @@ def _fill_features_file(samples_path, row_blocks, start_idx, fortran_order):
samples = np.lib.format.open_memmap(
samples_path, mode="r+", fortran_order=fortran_order
)
samples[:, start_idx : start_idx + rows_samples.shape[0]] = rows_samples.T
samples[:, start_idx: start_idx + rows_samples.shape[0]] = rows_samples.T


def _fill_targets_file(targets_path, row_blocks):
Expand Down

0 comments on commit 4a44cd3

Please sign in to comment.