mnp.preparation.input_verification_functions
Module Contents
Functions
Is a file a gdal compatible geospatial raster? Parameters ———- file_pathL target file path |
|
Check if a raster has target resolution Parameters ———- file_path: target file path target_resolution: expected resolution of the raster |
|
Is something a directory? Parameters ———- directory_path: target directory path |
|
Directory contains n or more files matching a glob patter Parameters ———- directory_path: target directory path patter: string pattern to match for n: minimal nr of files |
|
Verify that all rasters have identical bound Parameters ———- rasters: list with one or more paths to raster files on disk |
|
Verify parameters in user generated ini file comply to expectatations |
|
Determine if a file is a valid CSV with contents and corret header Parameters ———- file_path: path to file table_type: table type to deterime required headers |
|
Check if name for environmental variable occurs in at least one species environmental variable formula. |
|
Verify that all species local distances are conmensurable with 25m raster resolution Parameters ———- species_traits: path species traits table target_resolution: raster resolution |
API
- mnp.preparation.input_verification_functions.is_geospatial_raster(file_path: str)
Is a file a gdal compatible geospatial raster? Parameters ———- file_pathL target file path
- mnp.preparation.input_verification_functions.path_exists(path)
- mnp.preparation.input_verification_functions.raster_has_resolution(file_path: str, target_resolution)
Check if a raster has target resolution Parameters ———- file_path: target file path target_resolution: expected resolution of the raster
- mnp.preparation.input_verification_functions.is_directory(directory_path: str)
Is something a directory? Parameters ———- directory_path: target directory path
- mnp.preparation.input_verification_functions.directory_contains(directory_path: str, pattern: str, n)
Directory contains n or more files matching a glob patter Parameters ———- directory_path: target directory path patter: string pattern to match for n: minimal nr of files
- mnp.preparation.input_verification_functions.rasters_have_identical_bounds(rasters: list)
Verify that all rasters have identical bound Parameters ———- rasters: list with one or more paths to raster files on disk
- mnp.preparation.input_verification_functions.verify_parameters(configuration: configparser.ConfigParser)
Verify parameters in user generated ini file comply to expectatations
configuration: output from read_ini
boolean, msg
- mnp.preparation.input_verification_functions.csv_is_readable(file_path: str) bool
- mnp.preparation.input_verification_functions.is_valid_csv(file_path: str, table_type: str)
Determine if a file is a valid CSV with contents and corret header Parameters ———- file_path: path to file table_type: table type to deterime required headers
- mnp.preparation.input_verification_functions.occurs_in_formula(name: str, species_traits: str)
Check if name for environmental variable occurs in at least one species environmental variable formula.
- name: str
name for this environmental variable
- species_traits: str
path to species traits csv file
- out: bool
boolean indicating status
- msg: str
message specifying status
- mnp.preparation.input_verification_functions.verify_local_distance(species_traits: str, target_resolution: int)
Verify that all species local distances are conmensurable with 25m raster resolution Parameters ———- species_traits: path species traits table target_resolution: raster resolution