Skip to content

Commit

Permalink
Add quiet flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Mar 4, 2022
1 parent ee5a9fc commit 19c7005
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions premc_mincmorph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import os
import sys
from argparse import ArgumentParser, Namespace
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
Expand All @@ -13,6 +14,8 @@
parser = ArgumentParser(description='Smoothen masks using mincmorph')
parser.add_argument('-p', '--pattern', default='**/*.mnc',
help='pattern for file names to include')
parser.add_argument('-q', '--quiet', action='store_true',
help='disable status messages')


def premc_mincmorph(mask: Path, smoothened: Path) -> None:
Expand All @@ -27,6 +30,9 @@ def premc_mincmorph(mask: Path, smoothened: Path) -> None:
min_cpu_limit='1000m',
)
def main(options: Namespace, inputdir: Path, outputdir: Path):
if options.quiet:
logger.remove()
logger.add(sys.stderr, level='WARNING')

results = []
with ThreadPoolExecutor(max_workers=len(os.sched_getaffinity(0))) as pool:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name = 'premc-mincmorph',
version = '0.1.0',
version = '0.1.1',
description = 'Smoothen a mask in preparation for marching cubes.',
author = 'Jennings Zhang',
author_email = '[email protected]',
Expand Down

0 comments on commit 19c7005

Please sign in to comment.