rapidtide 3.0a13__py3-none-any.whl → 3.0a15__py3-none-any.whl

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 (232) hide show
  1. rapidtide/Colortables.py +1 -1
  2. rapidtide/DerivativeDelay.py +4 -2
  3. rapidtide/OrthoImageItem.py +1 -1
  4. rapidtide/RapidtideDataset.py +3 -1
  5. rapidtide/RegressorRefiner.py +1 -1
  6. rapidtide/calcandfitcorrpairs.py +1 -1
  7. rapidtide/calccoherence.py +1 -1
  8. rapidtide/calcnullsimfunc.py +1 -1
  9. rapidtide/calcsimfunc.py +1 -1
  10. rapidtide/correlate.py +1 -1
  11. rapidtide/data/examples/src/test_findmaxlag.py +1 -1
  12. rapidtide/data/examples/src/testdelayvar +2 -1
  13. rapidtide/data/examples/src/testfmri +3 -2
  14. rapidtide/data/examples/src/testfuncs +1 -1
  15. rapidtide/data/examples/src/testhappy +12 -1
  16. rapidtide/data/examples/src/testmodels +33 -0
  17. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.png +0 -0
  18. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/loss.txt +1 -0
  19. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model.keras +0 -0
  20. rapidtide/data/models/model_cnn_w064_l13_fn20_fl08/model_meta.json +167 -0
  21. rapidtide/data/models/model_revised_tf2/model.keras +0 -0
  22. rapidtide/data/models/{model_serdar → model_revised_tf2}/model_meta.json +1 -1
  23. rapidtide/data/models/model_serdar2_tf2/model.keras +0 -0
  24. rapidtide/data/models/{model_serdar2 → model_serdar2_tf2}/model_meta.json +1 -1
  25. rapidtide/data/models/model_serdar_tf2/model.keras +0 -0
  26. rapidtide/data/models/{model_revised → model_serdar_tf2}/model_meta.json +1 -1
  27. rapidtide/dlfilter.py +325 -241
  28. rapidtide/externaltools.py +1 -1
  29. rapidtide/fMRIData_class.py +1 -1
  30. rapidtide/filter.py +1 -8
  31. rapidtide/fit.py +1 -8
  32. rapidtide/happy_supportfuncs.py +30 -1
  33. rapidtide/helper_classes.py +1 -1
  34. rapidtide/io.py +1 -1
  35. rapidtide/linfitfiltpass.py +3 -1
  36. rapidtide/makelaggedtcs.py +9 -6
  37. rapidtide/maskutil.py +1 -1
  38. rapidtide/miscmath.py +1 -8
  39. rapidtide/multiproc.py +9 -12
  40. rapidtide/patchmatch.py +1 -1
  41. rapidtide/peakeval.py +1 -1
  42. rapidtide/qualitycheck.py +1 -1
  43. rapidtide/refinedelay.py +174 -89
  44. rapidtide/refineregressor.py +1 -1
  45. rapidtide/resample.py +1 -1
  46. rapidtide/scripts/adjustoffset.py +1 -1
  47. rapidtide/scripts/aligntcs.py +1 -1
  48. rapidtide/scripts/applydlfilter.py +1 -1
  49. rapidtide/scripts/atlasaverage.py +1 -1
  50. rapidtide/scripts/atlastool.py +1 -1
  51. rapidtide/scripts/calcicc.py +1 -1
  52. rapidtide/scripts/calctexticc.py +1 -1
  53. rapidtide/scripts/calcttest.py +1 -1
  54. rapidtide/scripts/ccorrica.py +1 -1
  55. rapidtide/scripts/delayvar.py +2 -2
  56. rapidtide/scripts/diffrois.py +1 -1
  57. rapidtide/scripts/endtidalproc.py +1 -1
  58. rapidtide/scripts/fdica.py +1 -1
  59. rapidtide/scripts/filtnifti.py +1 -1
  60. rapidtide/scripts/filttc.py +1 -1
  61. rapidtide/scripts/fingerprint.py +1 -1
  62. rapidtide/scripts/fixtr.py +1 -1
  63. rapidtide/scripts/gmscalc.py +1 -1
  64. rapidtide/scripts/happy.py +1 -1
  65. rapidtide/scripts/happy2std.py +1 -1
  66. rapidtide/scripts/happywarp.py +1 -1
  67. rapidtide/scripts/histnifti.py +1 -1
  68. rapidtide/scripts/histtc.py +1 -1
  69. rapidtide/scripts/linfitfilt.py +1 -1
  70. rapidtide/scripts/localflow.py +1 -1
  71. rapidtide/scripts/mergequality.py +1 -1
  72. rapidtide/scripts/pairproc.py +1 -1
  73. rapidtide/scripts/pairwisemergenifti.py +1 -1
  74. rapidtide/scripts/physiofreq.py +1 -1
  75. rapidtide/scripts/pixelcomp.py +1 -1
  76. rapidtide/scripts/plethquality.py +1 -1
  77. rapidtide/scripts/polyfitim.py +1 -1
  78. rapidtide/scripts/proj2flow.py +1 -1
  79. rapidtide/scripts/rankimage.py +1 -1
  80. rapidtide/scripts/rapidtide.py +1 -1
  81. rapidtide/scripts/rapidtide2std.py +1 -1
  82. rapidtide/scripts/resamplenifti.py +1 -1
  83. rapidtide/scripts/resampletc.py +1 -1
  84. rapidtide/scripts/retrolagtcs.py +1 -1
  85. rapidtide/scripts/retroregress.py +1 -1
  86. rapidtide/scripts/roisummarize.py +1 -1
  87. rapidtide/scripts/runqualitycheck.py +1 -1
  88. rapidtide/scripts/showarbcorr.py +1 -1
  89. rapidtide/scripts/showhist.py +1 -1
  90. rapidtide/scripts/showstxcorr.py +1 -1
  91. rapidtide/scripts/showtc.py +1 -1
  92. rapidtide/scripts/showxcorr_legacy.py +1 -1
  93. rapidtide/scripts/showxcorrx.py +1 -1
  94. rapidtide/scripts/showxy.py +1 -1
  95. rapidtide/scripts/simdata.py +1 -1
  96. rapidtide/scripts/spatialdecomp.py +1 -1
  97. rapidtide/scripts/spatialfit.py +1 -1
  98. rapidtide/scripts/spatialmi.py +1 -1
  99. rapidtide/scripts/spectrogram.py +1 -1
  100. rapidtide/scripts/stupidramtricks.py +1 -1
  101. rapidtide/scripts/synthASL.py +1 -1
  102. rapidtide/scripts/tcfrom2col.py +1 -1
  103. rapidtide/scripts/tcfrom3col.py +1 -1
  104. rapidtide/scripts/temporaldecomp.py +1 -1
  105. rapidtide/scripts/testhrv.py +1 -1
  106. rapidtide/scripts/threeD.py +1 -1
  107. rapidtide/scripts/tidepool.py +1 -1
  108. rapidtide/scripts/variabilityizer.py +1 -1
  109. rapidtide/simfuncfit.py +1 -1
  110. rapidtide/stats.py +1 -8
  111. rapidtide/tests/cleanposttest +1 -1
  112. rapidtide/tests/resethappytargets +1 -1
  113. rapidtide/tests/resetrapidtidetargets +1 -1
  114. rapidtide/tests/resettargets +1 -1
  115. rapidtide/tests/runlocaltest +1 -1
  116. rapidtide/tests/showkernels +1 -1
  117. rapidtide/tests/test_aliasedcorrelate.py +1 -1
  118. rapidtide/tests/test_aligntcs.py +1 -1
  119. rapidtide/tests/test_calcicc.py +1 -1
  120. rapidtide/tests/test_congrid.py +1 -1
  121. rapidtide/tests/test_correlate.py +1 -1
  122. rapidtide/tests/test_corrpass.py +1 -1
  123. rapidtide/tests/test_delayestimation.py +1 -1
  124. rapidtide/tests/test_doresample.py +1 -1
  125. rapidtide/tests/test_fastresampler.py +1 -1
  126. rapidtide/tests/test_findmaxlag.py +1 -1
  127. rapidtide/tests/test_fullrunhappy_v1.py +15 -7
  128. rapidtide/tests/test_fullrunhappy_v2.py +18 -10
  129. rapidtide/tests/test_fullrunhappy_v3.py +18 -10
  130. rapidtide/tests/test_fullrunhappy_v4.py +18 -10
  131. rapidtide/tests/test_fullrunhappy_v5.py +15 -9
  132. rapidtide/tests/test_fullrunrapidtide_v1.py +19 -11
  133. rapidtide/tests/test_fullrunrapidtide_v2.py +24 -14
  134. rapidtide/tests/test_fullrunrapidtide_v3.py +15 -7
  135. rapidtide/tests/test_fullrunrapidtide_v4.py +15 -8
  136. rapidtide/tests/test_fullrunrapidtide_v5.py +13 -5
  137. rapidtide/tests/test_fullrunrapidtide_v6.py +24 -16
  138. rapidtide/tests/test_io.py +1 -1
  139. rapidtide/tests/test_linfitfiltpass.py +1 -1
  140. rapidtide/tests/test_mi.py +1 -1
  141. rapidtide/tests/test_miscmath.py +1 -1
  142. rapidtide/tests/test_motionregress.py +1 -1
  143. rapidtide/tests/test_nullcorr.py +1 -1
  144. rapidtide/tests/test_padvec.py +1 -1
  145. rapidtide/tests/test_phaseanalysis.py +1 -1
  146. rapidtide/tests/test_rapidtideparser.py +1 -1
  147. rapidtide/tests/test_refinedelay.py +4 -3
  148. rapidtide/tests/test_runmisc.py +1 -1
  149. rapidtide/tests/test_sharedmem.py +1 -1
  150. rapidtide/tests/test_simulate.py +1 -1
  151. rapidtide/tests/test_stcorrelate.py +1 -1
  152. rapidtide/tests/test_timeshift.py +1 -1
  153. rapidtide/tests/test_valtoindex.py +1 -1
  154. rapidtide/tests/test_zRapidtideDataset.py +1 -1
  155. rapidtide/tests/utils.py +1 -1
  156. rapidtide/transformerdlfilter.py +2 -4
  157. rapidtide/util.py +37 -14
  158. rapidtide/voxelData.py +278 -0
  159. rapidtide/wiener.py +1 -1
  160. rapidtide/wiener2.py +1 -1
  161. rapidtide/workflows/adjustoffset.py +1 -1
  162. rapidtide/workflows/aligntcs.py +1 -1
  163. rapidtide/workflows/applydlfilter.py +20 -65
  164. rapidtide/workflows/atlasaverage.py +41 -13
  165. rapidtide/workflows/atlastool.py +1 -1
  166. rapidtide/workflows/calctexticc.py +1 -1
  167. rapidtide/workflows/ccorrica.py +1 -1
  168. rapidtide/workflows/cleanregressor.py +243 -0
  169. rapidtide/workflows/delayestimation.py +488 -0
  170. rapidtide/workflows/delayvar.py +122 -34
  171. rapidtide/workflows/diffrois.py +1 -1
  172. rapidtide/workflows/endtidalproc.py +1 -1
  173. rapidtide/workflows/fdica.py +1 -1
  174. rapidtide/workflows/filtnifti.py +1 -1
  175. rapidtide/workflows/filttc.py +1 -1
  176. rapidtide/workflows/fixtr.py +1 -1
  177. rapidtide/workflows/gmscalc.py +1 -1
  178. rapidtide/workflows/happy.py +49 -3
  179. rapidtide/workflows/happy2std.py +1 -1
  180. rapidtide/workflows/happy_parser.py +30 -6
  181. rapidtide/workflows/histnifti.py +1 -1
  182. rapidtide/workflows/histtc.py +1 -1
  183. rapidtide/workflows/linfitfilt.py +1 -1
  184. rapidtide/workflows/localflow.py +1 -1
  185. rapidtide/workflows/mergequality.py +1 -1
  186. rapidtide/workflows/niftidecomp.py +1 -1
  187. rapidtide/workflows/niftistats.py +1 -1
  188. rapidtide/workflows/pairproc.py +1 -1
  189. rapidtide/workflows/pairwisemergenifti.py +1 -1
  190. rapidtide/workflows/parser_funcs.py +1 -1
  191. rapidtide/workflows/physiofreq.py +1 -1
  192. rapidtide/workflows/pixelcomp.py +1 -1
  193. rapidtide/workflows/plethquality.py +1 -1
  194. rapidtide/workflows/polyfitim.py +1 -1
  195. rapidtide/workflows/proj2flow.py +1 -1
  196. rapidtide/workflows/rankimage.py +1 -1
  197. rapidtide/workflows/rapidtide.py +174 -686
  198. rapidtide/workflows/rapidtide2std.py +1 -1
  199. rapidtide/workflows/rapidtide_parser.py +14 -113
  200. rapidtide/workflows/regressfrommaps.py +6 -48
  201. rapidtide/workflows/resamplenifti.py +1 -1
  202. rapidtide/workflows/resampletc.py +1 -1
  203. rapidtide/workflows/retrolagtcs.py +2 -1
  204. rapidtide/workflows/retroregress.py +26 -2
  205. rapidtide/workflows/roisummarize.py +1 -1
  206. rapidtide/workflows/runqualitycheck.py +1 -1
  207. rapidtide/workflows/showarbcorr.py +1 -1
  208. rapidtide/workflows/showhist.py +1 -1
  209. rapidtide/workflows/showstxcorr.py +1 -1
  210. rapidtide/workflows/showtc.py +1 -1
  211. rapidtide/workflows/showxcorrx.py +1 -1
  212. rapidtide/workflows/showxy.py +1 -1
  213. rapidtide/workflows/simdata.py +1 -1
  214. rapidtide/workflows/spatialfit.py +1 -1
  215. rapidtide/workflows/spatialmi.py +1 -1
  216. rapidtide/workflows/spectrogram.py +1 -1
  217. rapidtide/workflows/synthASL.py +1 -1
  218. rapidtide/workflows/tcfrom2col.py +1 -1
  219. rapidtide/workflows/tcfrom3col.py +1 -1
  220. rapidtide/workflows/tidepool.py +2 -1
  221. rapidtide/workflows/utils.py +1 -1
  222. rapidtide/workflows/variabilityizer.py +1 -1
  223. {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/METADATA +1 -1
  224. rapidtide-3.0a15.dist-info/RECORD +353 -0
  225. {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/WHEEL +1 -1
  226. rapidtide/data/models/model_revised/model.h5 +0 -0
  227. rapidtide/data/models/model_serdar/model.h5 +0 -0
  228. rapidtide/data/models/model_serdar2/model.h5 +0 -0
  229. rapidtide-3.0a13.dist-info/RECORD +0 -345
  230. {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/entry_points.txt +0 -0
  231. {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/licenses/LICENSE +0 -0
  232. {rapidtide-3.0a13.dist-info → rapidtide-3.0a15.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
rapidtide/filter.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -44,13 +44,6 @@ if pyfftwpresent:
44
44
  pyfftw.interfaces.cache.enable()
45
45
 
46
46
  # ----------------------------------------- Conditional imports ---------------------------------------
47
- try:
48
- from memory_profiler import profile
49
-
50
- memprofilerexists = True
51
- except ImportError:
52
- memprofilerexists = False
53
-
54
47
  try:
55
48
  from numba import jit
56
49
  except ImportError:
rapidtide/fit.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -40,13 +40,6 @@ MAXLINES = 10000000
40
40
  donotbeaggressive = True
41
41
 
42
42
  # ----------------------------------------- Conditional imports ---------------------------------------
43
- try:
44
- from memory_profiler import profile
45
-
46
- memprofilerexists = True
47
- except ImportError:
48
- memprofilerexists = False
49
-
50
43
  try:
51
44
  from numba import jit
52
45
  except ImportError:
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2018-2024 Blaise Frederick
4
+ # Copyright 2018-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -535,6 +535,29 @@ def approximateentropy(waveform, m, r):
535
535
  return abs(_phi(m + 1) - _phi(m))
536
536
 
537
537
 
538
+ def summarizerun(theinfodict, getkeys=False):
539
+ keylist = [
540
+ "corrcoeff_raw2pleth",
541
+ "corrcoeff_filt2pleth",
542
+ "E_sqi_mean_pleth",
543
+ "E_sqi_mean_bold",
544
+ "S_sqi_mean_pleth",
545
+ "S_sqi_mean_bold",
546
+ "K_sqi_mean_pleth",
547
+ "K_sqi_mean_bold",
548
+ ]
549
+ if getkeys:
550
+ return ",".join(keylist)
551
+ else:
552
+ outputline = []
553
+ for thekey in keylist:
554
+ try:
555
+ outputline.append(str(theinfodict[thekey]))
556
+ except KeyError:
557
+ outputline.append("")
558
+ return ",".join(outputline)
559
+
560
+
538
561
  def entropy(waveform):
539
562
  return -np.sum(np.square(waveform) * np.nan_to_num(np.log2(np.square(waveform))))
540
563
 
@@ -632,17 +655,23 @@ def calcplethquality(
632
655
  E_waveform[i] = approximateentropy(dt_waveform[startpt : endpt + 1], 2, r)
633
656
 
634
657
  S_sqi_mean = np.mean(S_waveform)
658
+ S_sqi_median = np.median(S_waveform)
635
659
  S_sqi_std = np.std(S_waveform)
636
660
  K_sqi_mean = np.mean(K_waveform)
661
+ K_sqi_median = np.median(K_waveform)
637
662
  K_sqi_std = np.std(K_waveform)
638
663
  E_sqi_mean = np.mean(E_waveform)
664
+ E_sqi_median = np.median(E_waveform)
639
665
  E_sqi_std = np.std(E_waveform)
640
666
 
641
667
  infodict["S_sqi_mean" + suffix] = S_sqi_mean
668
+ infodict["S_sqi_median" + suffix] = S_sqi_median
642
669
  infodict["S_sqi_std" + suffix] = S_sqi_std
643
670
  infodict["K_sqi_mean" + suffix] = K_sqi_mean
671
+ infodict["K_sqi_median" + suffix] = K_sqi_median
644
672
  infodict["K_sqi_std" + suffix] = K_sqi_std
645
673
  infodict["E_sqi_mean" + suffix] = E_sqi_mean
674
+ infodict["E_sqi_median" + suffix] = E_sqi_median
646
675
  infodict["E_sqi_std" + suffix] = E_sqi_std
647
676
 
648
677
  if outputlevel > 1:
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
rapidtide/io.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -97,6 +97,7 @@ def linfitfiltpass(
97
97
  mp_chunksize=1000,
98
98
  rt_floatset=np.float64,
99
99
  rt_floattype="float64",
100
+ verbose=True,
100
101
  debug=False,
101
102
  ):
102
103
  inputshape = np.shape(fmri_data)
@@ -184,6 +185,7 @@ def linfitfiltpass(
184
185
  GLM_consumer,
185
186
  inputshape,
186
187
  themask,
188
+ verbose=verbose,
187
189
  nprocs=nprocs,
188
190
  procbyvoxel=procbyvoxel,
189
191
  showprogressbar=showprogressbar,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@ from tqdm import tqdm
24
24
 
25
25
  import rapidtide.multiproc as tide_multiproc
26
26
 
27
- LGR = logging.getLogger("GENERAL")
28
-
29
27
 
30
28
  def _procOneVoxelMakelagtc(
31
29
  vox,
@@ -51,6 +49,7 @@ def makelaggedtcs(
51
49
  lagmask,
52
50
  lagtimes,
53
51
  lagtc,
52
+ LGR=None,
54
53
  nprocs=1,
55
54
  alwaysmultiproc=False,
56
55
  showprogressbar=True,
@@ -90,6 +89,7 @@ def makelaggedtcs(
90
89
  makelagtc_consumer,
91
90
  inputshape,
92
91
  lagmask,
92
+ verbose=(LGR is not None),
93
93
  nprocs=nprocs,
94
94
  showprogressbar=showprogressbar,
95
95
  chunksize=chunksize,
@@ -127,13 +127,16 @@ def makelaggedtcs(
127
127
  )
128
128
  volumetotal += 1
129
129
 
130
- LGR.info(f"\nLagged timecourses created for {volumetotal} voxels")
130
+ if LGR is not None:
131
+ LGR.info(f"\nLagged timecourses created for {volumetotal} voxels")
131
132
 
132
133
  # garbage collect
133
134
  uncollected = gc.collect()
134
135
  if uncollected != 0:
135
- LGR.info(f"garbage collected - unable to collect {uncollected} objects")
136
+ if LGR is not None:
137
+ LGR.info(f"garbage collected - unable to collect {uncollected} objects")
136
138
  else:
137
- LGR.info("garbage collected")
139
+ if LGR is not None:
140
+ LGR.info("garbage collected")
138
141
 
139
142
  return volumetotal
rapidtide/maskutil.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
rapidtide/miscmath.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -47,13 +47,6 @@ MAXLINES = 10000000
47
47
  donotbeaggressive = True
48
48
 
49
49
  # ----------------------------------------- Conditional imports ---------------------------------------
50
- try:
51
- from memory_profiler import profile
52
-
53
- memprofilerexists = True
54
- except ImportError:
55
- memprofilerexists = False
56
-
57
50
  try:
58
51
  from numba import jit
59
52
  except ImportError:
rapidtide/multiproc.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -77,8 +77,8 @@ def _process_data(data_in, inQ, outQ, showprogressbar=True, reportstep=1000, chu
77
77
  pbar.update(1)
78
78
  if numreturned > remainder - 1:
79
79
  break
80
-
81
- print()
80
+ if showprogressbar:
81
+ print()
82
82
 
83
83
  return data_out
84
84
 
@@ -88,6 +88,7 @@ def run_multiproc(
88
88
  inputshape,
89
89
  maskarray,
90
90
  nprocs=1,
91
+ verbose=True,
91
92
  procbyvoxel=True,
92
93
  showprogressbar=True,
93
94
  chunksize=1000,
@@ -105,13 +106,6 @@ def run_multiproc(
105
106
  workers = [ctx.Process(target=consumerfunc, args=(inQ, outQ)) for i in range(n_workers)]
106
107
  # signal.signal(signal.SIGINT, original_sigint_handler)
107
108
  else:
108
- """# try adding this magic incantation to get coverage to record multiprocessing properly
109
- # This fails for python 3.8 and above
110
- try:
111
- from pytest_cov.embed import cleanup
112
- except ImportError:
113
- cleanup = None
114
- """
115
109
  cleanup = None # just disable this for now
116
110
  inQ = mp.Queue()
117
111
  outQ = mp.Queue()
@@ -141,7 +135,8 @@ def run_multiproc(
141
135
  data_in.append(d)
142
136
  elif maskarray[d] > 0.5:
143
137
  data_in.append(d)
144
- print("processing", len(data_in), procunit + " with", n_workers, "processes")
138
+ if verbose:
139
+ print("processing", len(data_in), procunit + " with", n_workers, "processes")
145
140
  data_out = _process_data(
146
141
  data_in, inQ, outQ, showprogressbar=showprogressbar, chunksize=chunksize
147
142
  )
@@ -162,6 +157,7 @@ def run_multithread(
162
157
  consumerfunc,
163
158
  inputshape,
164
159
  maskarray,
160
+ verbose=True,
165
161
  nprocs=1,
166
162
  procbyvoxel=True,
167
163
  showprogressbar=True,
@@ -197,7 +193,8 @@ def run_multithread(
197
193
  data_in.append(d)
198
194
  elif maskarray[d] > 0:
199
195
  data_in.append(d)
200
- print("processing", len(data_in), procunit + " with", n_workers, "threads")
196
+ if verbose:
197
+ print("processing", len(data_in), procunit + " with", n_workers, "threads")
201
198
  data_out = _process_data(
202
199
  data_in, inQ, outQ, showprogressbar=showprogressbar, chunksize=chunksize
203
200
  )
rapidtide/patchmatch.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick (except for some routines listed below)
4
+ # Copyright 2016-2025 Blaise Frederick (except for some routines listed below)
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
rapidtide/peakeval.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2016-2024 Blaise Frederick
4
+ # Copyright 2016-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
rapidtide/qualitycheck.py CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  # -*- coding: utf-8 -*-
3
3
  #
4
- # Copyright 2024-2024 Blaise Frederick
4
+ # Copyright 2024-2025 Blaise Frederick
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.