You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating regression test files is relatively straight-forward but in tests/test_processing.py::test_process_scan_both the resulting HDF5 .topostast file that is generated/saved as part of the processing is compared to an existing file (tests/resources/process_scan_topostats_file_regtest.topostats.
If we add additional content to the HDF5 file (e.g. height profiles see #748 and #871) then this test will fail as the new fields won't be present.
We should, for our own sanity and that of anyone contributing, document how to update this file.
The configuration for processing is defined in tests/conftest.py::process_scan_config() and is based on topostats/default_config.yaml with some adjustments made when defining the fixture...
...and also when setting up the test in tests/test_processing::test_process_scan_both()...
deftest_process_scan_both(regtest, tmp_path, process_scan_config: dict, load_scan_data: LoadScans) ->None:
"""Regression test for checking the process_scan functions correctly."""# Ensure there are below grainsprocess_scan_config["grains"]["threshold_std_dev"]["below"] =0.8process_scan_config["grains"]["smallest_grain_size_nm2"] =10process_scan_config["grains"]["absolute_area_threshold"]["below"] = [1, 1000000000]
process_scan_config["grains"]["direction"] ="both"
...
The process_scan() function is run with img_dic["minicircle_small"] which is defined in the tests/conftest.py::load_scan_data() fixture and loads the file tests/resources/test_image/minicircle_small.topostats.
To which end the steps required to update the target file are...
Make a temporary directory and copy the tests/resources/test_image/minicircle_small.topostats to this directory, change directory to this location
Create a config.yaml for editing (topostats create-config will generate config.yaml).
Updating regression test files is relatively straight-forward but in
tests/test_processing.py::test_process_scan_both
the resulting HDF5.topostast
file that is generated/saved as part of the processing is compared to an existing file (tests/resources/process_scan_topostats_file_regtest.topostats
.If we add additional content to the HDF5 file (e.g. height profiles see #748 and #871) then this test will fail as the new fields won't be present.
We should, for our own sanity and that of anyone contributing, document how to update this file.
The configuration for processing is defined in
tests/conftest.py::process_scan_config()
and is based ontopostats/default_config.yaml
with some adjustments made when defining the fixture......and also when setting up the test in
tests/test_processing::test_process_scan_both()
...The
process_scan()
function is run withimg_dic["minicircle_small"]
which is defined in thetests/conftest.py::load_scan_data()
fixture and loads the filetests/resources/test_image/minicircle_small.topostats
.To which end the steps required to update the target file are...
tests/resources/test_image/minicircle_small.topostats
to this directory, change directory to this locationconfig.yaml
for editing (topostats create-config
will generateconfig.yaml
).filter.remove_scar.run
:true
grains.threshold_std_dev.below :
0.8`grains.absolute_area_threshold.above :
500, 800`grains.smallest_grain_size_nm2
:10
grains.absolute_area_threshold.below
:1, 1000000000
grains.direction
:both
config.yaml
(i.e.topostats process -c config.yaml
).output/process/minicricle_small.topostats
has the new/additional content.output/process/minicricle_small.topostats
toTopoStats/tests/resources/process_scan_topostats_file_regtest.topostats
pytest tests/test_processing.py::test_process_scan_both
).The text was updated successfully, but these errors were encountered: