Skip to content
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

Clean paradigm #316

Merged
merged 3 commits into from Sep 25, 2015
Merged

Clean paradigm #316

merged 3 commits into from Sep 25, 2015

Conversation

bthirion
Copy link
Contributor

@bthirion bthirion commented Apr 8, 2014

Addresses issue #310

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling a6f066d on bthirion:clean_paradigm into 1afc552 on nipy:master.

@@ -48,13 +48,7 @@ def __init__(self, con_id=None, onset=None, amplitude=None):
self.amplitude = amplitude
if con_id is not None:
self.n_events = len(con_id)
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this now? Need deprecation warning or informative error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still worried by backwards compatibility - I think previous behavior was:

import nipy.modalities.fmri.experimental_paradigm as ep
In [2]: ep.Paradigm([1, 2, 3]).con_id
Out[2]: 
array(['c1', 'c2', 'c3'], 
      dtype='|S2')

where behavior on this branch is:

In [3]: ep.Paradigm([1, 2, 3]).con_id
Out[3]: 
array(['1', '2', '3'], 
      dtype='|S1')

I can see that it's a good idea not to convert strings to ints then back to strings, but maybe preserve c prefix if condition names are integers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that in general it is a bad idea to decide that the conditions cannot be named '1', '2' etc. and to change this for the user. Now, if you think that backward compatibility is more important, I can revert that one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK, I can see arguments both ways...

@matthew-brett
Copy link
Member

Bertrand - do you have time to look at these small things?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 125e352 on bthirion:clean_paradigm into 91fddff on nipy:master.

@bthirion
Copy link
Contributor Author

This should be OK now.

@matthew-brett
Copy link
Member

Sorry - so - where are we with issue 310?

@bthirion
Copy link
Contributor Author

For the moment, we raise a warning to avoid breaking compatibility. The behavior will be changed in the next release.

self.con_id = np.array(['c' + str(int(float(c)))
for c in con_id])
for c in con_id])
except:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error are you trying to catch with the except? Should try and avoid bare except if at all possible.

matthew-brett added a commit that referenced this pull request Sep 25, 2015
MRG: fix condition names for paradigm

Addresses issue #310
@matthew-brett matthew-brett merged commit fbbc26f into nipy:master Sep 25, 2015
@matthew-brett
Copy link
Member

Thanks - sorry to be slow in merging.

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

Successfully merging this pull request may close these issues.

None yet

3 participants