Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Code logic wierdness in experimental_paradigms.py #252

Closed
kchawla-pi opened this issue Oct 5, 2018 · 2 comments
Closed

Code logic wierdness in experimental_paradigms.py #252

kchawla-pi opened this issue Oct 5, 2018 · 2 comments
Assignees

Comments

@kchawla-pi
Copy link
Collaborator

In nistats/experimental_paradigms.py, the code is a little weird, or could use a few comments explaining what's going on there.
First up:
Line # 54

    trial_type = np.repeat('dummy', n_events)

The trial_type is available in the events file so why are we generating this dummy data?

Second:
Line # 57 onwards

    if 'trial_type' in paradigm.keys():
        warnings.warn("'trial_type' key not found in the given paradigm.")
        trial_type = np.array(paradigm['trial_type'])

In effect we are generating the warning that the events data does not have the key 'trial_type' when it in fact does? And then we proceed to use that events data?
Same with subsequent code:

    if 'duration' in paradigm.keys():
        warnings.warn("'duration' key not found in the given paradigm.")
        duration = np.array(paradigm['duration']).astype(np.float)
    if 'modulation' in paradigm.keys():
        warnings.warn("'modulation' key not found in the given paradigm.")
        modulation = np.array(paradigm['modulation']).astype(np.float)
    return trial_type, onset, duration, modulation
@kchawla-pi kchawla-pi self-assigned this Oct 5, 2018
@kchawla-pi kchawla-pi changed the title Ccode logic wierdness in experimental_paradigms.py Code logic wierdness in experimental_paradigms.py Oct 5, 2018
@kchawla-pi
Copy link
Collaborator Author

Seems PR #236 is on top of this one.

@kchawla-pi
Copy link
Collaborator Author

Fixed in #236

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant