Commit bd5f1630 authored by Sasa Zhang's avatar Sasa Zhang
Browse files

modified README

parent 6c6d9816
Pipeline #195382 passed with stage
in 1 minute and 11 seconds
......@@ -73,7 +73,8 @@ To compile the Fortran model you will need to perform the following action:
svn+ssh://francois_fortin@svn.gna.org/svn/metro/metro/tags/metro-3.2.4
2) Upload package to the GNA web site (http://download.gna.org/metro/)
scp metro-3.2.4.tar.bz2 metro-3.2.4.tar.bz2.sig francois_fortin@download.gna.org:/upload/metro/
scp metro-3.2.4.tar.bz2 metro-3.2.4.tar.bz2.sig
francois_fortin@download.gna.org:/upload/metro/
3) Create a new LATEST_RELEASE file with the new version number.
The content of the file is:
......@@ -85,6 +86,7 @@ To compile the Fortran model you will need to perform the following action:
metro-3.2.4
------------------------------------- cut here --------------------------------
4) Upload the LATEST_RELEASE file to the GNA web site (http://download.gna.org/metro/)
4) Upload the LATEST_RELEASE file to the GNA web site
(http://download.gna.org/metro/)
scp LATEST_RELEASE francois_fortin@download.gna.org:/upload/metro/
......@@ -69,7 +69,8 @@ class Metro_model(Metro_module):
roadcast_data = self.__create_roadcast_collection(forecast_data, observation_data, station_data)
else:
roadcast_data = None
metro_logger.print_message(metro_logger.LOGGER_MSG_INFORMATIVE, _("Bypassing METRo core, roadcast not created."))
metro_logger.print_message(metro_logger.LOGGER_MSG_INFORMATIVE,
_("Bypassing METRo core, roadcast not created."))
pForecast.set_data_collection(forecast_data)
pObservation.set_data_collection(observation_data)
......
......@@ -55,7 +55,8 @@ class Metro_read_observation_ref(Metro_read):
metro_logger.print_message(metro_logger.LOGGER_MSG_CRITICAL, sError_message)
else:
# creer et ajouter infdata
infdata_observation_ref = metro_infdata.Metro_infdata( 'OBSERVATION_REF', metro_infdata.DATATYPE_METRO_DATA_COLLECTION)
infdata_observation_ref = metro_infdata.Metro_infdata( 'OBSERVATION_REF',
metro_infdata.DATATYPE_METRO_DATA_COLLECTION)
infdata_observation_ref.set_input_information(sFile_content)
self.add_infdata(infdata_observation_ref)
else:
......
......@@ -92,7 +92,8 @@ class Metro_validate(Metro_module):
try:
return metro_xml.validate_string(sXml_content)
except metro_error.Metro_xml_error as inst:
metro_logger.print_message(metro_logger.LOGGER_MSG_DEBUG, _("Error when validating ") + _("XML string."))
metro_logger.print_message(metro_logger.LOGGER_MSG_DEBUG,
_("Error when validating ") + _("XML string."))
raise metro_error.Metro_xml_error(str(inst))
else:
sMessage = _("No XML string to validate")
......
......@@ -9,7 +9,8 @@ class Plist_writer:
def __write_header(self):
self.output.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.output.write('<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n')
self.output.write('<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" '
'"http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n')
self.output.write('<plist version="1.0">\n')
def __write_footer(self):
......
......@@ -97,7 +97,8 @@ def get_metro_root_path():
# Nothing have been found
sError = _("The executable 'metro.py' must be in one of the following directory:\n") + \
_("metro_directory/src/frontend' or 'metro_directory/usr/lib/metro'.\n") + \
_("The following path is not valid: '%s'.\n\n") % (sys.path[0]) + _("Aborting execution of METRo.\n")
_("The following path is not valid: '%s'.\n\n") % (sys.path[0]) + \
_("Aborting execution of METRo.\n")
print(sError)
sys.exit(1)
return sRoot_path
......
......@@ -62,7 +62,8 @@ def init(sMetro_xml_lib=""):
sMessage = _("Fatal error! Can't import '%s' xml library") % sMetro_xml_lib
metro_logger.print_init_message(metro_logger.LOGGER_INIT_ERROR, sMessage)
else:
metro_logger.print_init_message(metro_logger.LOGGER_INIT_SUCCESS, _("XML library '%s' will be use.") % sMetro_xml_lib)
metro_logger.print_init_message(metro_logger.LOGGER_INIT_SUCCESS,
_("XML library '%s' will be use.") % sMetro_xml_lib)
metro_xml_lib = __import__(sMetro_xml_lib)
else:
......@@ -282,7 +283,8 @@ def create_node_tree_from_dict(domDoc, nodeParent, lDefs, dWriteHandlers, dData)
append_child(nodeParent, nodeData)
def create_node_tree_from_matrix(domDoc, nodeParent, sPrediction_xpath, lDefs, dWriteHandlers, metro_data_object, npMatrix):
def create_node_tree_from_matrix(domDoc, nodeParent, sPrediction_xpath, lDefs,
dWriteHandlers, metro_data_object, npMatrix):
"""
Each prediction will be contained in a node that will have the name given by sPrediction_xpath.
"""
......
......@@ -7,11 +7,12 @@ You are reading the test_suite README file of the release 4.0.0 (December 2019)
======================== What is test_suite.py of METRo? ======================
The test_suite.py of METRo is created to run pre-selected case(s) automatically.
Once test_suite.py finishes running, it generates the running result and outputs
a forecast file named "roadcast_test_suite_run.xml" for each individual pre-
selected case. It then compares the forecast file "roadcast_test_suite_run.xml"
with the given benchmark forecast file "roadcast_reference.xml" and displays the
comparison result for each pre-selected case.
Once test_suite.py finishes running, it generates the running result and
outputs a forecast file named "roadcast_test_suite_run.xml" for each individual
pre-selected case. It then compares the forecast file
"roadcast_test_suite_run.xml" with the given benchmark forecast file
"roadcast_reference.xml" and displays the comparison result for each
pre-selected case.
======================= Where is test_suite.py located? =======================
......@@ -39,12 +40,13 @@ config.json:
lies outside the range of 0.05; in other words, any comparison
differences within 0.05 are ignored).
Note: If you would like to use the default error tolerance of "0.01",
there is no need to add this extra attribute in "config.json".
Note: If you would like to use the default error tolerance of
"0.01", there is no need to add this extra attribute in
"config.json".
forecast.xml, observation.xml and station.xml:
These are the input files and each case should have these three files
in order for METRo to generate possible forecast.
These are the input files and each case should have these three
files in order for METRo to generate possible forecast.
roadcast_reference.xml:
This is a benchmark forecast file and it only exists for those cases
......@@ -67,9 +69,10 @@ roadcast_reference.xml:
the running results in a verbose version.
"-c XX XX ..." where XX represents the case number:
test_suite.py runs the case(s) whose number(s) is/are entered after "-c".
You can enter as many case numbers as you would like to run, but you
have to enter at least one case number in order to active "-c".
test_suite.py runs the case(s) whose number(s) is/are entered after
"-c". You can enter as many case numbers as you would like to run,
but you have to enter at least one case number in order to active
"-c".
Note: "-c" and "-s" cannot be used simultaneously.
......
......@@ -225,8 +225,9 @@ def process_test_result(case_folder, test_code, expected_value_json, verbosity=F
if not json_exists:
print("Note: 'config.json' file does not exist for {}".format(case_folder))
elif (test_code != 0 and expected_value_json == 'SUCCESS') or (test_code == 0 and expected_value_json == 'FAILURE') \
or (test_code == 0 and (expected_value_json == 'SUCCESS' or expected_value_json == '')
elif (test_code != 0 and expected_value_json == 'SUCCESS') or \
(test_code == 0 and expected_value_json == 'FAILURE') or \
(test_code == 0 and (expected_value_json == 'SUCCESS' or expected_value_json == '')
and XmlTree.sum_of_error_outside_tolerance > 0) or \
((not forecast_exists or not station_exists or not observation_exists) and not json_exists):
num_of_failure += 1
......@@ -313,7 +314,8 @@ def main():
parser = argparse.ArgumentParser(description='run the test suite')
parser.add_argument('-c', '--case', nargs='+', default=[], metavar='', help='add case number(s) to a case list')
parser.add_argument('-s', '--skip', nargs='+', default=[], metavar='', help='add case number(s) to a do-not-run case list')
parser.add_argument('-s', '--skip', nargs='+', default=[], metavar='',
help='add case number(s) to a do-not-run case list')
parser.add_argument('-v', '--verbose', action='store_true', help='display the process in a complete detailed way')
parser.add_argument('-e', '--error', type=float, help='specified value of error tolerance')
parser.add_argument('--clean', action='store_true', help="clean up output XML file 'roadcast_test_suite_run.xml'")
......@@ -405,8 +407,8 @@ def main():
format(', '.join(list_of_wrong_folders)))
sys.exit(0)
case_list = sorted(list(set([folder for folder in sorted(os.listdir(test_suite_path)) if folder.startswith(case_name)])
- set(do_not_run_case_list)))
case_list = sorted(list(set([folder for folder in sorted(os.listdir(test_suite_path))
if folder.startswith(case_name)]) - set(do_not_run_case_list)))
if run_all_cases:
list_of_folders = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment