Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: Set DistributedPluginBase.refidx type correctly #3340

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
Jun 2, 2021

Conversation

effigies
Copy link
Member

Summary

In 39c4ee3, we had

     def _generate_dependency_list(self, graph):
         """ Generates a dependency list for a list of graphs.
         """
         self.procs = graph.nodes()
-        self.depidx = nx.adj_matrix(graph).__array__()
-        self.refidx = deepcopy(self.depidx>0)
-        self.refidx.dtype = np.int8
+        self.depidx = ssp.lil_matrix(nx.adj_matrix(graph).__array__())
+        self.refidx = deepcopy(self.depidx)
+        self.refidx.astype = np.int
         self.proc_done    = np.zeros(len(self.procs), dtype=bool)
         self.proc_pending = np.zeros(len(self.procs), dtype=bool)

This looks like a typo, that should have been self.refidx = deepcopy(self.depidx).astype(np.int) or similar.

In this PR, I simply use self.depidx.astype(int). scipy.sparse.lil_matrix.astype copies by default.

Found while removing a deprecated call to np.int.

I also remove a guard for networkx versions that were old in 2012: b908b84

@codecov
Copy link

codecov bot commented May 30, 2021

Codecov Report

Merging #3340 (f250f5c) into master (d02750a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3340   +/-   ##
=======================================
  Coverage   65.01%   65.01%           
=======================================
  Files         302      302           
  Lines       40035    40031    -4     
  Branches     5291     5291           
=======================================
- Hits        26029    26027    -2     
+ Misses      12935    12933    -2     
  Partials     1071     1071           
Flag Coverage Δ
unittests 64.79% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
nipype/pipeline/plugins/base.py 58.17% <100.00%> (+0.08%) ⬆️

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 d02750a...f250f5c. Read the comment docs.

@effigies
Copy link
Member Author

Didn't break things. Will merge before a 1.6.1 release, unless I see an objection.

@effigies effigies added this to the 1.6.1 milestone May 30, 2021
@effigies effigies merged commit 61846d5 into nipy:master Jun 2, 2021
@effigies effigies deleted the fix/astype branch June 2, 2021 12:59
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.

1 participant