satpy.tests.test_writers module
Test generic writer functions.
- class satpy.tests.test_writers.TestBaseWriter[source]
Bases:
object
Test the base writer class.
- test_save_dataset_dynamic_filename(fmt_fn, exp_fns)[source]
Test saving a dataset with a format filename specified.
- class satpy.tests.test_writers.TestComplexSensorEnhancerConfigs[source]
Bases:
_BaseCustomEnhancementConfigTests
Test enhancement configs that use or expect multiple sensors.
- ENH_FN = 'test_sensor1.yaml'
- ENH_FN2 = 'test_sensor2.yaml'
- TEST_CONFIGS: dict[str, str] = {'test_sensor1.yaml': '\nenhancements:\n test1_sensor1_specific:\n name: test1\n sensor: test_sensor1\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 200}\n\n ', 'test_sensor2.yaml': '\nenhancements:\n default:\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 100}\n test1_sensor2_specific:\n name: test1\n sensor: test_sensor2\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 50}\n exact_multisensor_comp:\n name: my_comp\n sensor: [test_sensor1, test_sensor2]\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 20}\n '}
- class satpy.tests.test_writers.TestComputeWriterResults(methodName='runTest')[source]
Bases:
TestCase
Test compute_writer_results().
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class satpy.tests.test_writers.TestEnhancer(methodName='runTest')[source]
Bases:
TestCase
Test basic Enhancer functionality with builtin configs.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class satpy.tests.test_writers.TestEnhancerUserConfigs[source]
Bases:
_BaseCustomEnhancementConfigTests
Test Enhancer functionality when user’s custom configurations are present.
- ENH_ENH_FN = 'enhancements/test_sensor.yaml'
- ENH_ENH_FN2 = 'enhancements/test_sensor2.yaml'
- ENH_FN = 'test_sensor.yaml'
- ENH_FN2 = 'test_sensor2.yaml'
- ENH_FN3 = 'test_empty.yaml'
- TEST_CONFIGS: dict[str, str] = {'enhancements/test_sensor.yaml': '\nenhancements:\n test1_kelvin:\n name: test1\n units: kelvin\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 20}\n\n ', 'enhancements/test_sensor2.yaml': '\n\n ', 'test_empty.yaml': '', 'test_sensor.yaml': '\nenhancements:\n test1_default:\n name: test1\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: linear, cutoffs: [0., 0.]}\n\n ', 'test_sensor2.yaml': '\n\n\n '}
- test_enhance_with_sensor_entry2()[source]
Test enhancing an image with a more detailed configuration section.
- class satpy.tests.test_writers.TestOverlays(methodName='runTest')[source]
Bases:
TestCase
Tests for add_overlay and add_decorate functions.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class satpy.tests.test_writers.TestReaderEnhancerConfigs[source]
Bases:
_BaseCustomEnhancementConfigTests
Test enhancement configs that use reader name.
- ENH_FN = 'test_sensor1.yaml'
- TEST_CONFIGS: dict[str, str] = {'test_sensor1.yaml': '\nenhancements:\n default_reader2:\n reader: reader2\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 75}\n default:\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 100}\n test1_reader2_specific:\n name: test1\n reader: reader2\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 50}\n test1_reader1_specific:\n name: test1\n reader: reader1\n operations:\n - name: stretch\n method: !!python/name:satpy.enhancements.stretch\n kwargs: {stretch: crude, min_stretch: 0, max_stretch: 200}\n '}
- class satpy.tests.test_writers.TestWritersModule(methodName='runTest')[source]
Bases:
TestCase
Test the writers module.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- class satpy.tests.test_writers.TestYAMLFiles(methodName='runTest')[source]
Bases:
TestCase
Test and analyze the writer configuration files.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- satpy.tests.test_writers.test_group_results_by_output_file(tmp_path)[source]
Test grouping results by output file.
Add a test for grouping the results from save_datasets(…, compute=False) by output file. This is useful if for some reason we want to treat each output file as a seperate computation (that can still be computed together later).