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

TEST: Fix plugin invocation, use an initializer that can be verified #880

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

effigies
Copy link
Member

Follow-up to #876, which didn't actually test what we wanted it to. We were manually calling print() inside the test and interpreting that as being run on process initialization. We need to pass the config to MultiProcPlugin(), not workflow.run().

capsys does not capture stdout from subprocesses, it seems, so instead I'm telling the subprocesses to touch a file that I choose.

@effigies effigies requested a review from mgxd July 18, 2024 18:49
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.52%. Comparing base (1dc0327) to head (a5e7c67).

Files Patch % Lines
niworkflows/engine/tests/test_plugin.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #880      +/-   ##
==========================================
- Coverage   70.54%   70.52%   -0.03%     
==========================================
  Files          87       87              
  Lines        8202     8203       +1     
  Branches      949      949              
==========================================
- Hits         5786     5785       -1     
- Misses       2409     2411       +2     
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

good catch

Comment on lines 91 to 92
_process_initializer=touch_file,
file_path=init_flag,
Copy link
Contributor

Choose a reason for hiding this comment

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

self.pool = pool or ProcessPoolExecutor(
max_workers=self.processors,
initializer=config._process_initializer,
initargs=(config.file_path,),
mp_context=mp_context,
)

We should really document somewhere _process_initializer's expected signature - I got burned by this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please see the latest changes.

@effigies effigies force-pushed the fix/nipype-plugin branch from b67226e to a5e7c67 Compare July 19, 2024 18:11
@effigies effigies merged commit 99d482d into nipreps:master Jul 26, 2024
26 checks passed
@effigies effigies deleted the fix/nipype-plugin branch July 26, 2024 21:00
mgxd added a commit that referenced this pull request Jul 31, 2024
1.11.0 (July 31, 2024)

New minor release to start the 1.11.x series.

The major changes include:
- a deprecation to T1w-only based template processing
- addition of a new dependency ``acres`` for accessing package data

However, this is still backwards compatible with the 1.10.x series.

* MAINT: Depend on acres for data access
* ENH: Add PrepareDerivative/SaveDerivative interfaces (#885)
* ENH: Make template dimensions support T2w as well (#879)
* ENH: Modify FSSource to output T2 (#868)
* FIX: Set cal_max in the NIfTI header for visualization after ``IntensityClip`` (#878)
* FIX: Remove accidental MRIQC dependency, allow app config to be passed to workflow plugin (#876)
* TEST: Fix plugin invocation, use an initializer that can be verified (#880)
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