1.5.1.1.9.2.3. polar2grid.tests._fixture_utils module

Shared utilities between fixtures.

class polar2grid.tests._fixture_utils._FakeReader(reader_name, dataset_dict, all_dataset_ids, available_dataset_ids)[source]

Bases: FileYAMLReader

Fake reader to avoid loading real files during testing.

_abc_impl = <_abc._abc_data object>
property all_dataset_ids

Get DataIDs of all datasets known to this reader.

property available_dataset_ids

Get DataIDs that are loadable by this reader.

property end_time

End time of the latest file used by this reader.

load(dataset_keys, previous_datasets=None, **kwargs)[source]

Load dataset_keys.

If previous_datasets is provided, do not reload those.

property sensor_names

Names of sensors whose data is being loaded by this reader.

property start_time

Start time of the earlier file used by this reader.

class polar2grid.tests._fixture_utils._TestingScene(*args, data_array_dict=None, all_dataset_ids=None, available_dataset_ids=None, **kwargs)[source]

Bases: Scene

Special Scene class to mimic a real Scene that would be created during normal execution.

_create_reader_instances(filenames=None, reader=None, reader_kwargs=None)[source]

Find readers and return their instances.

polar2grid.tests._fixture_utils.generate_lonlat_data(shape: tuple[int, int], dtype: ~typing.Union[~numpy.dtype[~typing.Any], None, ~typing.Type[~typing.Any], ~numpy.typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]], str, ~typing.Tuple[~typing.Any, int], ~typing.Tuple[~typing.Any, ~typing.Union[~typing.SupportsIndex, ~typing.Sequence[~typing.SupportsIndex]]], ~typing.List[~typing.Any], ~numpy.typing._dtype_like._DTypeDict, ~typing.Tuple[~typing.Any, ~typing.Any]] = <class 'numpy.float32'>) tuple[numpy.ndarray[typing.Any, numpy.dtype[+ScalarType]], numpy.ndarray[typing.Any, numpy.dtype[+ScalarType]]][source]