diff --git a/kmcos/__init__.py b/kmcos/__init__.py index 74c6d7f465745c1908f491e5990ac1f444854040..b51147c6e0f2b2db6661cd05999daf72004af528 100644 --- a/kmcos/__init__.py +++ b/kmcos/__init__.py @@ -50,7 +50,7 @@ from __future__ import print_function -__version__ = "0.0.69" +__version__ = "0.0.70" VERSION = __version__ def evaluate_param_expression(param, parameters={}): diff --git a/kmcos/types.py b/kmcos/types.py index f08a89e3232c2d1e619554b5841bfa8447f118ca..259b3f09b9327277ebe4e745645577676ed1e216 100644 --- a/kmcos/types.py +++ b/kmcos/types.py @@ -98,6 +98,7 @@ class Project(object): self.filename = self.model_name + ".xml" self.backend = "local_smart" #this is just the default. self.compile_options = "" + self.error_list = [] # Quick'n'dirty define access functions # needed in context with GTKProject @@ -198,6 +199,10 @@ class Project(object): kwargs.pop('actions') process = Process(**kwargs) self.process_list.append(process) + + if 'name' in kwargs: + if len(kwargs['name']) > 30: + self.error_list.append(tuple(("Process Name", kwargs['name'], "Process name should not be longer than 30 characters, otherwise the Fortran compiler may raise errors"))) return process def parse_process(self, string): @@ -592,6 +597,10 @@ class Project(object): raise UserWarning('Cannot export to file suffix %s' % os.path.splitext(self.filename)[-1]) + #If there are errors with the model object, then write the list of errors to a .log file + if len(self.error_list) > 0: + np.savetxt(self.model_name+"__build.log", self.error_list, delimiter=", ", fmt="%s", header = "Type, Name, Message") + def save(self, filename="", validate=True): self.save_model(filename, validate)