From 56f7396c3669a01a3f0d03d466dd4e056aee4e05 Mon Sep 17 00:00:00 2001 From: Tammo van der Heide Date: Fri, 26 Apr 2024 17:15:10 +0200 Subject: [PATCH] Add option to specify skdef.hsd path for collectspinw script --- sktools/src/sktools/scripts/collectspinw.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sktools/src/sktools/scripts/collectspinw.py b/sktools/src/sktools/scripts/collectspinw.py index 2ca451c1..30cd75ea 100644 --- a/sktools/src/sktools/scripts/collectspinw.py +++ b/sktools/src/sktools/scripts/collectspinw.py @@ -27,7 +27,7 @@ def main(cmdlineargs=None): logger = sc.get_script_logger(args.loglevel, SCRIPTNAME) logger.info('Collecting spinw constants') - skdef = Skdef.fromfile('skdef.hsd') + skdef = Skdef.fromfile(args.configfile) searchdirs = [args.builddir] elems = skdef.atomparameters.keys() @@ -62,6 +62,11 @@ def parseargs(cmdlineargs): parser.add_argument('-o', '--onecenter-binary', dest='onecnt_binary', default=None, help=msg) + parser.add_argument( + '-c', '--config-file', default='skdef.hsd', dest='configfile', + metavar='CONFIGFILE', + help='config file to be parsed (default: ./skdef.hsd)') + msg = 'Logging level (default: info)' parser.add_argument('-l', '--log-level', dest='loglevel', default='info', choices=['debug', 'info', 'warning', 'error'], help=msg)