From 604e6b845bbc02854ab896b1b74d18a7af19ac5e Mon Sep 17 00:00:00 2001 From: Rudolph Pienaar Date: Fri, 3 May 2024 17:52:20 -0400 Subject: [PATCH] Bump version to 1.2.38 and allow for model input file to be at arbitrary location in inputdir --- spleenseg/spleenseg.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spleenseg/spleenseg.py b/spleenseg/spleenseg.py index 39eb4b6..4bd668d 100644 --- a/spleenseg/spleenseg.py +++ b/spleenseg/spleenseg.py @@ -46,7 +46,7 @@ ╚══════╝╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝ ╚═══╝╚══════╝╚══════╝ ╚═════╝ """ -__version__ = "1.2.36" +__version__ = "1.2.38" import spleenseg.splparser as spl description: str = """ @@ -129,7 +129,14 @@ def env_outputDirsMake(options: Namespace) -> None: def modelFile_inputdirGet(options: Namespace) -> Path: - modelFile: Path = Path(Path(options.inputdir) / options.useModel) + modelTarget: Path = options.useModel + inputDir: Path = Path(options.inputdir) + modelFile: Path = Path("") + path: Path + for path in inputDir.rglob(str(modelTarget)): + if path.is_file(): + modelFile = path + break if not modelFile.exists(): raise FileNotFoundError(f"The model '{modelFile}' does not exist.") return modelFile