-
Notifications
You must be signed in to change notification settings - Fork 5
TST: Add a fixture to create random PET data for tests #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
23b4f44
to
13c2a38
Compare
@mnoergaard a few notes here:
Thanks. Edit: I will rebase this on |
c71a93b
to
fa28216
Compare
Not sure why new values are required here: the seed has not changed here, and the function does not use the fixtures: Any idea @oesteban ? |
8cc5c06
to
72b0170
Compare
pet_dataobj, affine = _generate_random_uniform_spatial_data( | ||
request, (*vol_size, n_frames), 0.0, 1.0 | ||
) | ||
brainmask_dataobj = rng.choice([True, False], size=vol_size).astype(np.uint8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error
> raise ValueError('could not interpret dimensions')
E ValueError: could not interpret dimensions
/home/runner/work/nifreeze/nifreeze/.tox/py312/lib/python3.12/site-packages/scipy/sparse/_base.py:862: ValueError
in
https://github.com/nipreps/nifreeze/actions/runs/16487019808/job/46613619943?pr=181#step:11:3671
seems to happen because brainmask_dataobj is of type np.uint8
. I used that for the sake of consistency, but the fact it should may be a boolean has been raised previously. If that is changed to bool
the test at issue passes. If one instantiates the mask in the removed _create_dataset
function as a np.uint8
the same error is raised.
91fad45
to
66f68ca
Compare
Use class attribute instead of outer variable in PET test dummy class.
Use existing random spatial data generation fixture in PET data test for the sake of consistency.
Add a fixture to create random PET data for tests. Adopt the fixture across PET tests.
Set new spike expected indices in test after new fixture addition Similar to commit 4926a35. Fixes: ``` FAILED test/test_analysis.py::test_identify_spikes - assert False + where False = <function array_equal at 0x7ffa597b79b0>( array([ 42, 48, 61, 80, 98, 103, 113, 143, 324, 387, 422, 436, 449]), array([ 82, 83, 160, 179, 208, 219, 229, 233, 383, 389, 402, 421, 423,\n 439, 444])) + where <function array_equal at 0x7ffa597b79b0> = np.array_equal ``` raised in: https://github.com/nipreps/nifreeze/actions/runs/16485937114/job/46610541473?pr=181#step:11:918
66f68ca
to
50dc751
Compare
Uh oh!
There was an error while loading. Please reload this page.