check_json.py is a command-line tool for verifying that forecast/observation jsons are valid and useable by SPHINX. It currently checkst that
json can be loaded
energy channel blocks can be found
an object can be instantiated
forecast json trigger timestamps are valid
A few small changes to outside SPHINX code aided in making the checker able to validate jsons using exactly the same functions/methods that SPHINX uses to work:
Forecast.valid_forecast() now takes no arguments; relies solely on class data. It also has a verbose flag for explaining why invalid states are reached
match.py now relies on valid_forecast() above to print its error messages
validation_json_handler module changes:
read_in_json() no longer warns and skips for file not found / corrupt json type exceptions. Exceptions are just raised and SPHINX will now fail in these cases.
split read_json_list() into that and read_list_of_jsons(), the former processes a python list of str filenames, the latter reads file and returns a python list of str filenames.
identify_all_energy_channels() now works on either forecast or observation jsons, specified using the 'kind' argument
check_json.py is a command-line tool for verifying that forecast/observation jsons are valid and useable by SPHINX. It currently checkst that
A few small changes to outside SPHINX code aided in making the checker able to validate jsons using exactly the same functions/methods that SPHINX uses to work:
Fixes issue #21