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

Use workflow.get_nodes to select node inputs/outputs in tests #781

Closed
tsalo opened this issue Jan 31, 2023 · 2 comments · Fixed by #807
Closed

Use workflow.get_nodes to select node inputs/outputs in tests #781

tsalo opened this issue Jan 31, 2023 · 2 comments · Fixed by #807
Labels
testing Improving testing in the project.

Comments

@tsalo
Copy link
Member

tsalo commented Jan 31, 2023

Summary

I've been replacing globs with hardcoded paths in workflow tests, but @mattcieslak made the great point in #757 that this is a fragile approach. He recommended trying out workflow.get_nodes(), which should let me select inputs and outputs of nodes within workflows instead of hardcoding paths.

Stems from #757 (comment).

@tsalo tsalo added the testing Improving testing in the project. label Jan 31, 2023
@tsalo
Copy link
Member Author

tsalo commented Feb 1, 2023

I will need to wait until nipy/nipype#3542 is resolved to start on this.

@tsalo
Copy link
Member Author

tsalo commented Feb 15, 2023

Per @\effigies, the following should work:

res = wf.run()
nodes = {node.fullname: node for node in res.nodes}
nodes['init_minimal_wf.write_string'].output_dir()

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

Successfully merging a pull request may close this issue.

1 participant