arrakis.utils.io

I/O utilities

Module Contents

Functions

_samefile(src, dst)

copyfile(src, dst, *[, follow_symlinks, verbose])

Copy data from src to dst.

copyfileobj(fsrc, fdst[, length, verbose])

gettable(→ Tuple[astropy.table.Table, str])

Get a table from a directory given a keyword to glob.

parse_env_path(→ pathlib.Path)

Parse an environment path.

prsync(wild_src, tgt, ncores)

rsync(src, tgt)

try_mkdir(dir_path[, verbose])

Create directory if it doesn't exist

try_symlink(src, dst[, verbose])

Create symlink if it doesn't exist

Attributes

TQDM_OUT

arrakis.utils.io._samefile(src, dst)[source]
arrakis.utils.io.copyfile(src, dst, *, follow_symlinks=True, verbose=True)[source]

Copy data from src to dst.

If follow_symlinks is not set and src is a symbolic link, a new symlink will be created instead of copying the file it points to.

arrakis.utils.io.copyfileobj(fsrc, fdst, length=16 * 1024, verbose=True)[source]
arrakis.utils.io.gettable(tabledir: str, keyword: str, verbose=True) Tuple[astropy.table.Table, str][source]

Get a table from a directory given a keyword to glob.

Parameters:
  • tabledir (str) – Directory.

  • keyword (str) – Keyword to glob for.

  • verbose (bool, optional) – Verbose output. Defaults to True.

Returns:

Table and it’s file location.

Return type:

Tuple[Table, str]

arrakis.utils.io.parse_env_path(env_path: arrakis.utils.typing.PathLike) pathlib.Path[source]

Parse an environment path.

Parameters:

env_path (str) – Environment path.

Returns:

Parsed path.

Return type:

Path

arrakis.utils.io.prsync(wild_src: str, tgt: str, ncores: int)[source]
arrakis.utils.io.rsync(src, tgt)[source]
arrakis.utils.io.try_mkdir(dir_path: str, verbose=True)[source]

Create directory if it doesn’t exist

Parameters:
  • dir_path (str) – Path to directory

  • verbose (bool, optional) – Verbose output. Defaults to True.

Create symlink if it doesn’t exist

Parameters:
  • src (str) – Source path

  • dst (str) – Destination path

  • verbose (bool, optional) – Verbose output. Defaults to True.

arrakis.utils.io.TQDM_OUT[source]