diff --git a/biosimulators_utils/_version.py b/biosimulators_utils/_version.py index 98c7fc01..56655389 100644 --- a/biosimulators_utils/_version.py +++ b/biosimulators_utils/_version.py @@ -1 +1 @@ -__version__ = '0.1.165' +__version__ = '0.1.166' diff --git a/biosimulators_utils/model_lang/xpp/validation.py b/biosimulators_utils/model_lang/xpp/validation.py index fffa0be7..30d432c1 100644 --- a/biosimulators_utils/model_lang/xpp/validation.py +++ b/biosimulators_utils/model_lang/xpp/validation.py @@ -702,10 +702,18 @@ def sanitize_model(filename, keep_only_directives=True, exclude_options=None): with open(sanitized_filename, 'wb') as sanitized_file: for statement in statements: - i_comment = statement.find(b'#') - if i_comment > -1: - statement = statement[0:i_comment] - statement = statement.strip() + b'\n' + statement = statement.lstrip() + if ( + statement.startswith(b'@') + or statement.startswith(b'p ') + or statement.startswith(b'par ') + or statement.startswith(b'param ') + or statement.startswith(b'#') + ): + i_comment = statement.find(b'#') + if i_comment > -1: + statement = statement[0:i_comment] + statement = statement.strip() + b'\n' if not keep_only_directives and statement.lower().startswith(b'only '): continue