climate_ref.testing
#
Testing utilities
fetch_sample_data(force_cleanup=False, symlink=False)
#
Fetch the sample data for the given version.
The sample data is produced in the Climate-REF/ref-sample-data repository. This repository contains decimated versions of key datasets used by the diagnostics packages. Decimating these data greatly reduces the data volumes needed to run the test-suite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
force_cleanup
|
bool
|
If True, remove any existing files |
False
|
symlink
|
bool
|
If True, symlink in the data otherwise copy the files The symlink approach is faster, but will fail when running with a non-local executor because the symlinks can't be followed. |
False
|
Source code in packages/climate-ref/src/climate_ref/testing.py
validate_result(diagnostic, config, result)
#
Asserts the correctness of the result of a diagnostic execution
This should only be used by the test suite as it will create a fake database entry for the diagnostic execution result.