drs4.utils module#

drs4.utils.is_strpath(obj: Any, /) → TypeGuard[PathLike[str] | str][source]#

Check if given object can provide a file system path.

drs4.utils.log_args(logger: Logger, /) → Callable[[Callable[[P], R]], Callable[[P], R]][source]#

Decorator to log function arguments.

drs4.utils.set_logger(*, file: PathLike[str] | str | None = None, level: str = 'INFO', stderr: bool = True) → None[source]#

Setup the DRS4 package root logger.

Parameters:
  • file – If given, log will be written in it.

  • level – Logging level (e.g., INFO, DEBUG).

  • stderr – If True, log will be sent to stderr.

drs4.utils.set_workdir(workdir: PathLike[str] | str | None = None, /) → Iterator[Path][source]#

Set the working directory for output VDIF files.

drs4.utils.unique(array: NDArray[Any], /, axis: Sequence[int] | int | None = None) → NDArray[Any][source]#

Return unique values along given axis (axes).