Open smartie2076 opened 3 years ago
@mahendrark this is what I ment with my comment. Can you provide the json input files that I asked for in the checklist? Especially for EXTRA_CSV_PARAMETERS
.
The general json structure we have is minimal and could be expanded.
If you wish, we can provide a json schema to check any json against. There is documentation of the special meta json format of json schema. It is like a declarative json file where you have extra special attributes to specify what type is the attribute expected to be. It takes a little while to produce the schema but then it is quite handy to check whether a json file matches the schema or not (and we can define some attributes to be required or not). This is best to only do once we are sure the structure of the json will not change too much :)
The strategy I had in the past, as we concentrate more on csv input, is to use the generated json form the csv. A good test would be to compare all the results of a simulation ran with -ext csv
and -ext json
with the json file generated from the csv, these should be the same
utils.compare_input_parameters_with_reference
is a function we can use for that purpose
Might have been fixed by #761
As noticed in #722, there is no test implemented that makes sure that a json file provided to the MVS contains all necessary keys, and therefore no default values can be added.
For the csv input files, this is done with
REQUIRED_CSV_PARAMETERS
, and complimenting thisEXTRA_CSV_PARAMETERS
adds default values for new parameters that are not jet required. This enables adding new features with new parameters.However, this check is not run when a json file is used as an input. There are no error messages if parameters are missing, at least not if they are extra parameters. This also means that it is impossible to provide an outdated json file (eg. from the EPA) to the MVS, as the
EXTRA_CSV_PARAMETERS
are not added to the input file! This requires us to change the EPA-MVS parser everytime whe change the MVS, which we want to avoid using default values for new parameters.REQUIRED_CSV_PARAMETERS
is not includedREQUIRED_CSV_PARAMETERS
. If this produces an error, post the input file and the error message here.REQUIRED_CSV_PARAMETERS
are really not checked, write a function that does check it for json input files. @Bachibouzouk this might already happen, somehow withREQUIRED_JSON_PARAMETERS
but I do not have the complete picture.EXTRA_CSV_PARAMETERS
is not included.ValueError
) with this input file, and check in results (if generated), if the parameter is added. Upload the faulty input json file here.EXTRA_CSV_PARAMETERS
is not included in a provided input json file:logging.warning()
,dict_values.update
, pytestsEXTRA_CSV_PARAMETERS
andREQUIRED_CSV_PARAMETERS
, possibly here