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: ~numpy.dtype[~typing.Any] | None | type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[~typing.Any, int] | tuple[~typing.Any, ~typing.SupportsIndex | ~collections.abc.Sequence[~typing.SupportsIndex]] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | tuple[~typing.Any, ~typing.Any] = <class 'numpy.float32'>) tuple[ndarray[Any, dtype[_ScalarType_co]], ndarray[Any, dtype[_ScalarType_co]]][source]