mapgwm.check_input_datasets module

Functions to test input files against those used for module testing by Travis CI.

The automatic testing of the scripts uses standard input files in tests/data/ to make sure routines will run after changes are made. These tests, however, do not check if there are changes to input file formats that can cause errors in the processing. Functions in this package just test user specified input files against those used in the tests directory.

Authors should add a method for any datasets added to tests/data/

mapgwm.check_input_datasets.check_headobs_header(new_data_file, new_meta_file, path_to_tests='.')[source]

headobs.py reads in data from Will Asquith as two csv files datafile - csv with observed monthly heads metadata - csv with site characteristics

test_headobs points to mapgwm/tests/data/headobs/GW_monthly_stats_test.txt mapgwm/tests/data/headobs/GW_monthly_meta_test.txt

Which have the top 1000 lines of datasets from August 2020.

Parameters
new_data_file: path to data file to test
new_meta_file: path to metadata file to test
Returns
(pass1 and pass2): Boolean, False if files do not match
mapgwm.check_input_datasets.check_preprocess_headobs_input(data_file, metadata_file, output_path='.')[source]
mapgwm.check_input_datasets.compare_lists(list1, name1, list2, name2)[source]

compare two lists and check for different or missing entries print out missing or different entries in list 2 compared to list 1

Parameters
list1: list

name1: str - name to be printed in comparison list2: second list name2: str - name to be printed in comparison

Returns
passed: boolean, returns True if files match
mapgwm.check_input_datasets.get_header_length(sitefile, col0='SITE_BADGE')[source]