Skip to content

Fix ValueError when using ResourceMonitor #3419

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 1 commit into from
Nov 30, 2021

Conversation

HippocampusGirl
Copy link
Contributor

Summary

When running Nipype 1.7.0 with enable_resource_monitor, I get the following error:

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.8/site-packages/halfpipe/plugins/linear.py", line 45, in run
    node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 521, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 639, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/pipeline/engine/nodes.py", line 715, in _run_command
    result = self._interface.run(cwd=outdir, ignore_exception=True)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/core.py", line 398, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.8/site-packages/nipype/interfaces/base/support.py", line 90, in __exit__
    for k, v in self._resmon.stop():
ValueError: too many values to unpack (expected 2)

List of changes proposed in this PR (pull-request)

  • Unpack the dictionary returned by self._resmon.stop() into items for the for loop

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

- Add missing `items()` to unpack dictionary for iteration
@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #3419 (c945fd4) into master (f756b71) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3419   +/-   ##
=======================================
  Coverage   65.21%   65.21%           
=======================================
  Files         307      307           
  Lines       40474    40474           
  Branches     5351     5351           
=======================================
  Hits        26395    26395           
  Misses      13004    13004           
  Partials     1075     1075           
Flag Coverage Δ
unittests 64.95% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nipype/interfaces/base/support.py 82.19% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f756b71...c945fd4. Read the comment docs.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

LGTM.

@effigies effigies merged commit adab17d into nipy:master Nov 30, 2021
@HippocampusGirl HippocampusGirl deleted the fix-resource-monitor-stop branch November 30, 2021 15:09
@effigies effigies added this to the 1.7.1 milestone Apr 3, 2022
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.

2 participants