|
14 | 14 | # =============================================================================== |
15 | 15 |
|
16 | 16 | from plumbum import cli |
17 | | -from distutils.spawn import find_executable |
18 | | -import multiprocessing, psutil |
| 17 | +from shutil import which |
| 18 | +import multiprocessing |
19 | 19 | import io |
20 | 20 |
|
21 | 21 | from determineNshm import verifyNshmForAll, determineNshm |
22 | 22 | from util import * |
23 | 23 | from fileUtil import read_caselist, check_dir, check_csv |
24 | 24 |
|
25 | | -N_CPU= psutil.cpu_count() |
| 25 | +N_CPU= multiprocessing.cpu_count() |
26 | 26 | SCRIPTDIR= dirname(__file__) |
27 | 27 |
|
28 | 28 |
|
@@ -365,22 +365,22 @@ def showStat(self): |
365 | 365 | from harm_plot import generate_csv, harm_plot |
366 | 366 | import pandas as pd |
367 | 367 |
|
368 | | - print('\n\nComputing statistics\n\n') |
| 368 | + print('\n\nComputing statistics:') |
369 | 369 |
|
370 | | - print(f'{self.reference} site: ') |
| 370 | + print(f'{self.reference} site') |
371 | 371 | ref_mean = analyzeStat(self.ref_csv, self.templatePath) |
372 | 372 | generate_csv(self.ref_csv, ref_mean, pjoin(self.templatePath, self.reference), self.bshell_b) |
373 | 373 |
|
374 | | - print(f'{self.target} site before harmonization: ') |
| 374 | + print(f'{self.target} site before harmonization') |
375 | 375 | target_mean_before = analyzeStat(self.tar_unproc_csv, self.templatePath) |
376 | 376 | generate_csv(self.tar_unproc_csv, target_mean_before, pjoin(self.templatePath, self.target)+'_before', self.bshell_b) |
377 | 377 |
|
378 | | - print(f'{self.target} site after harmonization: ') |
| 378 | + print(f'{self.target} site after harmonization') |
379 | 379 | target_mean_after = analyzeStat(self.harm_csv, self.templatePath) |
380 | 380 | generate_csv(self.harm_csv, target_mean_after, pjoin(self.templatePath, self.target)+'_after', self.bshell_b) |
381 | 381 |
|
382 | 382 |
|
383 | | - print('\n\nPrinting statistics\n\n') |
| 383 | + print('\n\nPrinting statistics:') |
384 | 384 | # save statistics for future |
385 | 385 | statFile= pjoin(self.templatePath, 'meanFAstat.csv') |
386 | 386 | if isfile(statFile): |
@@ -428,7 +428,7 @@ def sanityCheck(self): |
428 | 428 | 'unring.a64'] |
429 | 429 |
|
430 | 430 | for cmd in external_commands: |
431 | | - exe= find_executable(cmd) |
| 431 | + exe= which(cmd) |
432 | 432 | if not exe: |
433 | 433 | raise EnvironmentError(f'{cmd} not found') |
434 | 434 |
|
|
0 commit comments