large_image package

Subpackages

Submodules

large_image.config module

large_image.config.cpu_count(logical: bool = True) int[source]

Get the usable CPU count. If psutil is available, it is used, since it can determine the number of physical CPUS versus logical CPUs. This returns the smaller of that value from psutil and the number of cpus allowed by the os scheduler, which means that for physical requests (logical=False), the returned value may be more the the number of physical cpus that are usable.

Parameters:

logical – True to get the logical usable CPUs (which include hyperthreading). False for the physical usable CPUs.

Returns:

the number of usable CPUs.

large_image.config.getConfig(key: str | None = None, default: str | bool | int | Logger | None = None) Any[source]

Get the config dictionary or a value from the cache config settings.

Parameters:
  • key – if None, return the config dictionary. Otherwise, return the value of the key if it is set or the default value if it is not.

  • default – a value to return if a key is requested and not set.

Returns:

either the config dictionary or the value of a key.

large_image.config.getLogger(key: str | None = None, default: Logger | None = None) Logger[source]

Get a logger from the config. Ensure that it is a valid logger.

Parameters:
  • key – if None, return the ‘logger’.

  • default – a value to return if a key is requested and not set.

Returns:

a logger.

large_image.config.setConfig(key: str, value: str | bool | int | Logger | None) None[source]

Set a value in the config settings.

Parameters:
  • key – the key to set.

  • value – the value to store in the key.

large_image.config.total_memory() int[source]

Get the total memory in the system. If this is in a container, try to determine the memory available to the cgroup.

Returns:

the available memory in bytes, or 8 GB if unknown.

large_image.constants module

class large_image.constants.SourcePriority(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: IntEnum

FALLBACK = 10
FALLBACK_HIGH = 9
HIGH = 3
HIGHER = 2
IMPLICIT = 8
IMPLICIT_HIGH = 7
LOW = 5
LOWER = 6
MANUAL = 11
MEDIUM = 4
NAMED = 0
PREFERRED = 1

large_image.exceptions module

exception large_image.exceptions.TileCacheConfigurationError[source]

Bases: TileCacheError

exception large_image.exceptions.TileCacheError[source]

Bases: TileGeneralError

exception large_image.exceptions.TileGeneralError[source]

Bases: Exception

large_image.exceptions.TileGeneralException

alias of TileGeneralError

exception large_image.exceptions.TileSourceAssetstoreError[source]

Bases: TileSourceError

large_image.exceptions.TileSourceAssetstoreException

alias of TileSourceAssetstoreError

exception large_image.exceptions.TileSourceError[source]

Bases: TileGeneralError

large_image.exceptions.TileSourceException

alias of TileSourceError

exception large_image.exceptions.TileSourceFileNotFoundError(*args, **kwargs)[source]

Bases: TileSourceError, FileNotFoundError

exception large_image.exceptions.TileSourceInefficientError[source]

Bases: TileSourceError

exception large_image.exceptions.TileSourceXYZRangeError[source]

Bases: TileSourceError

Module contents