oceanproc 1.3.4__tar.gz → 1.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {oceanproc-1.3.4 → oceanproc-1.3.5}/PKG-INFO +1 -1
  2. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/ocean_proc.py +1 -1
  3. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/utils.py +20 -13
  4. {oceanproc-1.3.4 → oceanproc-1.3.5}/pyproject.toml +1 -1
  5. {oceanproc-1.3.4 → oceanproc-1.3.5}/README.md +0 -0
  6. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/__init__.py +0 -0
  7. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/bids_wrapper.py +0 -0
  8. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/events_long.py +0 -0
  9. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/firstlevel/__init__.py +0 -0
  10. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/firstlevel/run_glm.py +0 -0
  11. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/firstlevel/tests/__init__.py +0 -0
  12. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/firstlevel/tests/test_run_glm.py +0 -0
  13. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/group_series.py +0 -0
  14. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/grouplevel/__init__.py +0 -0
  15. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/grouplevel/computations.py +0 -0
  16. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/grouplevel/design_mat_utils.py +0 -0
  17. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/grouplevel/dscalar_utils.py +0 -0
  18. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/grouplevel/utils.py +0 -0
  19. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/oceanparse.py +0 -0
  20. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/preprocessing_wrapper.py +0 -0
  21. {oceanproc-1.3.4 → oceanproc-1.3.5}/oceanproc/segmentation_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oceanproc
3
- Version: 1.3.4
3
+ Version: 1.3.5
4
4
  Summary: MRI preprocessing for WUSTL Ocean labs
5
5
  Author-Email: Ramone Agard <rhagard@wustl.edu>, Joey Scanga <joeyscanga92@gmail.com>
6
6
  Requires-Python: <3.13,>=3.10
@@ -103,7 +103,7 @@ def main():
103
103
  epilog="An arguments file can be accepted with @FILEPATH.\nAny additional arguments not listed in the help message will be passed to the preprocessing subprocess.",
104
104
  allow_abbrev=False
105
105
  )
106
- parser.add_argument("--version", action="version", version='%(prog)s v1.3.3')
106
+ parser.add_argument("--version", action="version", version='%(prog)s v1.3.5')
107
107
  session_args = parser.add_argument_group("Session Specific")
108
108
  config_args = parser.add_argument_group("Configuration Arguments", "These arguments are saved to a file if the '--export_args' option is used")
109
109
 
@@ -2,7 +2,7 @@ import sys
2
2
  import logging
3
3
  from pathlib import Path
4
4
  import json
5
- from subprocess import Popen, PIPE
5
+ from subprocess import DEVNULL, STDOUT, Popen, PIPE
6
6
  import shlex
7
7
  from types import SimpleNamespace
8
8
  import nibabel as nib
@@ -243,19 +243,26 @@ def run_subprocess(cmd: str, title: str, log_output=True, quiet=False):
243
243
  split_cmd = shlex.split(cmd)
244
244
  logger.info(f"running '{title}' with the following command: \n{' '.join(split_cmd)}\n")
245
245
  prepare_subprocess_logging(logger)
246
- ecode = 0
247
- with Popen(split_cmd, stdout=PIPE, stderr=PIPE) as p:
248
- while p.poll() == None:
249
- if log_output:
250
- for line in p.stdout:
251
- logger.info(line.decode("utf-8", "ignore"))
252
- for line in p.stderr:
253
- logger.info(line.decode("utf-8", "ignore"))
246
+ ecode=0
247
+ try:
248
+ with Popen(
249
+ split_cmd,
250
+ stdin=DEVNULL,
251
+ stdout=PIPE,
252
+ stderr=STDOUT,
253
+ text=True,
254
+ errors="ignore"
255
+ ) as p:
256
+ for line in p.stdout:
257
+ if log_output:
258
+ logger.info(line)
259
+ ecode = p.returncode
260
+ finally:
254
261
  prepare_subprocess_logging(logger, stop=True)
255
- ecode = p.poll()
256
- p.kill()
257
- if (ecode != 0) and (not quiet):
258
- raise RuntimeError(f"process -'{title}'- has ended with a non-zero exit code <{ecode}>.")
262
+
263
+ if (ecode != 0) and (not quiet):
264
+ raise RuntimeError(f"process -'{title}'- has ended with a non-zero exit code <{ecode}>.")
265
+
259
266
  return ecode
260
267
 
261
268
 
@@ -34,7 +34,7 @@ dependencies = [
34
34
  "pybids>=0.16.3",
35
35
  ]
36
36
  name = "oceanproc"
37
- version = "1.3.4"
37
+ version = "1.3.5"
38
38
  description = "MRI preprocessing for WUSTL Ocean labs"
39
39
  readme = "README.md"
40
40
 
File without changes