Skip to content

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

Merged
merged 9 commits into from
Feb 14, 2015

Conversation

oesteban
Copy link
Contributor

This PR contains two fixes:

  • Import Undefined that was missing and made the interface fail when using infields
  • Fix behavior when using both infields and dynamically added traits.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) to 70.38% when pulling 58778a7 on oesteban:fix/AddCSVRowUndefined into 9b4e5d3 on nipy:master.


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():
Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Member

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.

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've written the same code using copyable_trait_names, but it is still necessary to check that the key is not 'trait_added'

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 70.43% when pulling 84e5410 on oesteban:fix/AddCSVRowUndefined into c993606 on nipy:master.

@@ -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
Copy link
Member

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.

Copy link
Contributor Author

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 70.42% when pulling 769dece on oesteban:fix/AddCSVRowUndefined into beaedde on nipy:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 70.41% when pulling e53fa06 on oesteban:fix/AddCSVRowUndefined into beaedde on nipy:master.

satra added a commit that referenced this pull request Feb 14, 2015
FIX: AddCSVRow failed when using infields
@satra satra merged commit 017a9b1 into nipy:master Feb 14, 2015
@oesteban oesteban deleted the fix/AddCSVRowUndefined branch February 15, 2015 10:29
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.

3 participants