From b4fa140ee0c114e64467eace7645f1bc224759c5 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 10 Apr 2023 11:15:50 -0300 Subject: [PATCH] fail to generate docs if the code isn't there --- tools/copy_from_GSW-C.py | 6 ++++++ tools/matlab_parser.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tools/copy_from_GSW-C.py b/tools/copy_from_GSW-C.py index 415471f..d08fbe6 100644 --- a/tools/copy_from_GSW-C.py +++ b/tools/copy_from_GSW-C.py @@ -20,6 +20,12 @@ srcdir = Path('..', '..', 'GSW-C') destdir = Path('..', 'src', 'c_gsw') +if not srcdir.exists(): + raise IOError( + f"Could not find the GSW-C source code in {srcdir}." + "Please read the development notes to find how to setup your GSW-Python development environment." + ) + for fname in fnames: src = srcdir.joinpath(fname) dest = destdir.joinpath(fname) diff --git a/tools/matlab_parser.py b/tools/matlab_parser.py index 813763b..cc6392c 100644 --- a/tools/matlab_parser.py +++ b/tools/matlab_parser.py @@ -9,6 +9,12 @@ basedir = Path('..').resolve() gsw_matlab_dir = basedir.joinpath('..', 'GSW-Matlab', 'Toolbox').resolve() +if not gsw_matlab_dir.exists(): + raise IOError( + f"Could not find the GSW-Matlab source code in {gsw_matlab_dir}." + "Please read the development notes to find how to setup your GSW-Python development environment." + ) + gsw_matlab_subdirs = ['library', 'thermodynamics_from_t'] # pattern for functions returning one variable