satpy.tests.writer_tests.test_cf module

Tests for the CF writer.

class satpy.tests.writer_tests.test_cf.TempFile(suffix='.nc')[source]

Bases: object

A temporary filename class.

Initialize.

class satpy.tests.writer_tests.test_cf.TestCFWriter[source]

Bases: object

Test case for CF writer.

test_ancillary_variables()[source]

Test ancillary_variables cited each other.

test_bounds()[source]

Test setting time bounds.

test_bounds_minimum()[source]

Test minimum bounds.

test_bounds_missing_time_info()[source]

Test time bounds generation in case of missing time.

test_global_attr_default_history_and_Conventions()[source]

Test saving global attributes history and Conventions.

test_global_attr_history_and_Conventions()[source]

Test saving global attributes history and Conventions.

test_groups()[source]

Test creating a file with groups.

test_header_attrs()[source]

Check global attributes are set.

test_init()[source]

Test initializing the CFWriter class.

test_load_module_with_old_pyproj()[source]

Test that cf_writer can still be loaded with pyproj 1.9.6.

test_save_array()[source]

Test saving an array to netcdf/cf.

test_save_array_coords()[source]

Test saving array with coordinates.

test_save_dataset_a_digit()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit.

test_save_dataset_a_digit_no_prefix_include_attr()[source]

Test saving an array to netcdf/cf dataset name starting with a digit with no prefix include orig name.

test_save_dataset_a_digit_prefix()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit with prefix.

test_save_dataset_a_digit_prefix_include_attr()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit with prefix include orig name.

test_single_time_value()[source]

Test setting a single time value.

test_time_coordinate_on_a_swath()[source]

Test that time dimension is not added on swath data with time already as a coordinate.

test_unlimited_dims_kwarg()[source]

Test specification of unlimited dimensions.

class satpy.tests.writer_tests.test_cf.TestEncodingAttribute[source]

Bases: TestNetcdfEncodingKwargs

Test CF writer with ‘encoding’ dataset attribute.

scene_with_encoding(scene, encoding)[source]

Create scene with a dataset providing the ‘encoding’ attribute.

test_encoding_attribute(scene_with_encoding, filename, expected)[source]

Test ‘encoding’ dataset attribute.

class satpy.tests.writer_tests.test_cf.TestNetcdfEncodingKwargs[source]

Bases: object

Test netCDF compression encodings.

_assert_encoding_as_expected(filename, expected)[source]
complevel_exp(compression_on)[source]

Get expected compression level.

compression_on(request)[source]

Get compression options.

encoding(compression_on)[source]

Get encoding.

expected(complevel_exp)[source]

Get expectated file contents.

filename(tmp_path)[source]

Get output filename.

scene()[source]

Create a fake scene.

test_encoding_kwarg(scene, encoding, filename, expected)[source]

Test ‘encoding’ keyword argument.

test_no_warning_if_backends_match(scene, filename, monkeypatch)[source]

Make sure no warning is issued if backends match.

test_warning_if_backends_dont_match(scene, filename, monkeypatch)[source]

Test warning if backends don’t match.

satpy.tests.writer_tests.test_cf._get_compression_params(complevel)[source]
satpy.tests.writer_tests.test_cf._should_use_compression_keyword()[source]