-
Notifications
You must be signed in to change notification settings - Fork 532
FIX: AddCSVRow failed when using infields #1028
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
Conversation
Conflicts: CHANGES
|
||
input_dict = {} | ||
for key, val in self.inputs._outputs.items(): | ||
# expand lists to several columns | ||
if key == 'trait_added' and val in self.inputs._outputs.keys(): |
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.
Hi @satra, I'm not very happy with this way of checking that 'trait_added'
is not interpreted as one more output. Is there a way to check this more cleanly?. If not, this PR should be merged as it fixes the bad behavior in case there are Undefined inputs.
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.
This situation also happens now in #1047
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.
i haven't looked into that in a while. it's possible to use some combination of np.setdiff1d with copyable_trait_names.
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.
I've written the same code using copyable_trait_names, but it is still necessary to check that the key is not 'trait_added'
Conflicts: CHANGES
@@ -850,22 +853,26 @@ def _run_interface(self, runtime): | |||
try: | |||
import pandas as pd | |||
except ImportError: | |||
raise ImportError('This interface requires pandas (http://pandas.pydata.org/) to run.') | |||
raise ImportError(('This interface requires pandas ' | |||
'(http://pandas.pydata.org/) to run.')) | |||
|
|||
try: | |||
import lockfile as pl |
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.
i know this wasn't the change here, but in nipype.externals there is a lock file code that might work across multiprocessor and possibly in nfs settings. in nfs, the default cache time could be 30s or higher, so the lock may not propagate across nodes without timeout settings in place.
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.
@satra, I've been looking at portalocker
(http://portalocker.readthedocs.org/en/latest/usage.html#examples) included in nipype.externals, and before integrating it in this interface I have a minor concern:
- I think that the script included in nipype.externals is a bit outdated. The new version includes the class Lock that can be used with contexts. Therefore, I would update the external code to this new version.
I would proceed with this PR as it fixes a bug on this interface. Then update portalocker and finally integrate it in all io classes.
Conflicts: CHANGES
FIX: AddCSVRow failed when using infields
This PR contains two fixes:
Undefined
that was missing and made the interface fail when usinginfields
infields
and dynamically added traits.