Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/anonymize_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
# To ensure results are reproducible across runs, you can pass the
# ``random_state`` parameter, causing the random number generator to produce
# the same results every time you execute the function. This may come in handy
# e.g. in situations where you discover a problem with the data while working
# in situations where you discover a problem with the data while working
# with the anonymized dataset, fix the issue in the original dataset, and
# run anonymization again.
#
Expand All @@ -203,6 +203,11 @@
# in a dataset with multiple subjects will the effects of randomly-picked IDs
# become apparent.)
#
# A good random seed is truly random. Avoid using random seeds from popular
# culture, like "42", or "1337". To obtain a truly random seed, you can paste
# the following into your console:
# ``python -c "import secrets; print(secrets.randbits(31))"``
#
# .. note::
# Passing ``random_state`` merely guarantees that subject IDs and time shift
# remain the same across anonymization runs if the original dataset
Expand All @@ -218,6 +223,6 @@
bids_root_in=bids_root,
bids_root_out=bids_root_anon,
datatypes="meg",
random_state=42,
random_state=293201004,
)
print_dir_tree(bids_root_anon)
2 changes: 1 addition & 1 deletion mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -3868,7 +3868,7 @@ def test_anonymize_dataset(_bids_validate, tmpdir):
bids_root_in=bids_root,
bids_root_out=bids_root_anon,
datatypes=["meg", "anat"],
random_state=42,
random_state=1442792182,
)
_bids_validate(bids_root_anon)
assert (bids_root_anon / "sub-1" / "ses-01" / "meg").exists()
Expand Down