diff --git a/cm/CHANGES.md b/cm/CHANGES.md index f36e8a8c6..48804743a 100644 --- a/cm/CHANGES.md +++ b/cm/CHANGES.md @@ -1,3 +1,6 @@ +## V3.2.7 + - minor improvement in error handling and messages + ## V3.2.6 - Fix type of "unknown_keys" to list to be serializable https://github.com/mlcommons/ck/issues/1335 diff --git a/cm/cmind/__init__.py b/cm/cmind/__init__.py index f207710af..ec49ca881 100644 --- a/cm/cmind/__init__.py +++ b/cm/cmind/__init__.py @@ -2,7 +2,7 @@ # # Written by Grigori Fursin -__version__ = "3.2.6" +__version__ = "3.2.7" from cmind.core import access from cmind.core import x diff --git a/cm/cmind/cli.py b/cm/cmind/cli.py index 7e03d2347..be9ea72a9 100644 --- a/cm/cmind/cli.py +++ b/cm/cmind/cli.py @@ -193,6 +193,21 @@ def run_experiment(argv = None): return run(['run', 'experiment'] + argv) +############################################################ +def run_ff(argv = None): + """ + """ + + # Access CMX + if argv is None: + argv = sys.argv[1:] + + x = 'lex' + if len(argv) >0 and argv[0].startswith('_misc'): + x = argv[0] + + return runx(['run', 'f'+x+'.flow'] + argv) + ############################################################ def parse(cmd): """ diff --git a/cm/cmind/core.py b/cm/cmind/core.py index 25edc2b4b..a8e109631 100644 --- a/cm/cmind/core.py +++ b/cm/cmind/core.py @@ -164,7 +164,8 @@ def errorx(self, r): if 'warning' in r: message = r.get('warning', '') if message != '': - message = '\nCMX warning: ' + message.capitalize() + '!\n' + message = message[0].upper() + message[1:] + message = '\nCMX warning: ' + message + '!\n' else: module_path = r.get('module_path', '') lineno = r.get('lineno', '') @@ -195,10 +196,16 @@ def errorx(self, r): if module_path != '' and lineno !='': message += f' in {module_path} ({lineno}):\n\n' + text = r['error'] + text = text[0].upper() + text[1:] + else: message += ': ' + text = r['error'] + + if not text.endswith('!'): text += '!' - message += r['error'] + '\n' + message += text + '\n' sys.stderr.write(message) diff --git a/cm/setup.py b/cm/setup.py index f48f65495..3d91b7143 100644 --- a/cm/setup.py +++ b/cm/setup.py @@ -101,10 +101,11 @@ def run(self): "cm = cmind.cli:run", "cmx = cmind.cli:runx", "cmr = cmind.cli:run_script", + "fflow = cmind.cli:run_ff", "cmrd = cmind.cli:docker_script", "cmg = cmind.cli:gui_script", "cme = cmind.cli:run_experiment" - ]}, + ]}, zip_safe=False,