From c19682143519240943f9e4295c0553cab8a0f586 Mon Sep 17 00:00:00 2001 From: maikefischer Date: Fri, 4 Oct 2019 09:54:11 +0200 Subject: [PATCH 1/3] Added the version to the CLI --- fast_carpenter/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fast_carpenter/__main__.py b/fast_carpenter/__main__.py index 5bdc577..9ca1413 100644 --- a/fast_carpenter/__main__.py +++ b/fast_carpenter/__main__.py @@ -14,6 +14,7 @@ atup.EventBuilder = EventBuilder atup.build_parallel = build_parallel logging.getLogger(__name__).setLevel(logging.INFO) +from .version import __version__ class DummyCollector(): @@ -39,7 +40,7 @@ def __call__(self, parser, namespace, values, option_string=None): help="Where to save the results") parser.add_argument("--mode", default="multiprocessing", type=str, help="Which mode to run in (multiprocessing, htcondor, sge)") - parser.add_argument("--ncores", default=0, type=int, + parser.add_argument("--ncores", default=1, type=int, help="Number of cores to run on") parser.add_argument("--nblocks-per-dataset", default=-1, type=int, help="Number of blocks per dataset") @@ -56,6 +57,7 @@ def __call__(self, parser, namespace, values, option_string=None): help="Print help specific to the available stages") parser.add_argument("--help-stages-full", action=StagesHelp, metavar="stage", help="Print the full help specific to the available stages") + parser.add_argument("-v", "--version", action="version", version='%(prog)s ' + __version__) return parser @@ -63,6 +65,9 @@ def __call__(self, parser, namespace, values, option_string=None): def main(args=None): args = create_parser().parse_args(args) + if args.ncores < 1: + args.ncores = 1 + sequence = fast_flow.read_sequence_yaml(args.sequence_cfg, output_dir=args.outdir) datasets = fast_curator.read.from_yaml(args.dataset_cfg) From 68e93ef5a0808e4ff7a6a2f62e76c5e32502f779 Mon Sep 17 00:00:00 2001 From: maikefischer <31406905+maikefischer@users.noreply.github.com> Date: Fri, 4 Oct 2019 16:16:03 +0200 Subject: [PATCH 2/3] Moved import to comply with PEP8 --- fast_carpenter/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_carpenter/__main__.py b/fast_carpenter/__main__.py index 9ca1413..fa538ce 100644 --- a/fast_carpenter/__main__.py +++ b/fast_carpenter/__main__.py @@ -11,10 +11,10 @@ from .event_builder import EventBuilder from atsge.build_parallel import build_parallel from .utils import mkdir_p +from .version import __version__ atup.EventBuilder = EventBuilder atup.build_parallel = build_parallel logging.getLogger(__name__).setLevel(logging.INFO) -from .version import __version__ class DummyCollector(): From 248513624abcc5fc127ff9598b8e533936e15697 Mon Sep 17 00:00:00 2001 From: maikefischer <31406905+maikefischer@users.noreply.github.com> Date: Fri, 4 Oct 2019 16:21:11 +0200 Subject: [PATCH 3/3] Updated the change log with recent changes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f75ab3..d57014f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed +## [0.14.1] - 2019-10-04 +### Added +- Added version flag to CLI, PR #79. [@maikefischer](github.com/maikefischer) + ## [0.14.0] - 2019-10-03 ### Added - Support for ND jagged array in expressions, PR #73