Commit 62bc8236 authored by Sasa Zhang's avatar Sasa Zhang
Browse files

metro_data_station.py and readme

parent c08ce1de
Pipeline #196288 passed with stage
in 1 minute and 2 seconds
...@@ -136,7 +136,8 @@ class Metro_data_station(Metro_data): ...@@ -136,7 +136,8 @@ class Metro_data_station(Metro_data):
else: else:
dStation_header = self.get_header() dStation_header = self.get_header()
fStation_sst_depth = dStation_header['SST_DEPTH'] fStation_sst_depth = dStation_header['SST_DEPTH']
if fStation_sst_depth == "None" or fStation_sst_depth > 1.4 or fStation_sst_depth < 0.01: # if fStation_sst_depth == "None" or fStation_sst_depth > 1.4 or fStation_sst_depth < 0.01:
if fStation_sst_depth is None or fStation_sst_depth > 1.4 or fStation_sst_depth < 0.01:
sMessage = _("Sensor SST depth value in station config file is not between 0.01 m and 1.4 m. " sMessage = _("Sensor SST depth value in station config file is not between 0.01 m and 1.4 m. "
"Given value: '%s' m.") % fStation_sst_depth "Given value: '%s' m.") % fStation_sst_depth
metro_logger.print_message(metro_logger.LOGGER_MSG_STOP, sMessage) metro_logger.print_message(metro_logger.LOGGER_MSG_STOP, sMessage)
......
...@@ -2,37 +2,63 @@ ...@@ -2,37 +2,63 @@
METRo test_suite README file METRo test_suite README file
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
You are reading the test_suite README file of the release 4.0.0 (December 2019) Test suite FAQ of METRo 4.0.0 (December 2019)
======================== What is test_suite.py of METRo? ====================== ======================== What is test_suite.py of METRo? ======================
The test_suite.py of METRo is created to run pre-selected case(s) automatically. The test_suite.py of METRo run pre-selected case(s) automatically and output a
Once test_suite.py finishes running, it generates the running result and forecast file named "roadcast_test_suite_run.xml" for every pre-selected case.
outputs a forecast file named "roadcast_test_suite_run.xml" for each individual It then compares the forecast file "roadcast_test_suite_run.xml" with the given
pre-selected case. It then compares the forecast file benchmark forecast file "roadcast_reference.xml" and displays the comparison
"roadcast_test_suite_run.xml" with the given benchmark forecast file result.
"roadcast_reference.xml" and displays the comparison result for each
pre-selected case.
======================= Where is test_suite.py located? ======================= ======================= Where is test_suite.py located? =======================
test_suite.py is placed in the directory "test_suite" which is located in the test_suite.py is located in the directory "test_suite", which is in
absolute path "usr/share/metro/data/test_suite" from the home directory of the "$METRoDIR/usr/share/metro/data/test_suite" where "$METRoDIR" represents the
software METRo. home directory of the software METRo.
======================= Where is each test case located? ====================== ======================= Where is each test case located? ======================
Within the directory "test_suite", it contains all the subdirectories of test The directory "test_suite" contains all the subdirectories for test cases.
cases. Each test case has one subdirectory named "casexxx" and "xxx" represents Each test case contains a subdirectory named "caseDDD", where "DDD" is a three
a three digits case number (For instance, "case001" represents a case having digits case number (ex: "case001" represents a case having case number 1, and
case number 1, and "case100" represents a case having case number 100). "case020" represents a case having case number 20).
====== What are all the possible files included inside a case directory? ====== ====== What are all the possible files included inside a case directory? ======
config.json: config.json:
This is the configuration file and it includes three attributes: Configuration file for the test. It includes three attributes:
"description", "addition_to_command_line" and "description", "addition_to_command_line" and
"expected_running_result". "expected_running_result".
Expected value for "description" can be any strings that you
would like to comment on the case.
Expected value for "addition_to_command_line":
--config filename
--enable-sunshadow
--fix-deep-soil-temperature temperature
--generate-config filename
--lang fr|en
--log-file filename
--output-subsurface-levels
--roadcast-start-date date
--silent
--sunshadow-method method--use-anthropogenic-flux
--use-infrared-forecast
--use-sst-sensor-depth
--use-solarflux-forecast
--verbose-level level
--version
--help
Please refer to:
https://framagit.org/metroprojects/metro/wikis/Man_page_(METRo)
for more details.
Expected value for "expected_running_result" can only be
either "SUCCESS" or "FAILURE".
One extra attribute "error_tolerance" can be added and the value of One extra attribute "error_tolerance" can be added and the value of
this attribute has to be in decimal places (For example, having the this attribute has to be in decimal places (For example, having the
value of "0.05" as the "error_tolerance", the comparison result value of "0.05" as the "error_tolerance", the comparison result
...@@ -45,54 +71,51 @@ config.json: ...@@ -45,54 +71,51 @@ config.json:
"config.json". "config.json".
forecast.xml, observation.xml and station.xml: forecast.xml, observation.xml and station.xml:
These are the input files and each case should have these three METRo standard input files and each case should have these three
files in order for METRo to generate possible forecast. files in order for METRo to generate possible forecast.
roadcast_reference.xml: roadcast_reference.xml:
This is a benchmark forecast file and it only exists for those cases Benchmark forecast file. Only exists for those cases whose attribute
whose attribute "expected_running_result" has value of "SUCCESS". "expected_running_result" has value of "SUCCESS".
======================== How to run test_suite.py? ============================ ======================== How to run test_suite.py? ============================
1. Go to the directory "usr/share/metro/data/test_suite" from the home 1. Go to the directory "$METRoDIR/usr/share/metro/data/test_suite" where
directory of METRo. "$METRoDIR" represents the home directory of METRo.
2. Enter general command "python3 test_suite.py" to run all the cases inside
the directory "test_suite" and displays the running results in a simplified
version.
Possible parameters to run altogether with the general command: 2. Enter "python3 test_suite.py" to run all the cases inside the directory
"test_suite" and displays the running results in a simplified version.
OPTIONS
"-v": "-v":
test_suite.py runs all cases inside the directory "test_suite" and runs all cases inside the directory "test_suite" and displays the
displays the detailed information of running processes and outputs detailed information of running processes and outputs the running
the running results in a verbose version. results in a verbose version.
"-c XX XX ..." where XX represents the case number: "-c XX XX ..." where XX represents the case number:
test_suite.py runs the case(s) whose number(s) is/are entered after runs the case(s) whose number(s) is/are entered after "-c". You can
"-c". You can enter as many case numbers as you would like to run, enter as many case numbers as you would like to run, but you have to
but you have to enter at least one case number in order to active enter at least one case number in order to active "-c".
"-c".
Note: "-c" and "-s" cannot be used simultaneously. Note: "-c" and "-s" cannot be used simultaneously.
"-s XX XX ..." where XX represents the case number: "-s XX XX ..." where XX represents the case number:
test_suite.py runs by skipping the case(s) whose number(s) is/are runs by skipping the case(s) whose number(s) is/are entered after
entered after "-s". You can enter as many case numbers as you would "-s". You can enter as many case numbers as you would like to skip,
like to skip, but you have to enter at least one case number in but you have to enter at least one case number in order to active
order to active "-s". "-s".
Note: "-c" and "-s" cannot be used simultaneously. Note: "-c" and "-s" cannot be used simultaneously.
"-e YY" where YY represents the error tolerance in floating points: "-e YY" where YY represents the error tolerance in floating points:
test_suite.py runs all cases inside the directory "test_suite" and runs all cases inside the directory "test_suite" and compares
compares "roadcast_test_suite_run.xml" with "roadcast_reference.xml" "roadcast_test_suite_run.xml" with "roadcast_reference.xml" and
and outputs comparison result(s) using YY instead of the default outputs comparison result(s) using YY instead of the default value
value of 0.01 as error of tolerance. of 0.01 as error of tolerance.
"--clean": "--clean":
test_suite.py deletes all the files "roadcast_test_suite_run.xml" deletes all the files named "roadcast_test_suite_run.xml" within the
within the directory "test_suite". directory "test_suite".
Note: "--clean" can only be used in combination with "-v" which Note: "--clean" can only be used in combination with "-v" which
displays all the directory/directories where the displays all the directory/directories where the
......
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