Skip to content

Commit

Permalink
Merge pull request #210 from jhlegarreta/PreferUsingRngGenerator
Browse files Browse the repository at this point in the history
STYLE: Set a seed for random number generation reproducibility
  • Loading branch information
oesteban authored Jun 12, 2024
2 parents f9078cc + 1e65e59 commit f8ff8e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@


def test_apply_affines():
rng = np.random.default_rng(1234)

# Create synthetic dataset
nii_data = np.random.rand(10, 10, 10, 10)
nii_data = rng.random((10, 10, 10, 10))

# Generate Nifti1Image
nii = nib.Nifti1Image(nii_data, np.eye(4))
Expand Down

0 comments on commit f8ff8e3

Please sign in to comment.