Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sk fix errors #110

Merged
merged 7 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.7, 3.8, 3.9, '3.10', 3.11]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
platform: [windows-latest, ubuntu-latest, macos-latest]

runs-on: ${{ matrix.platform }}
Expand Down
3 changes: 2 additions & 1 deletion deviser/code_files/ValidationFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@ def create_rule_structure(self):
number = self.offset
else:
number = 0
full_package = f'{global_variables.package_full_name} Package' if global_variables.is_sbml else global_variables.language
rules = ValidationRulesGeneral\
.ValidationRulesGeneral(self.fullname, number, self.package,
self.pkg_ref, self.level, self.version,
self.pkg_version, self.reqd_status,
global_variables.language)
full_package)
rules.determine_rules()
self.class_rules += rules.rules
number = self.offset + 20200 if global_variables.is_sbml else 20100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry distribErrorTable[] =
{
// 1510100
{ DistribUnknown,
"Unknown error from Distrib",
"Unknown error from DISTRIB",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Distrib",
{ ""
"Unknown error from DISTRIB",
{ "L3V1 Distrib V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry distribErrorTable[] =
"Version 2, an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version2/distrib/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Distrib V1 Section 3.1"
{ "L3V1 Distrib V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry distribErrorTable[] =
"Distributions Package must use the "
"'http://www.sbml.org/sbml/level3/version2/distrib/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Distrib V1 Section 3.1"
{ "L3V1 Distrib V1 Section"
}
},

Expand Down
10 changes: 5 additions & 5 deletions deviser/pytest_files/test_cpp/test-extension/FooSBMLErrorTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry fooErrorTable[] =
{
// 110100
{ FooUnknown,
"Unknown error from Foo",
"Unknown error from FOO",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Foo",
{ ""
"Unknown error from FOO",
{ "L3V1 Foo V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry fooErrorTable[] =
"SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/foo/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Foo V1 Section 3.1"
{ "L3V1 Foo V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry fooErrorTable[] =
"Foo Package must use the "
"'http://www.sbml.org/sbml/level3/version1/foo/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Foo V1 Section 3.1"
{ "L3V1 Foo V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry groupsErrorTable[] =
{
// 4010100
{ GroupsUnknown,
"Unknown error from Groups",
"Unknown error from GROUPS",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Groups",
{ ""
"Unknown error from GROUPS",
{ "L3V1 Groups V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry groupsErrorTable[] =
"an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/groups/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Groups V1 Section 3.1"
{ "L3V1 Groups V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry groupsErrorTable[] =
"Groups Package must use the "
"'http://www.sbml.org/sbml/level3/version1/groups/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Groups V1 Section 3.1"
{ "L3V1 Groups V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry qualErrorTable[] =
{
// 3010100
{ QualUnknown,
"Unknown error from Qual",
"Unknown error from QUAL",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Qual",
{ ""
"Unknown error from QUAL",
{ "L3V1 Qual V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry qualErrorTable[] =
"3 Version 1, an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/qual/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Qual V1 Section 3.1"
{ "L3V1 Qual V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry qualErrorTable[] =
"Qualitative Models Package must use the "
"'http://www.sbml.org/sbml/level3/version1/qual/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Qual V1 Section 3.1"
{ "L3V1 Qual V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry refsErrorTable[] =
{
// 110100
{ RefsUnknown,
"Unknown error from Refs",
"Unknown error from REFS",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Refs",
{ ""
"Unknown error from REFS",
{ "L3V1 Refs V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry refsErrorTable[] =
"Version 1, an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/refs/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Refs V1 Section 3.1"
{ "L3V1 Refs V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry refsErrorTable[] =
"SID References Package must use the "
"'http://www.sbml.org/sbml/level3/version1/refs/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Refs V1 Section 3.1"
{ "L3V1 Refs V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry renderErrorTable[] =
{
// 1310100
{ RenderUnknown,
"Unknown error from Render",
"Unknown error from RENDER",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Render",
{ ""
"Unknown error from RENDER",
{ "L3V1 Render V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry renderErrorTable[] =
"an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/render/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Render V1 Section 3.1"
{ "L3V1 Render V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry renderErrorTable[] =
"Render Package must use the "
"'http://www.sbml.org/sbml/level3/version1/render/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Render V1 Section 3.1"
{ "L3V1 Render V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ static const packageErrorTableEntry testErrorTable[] =
{
// 10010100
{ TestUnknown,
"Unknown error from Test",
"Unknown error from TEST",
LIBSBML_CAT_GENERAL_CONSISTENCY,
LIBSBML_SEV_ERROR,
"Unknown error from Test",
{ ""
"Unknown error from TEST",
{ "L3V1 Test V1 Section"
}
},

Expand All @@ -70,7 +70,7 @@ static const packageErrorTableEntry testErrorTable[] =
"Version 1, an SBML document must declare "
"'http://www.sbml.org/sbml/level3/version1/test/version1' as the "
"XMLNamespace to use for elements of this package.",
{ "L3V1 Test V1 Section 3.1"
{ "L3V1 Test V1 Section"
}
},

Expand All @@ -83,7 +83,7 @@ static const packageErrorTableEntry testErrorTable[] =
"testAttributes Package must use the "
"'http://www.sbml.org/sbml/level3/version1/test/version1' namespace, "
"declaring so either explicitly or implicitly.",
{ "L3V1 Test V1 Section 3.1"
{ "L3V1 Test V1 Section"
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,6 @@ ExtraLong_isValidString(const char* code)



LIBSBML_CPP_NAMESPACE_END
LIBSBML_CPP_NAMESPACE_END


Original file line number Diff line number Diff line change
Expand Up @@ -746,4 +746,6 @@ LIBSBML_CPP_NAMESPACE_END



#endif /* !TestcaseExtension_H__ */
#endif /* !TestcaseExtension_H__ */


2 changes: 2 additions & 0 deletions deviser/pytest_files/test_examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def test_specific_xml_fail(name, start, stop, number):
"""
assert 0 == ret.run_specific_xml_fail_tests(name, start, stop, number)


#########################################################################################################
# fails
# @pytest.mark.parametrize('name', [
# ('base_class'),
Expand Down
3 changes: 2 additions & 1 deletion deviser/util/global_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,11 @@ def set_globals(lang, base, doc, prfix, lib, is_pack, pkg_prefix,
specifications=[], depend=[], library_vers=[],
my_copyright='', annot_elem='', notes_elem='', use_id_1=True,
use_name_1=True, ast=False, xml=False, top_name=''):
global is_sbml
is_sbml = True
global language
language = lang
if language != 'sbml':
global is_sbml
is_sbml = False

global namespaces
Expand Down
2 changes: 1 addition & 1 deletion deviser/validation/ValidationRulesForClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, object_desc, spec_name, number, package, pkg_ref):
# constants for rules
if global_variables.is_sbml:
self.up_package = strFunctions.upper_first(self.package)
self.lib_ref = 'L3V1 {0} V1 Section 3.1'.format(self.up_package)
self.lib_ref = 'L3V1 {0} V1 Section'.format(self.up_package)
else:
self.up_package = self.package.upper()
self.lib_ref = '{0} L{1}V{2} Section '.format(self.up_package, self.level, self.version)
Expand Down
4 changes: 2 additions & 2 deletions deviser/validation/ValidationRulesGeneral.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, spec_name, number, package, pkg_ref, level, version,
self.tc = 'TBC'
# constants for rules
if global_variables.is_sbml:
self.lib_ref = 'L3V1 {0} V1 Section 3.1'.format(self.up_package)
self.lib_ref = 'L3V1 {0} V1 Section'.format(self.up_package)
self.up_package = strFunctions.upper_first(self.package)
else:
self.lib_ref = '{0} L{1}V{2} Section '.format(self.up_package.upper(), self.level, self.version)
Expand Down Expand Up @@ -195,7 +195,7 @@ def write_unknown_rule(self):
ref = ''
sev = 'ERROR'
lib_sev = '{0}_SEV_ERROR'.format(global_variables.up_full_lib)
short = 'Unknown error from {0}'.format(self.up_package.upper())*10
short = 'Unknown error from {0}'.format(self.up_package.upper())
tc = global_variables.unknown_error
return dict({'number': self.number, 'text': text,
'reference': ref, 'severity': sev, 'typecode': tc,
Expand Down
3 changes: 2 additions & 1 deletion deviser/validation/ValidationXMLFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, lib_object, verbose=False):
self.pkg_version = lib_object['pkg_version']
self.pkg_ref = 'NA'
self.reqd_status = lib_object['required']
self.full_package_command = lib_object['name'] + ' Package'

self.tree = query.create_object_tree(lib_object, False)

Expand Down Expand Up @@ -127,7 +128,7 @@ def determine_rules(self):
rules = ValidationRulesGeneral\
.ValidationRulesGeneral(self.fullname, number, self.package,
self.pkg_ref, self.level, self.version,
self.pkg_version, self.reqd_status)
self.pkg_version, self.reqd_status, self.full_package_command)
rules.determine_rules()
self.class_rules += rules.rules
number = self.offset + 20200
Expand Down
Loading