numina.util — Generic utilities

numina.util.context — Context managers

numina.util.context.environ(**keys)

Context manager that records environment

numina.util.context.manage_fits(list_of_frame)

Manage a list of FITS resources

numina.util.context.working_directory(path)

A context manager which changes the working directory to the given path, and then changes it back to its previous value on exit.

numina.util.convert — Conversors

Convert strings to values in data load

numina.util.convert.convert_date(value)

Convert any string to datetime

Parameters:

value (str or datetime) –

numina.util.convert.convert_qc(value)

Convert string to QC

Parameters:

value (str) –

Return type:

numina.types.qc.QC

numina.util.convertfunc — Conversors

Convert strings to functions in data load

numina.util.convertfunc.json_deserial_func_p(args)

Rebuild Polynomial :param args:

Return type:

nppol.Polynomial

numina.util.convertfunc.json_deserial_func_u(args)

Rebuild UnivariateSpline

Parameters:

args

Return type:

UnivariateSpline

numina.util.flow — Flow objects

exception numina.util.flow.FlowError

Error base class for flows.

class numina.util.flow.MixerFlow(table)
class numina.util.flow.ParallelFlow(nodeseq)

A flow where Nodes are executed in parallel.

class numina.util.flow.SerialFlow(nodeseq)

A flow where Nodes are executed sequentially.

numina.util.node — Node objects

class numina.util.node.AdaptorNode(work, ninputs=1, noutputs=1)

A Node that runs a function.

class numina.util.node.IdNode

A Node that returns its inputs.

class numina.util.node.Node(ninputs=1, noutputs=1)

An elemental operation in a Flow.

class numina.util.node.OutputSelector(ninputs, indexes)

A Node that returns part of the results.

numina.util.fqn — FQN

Manage a fully qualified name for classes

numina.util.fqn.fully_qualified_name(obj, sep='.')

Return fully qualified name from object

numina.util.jsonencoder — Extended JSON encoder

class numina.util.jsonencoder.ExtEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

“Encode numpy.floats and numpy.integer

default(obj)

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return super().default(o)

numina.util.namespace — Generic Namespace

class numina.util.namespace.Namespace(**kwargs)

Namespace class, like argparse.Namespace

>>> nm = Namespace(a=1, b="field")
>>> nm.a == 1
>>> nm.b == "field"

numina.util.objimport — Import objects

Import objects by name

numina.util.objimport.import_object(path)

Import an object given its fully qualified name.

numina.util.parser — Miniparser

numina.util.parser.parse_arg_line(fargs)

parse limited form of arguments of function

in the form a=1, b=’c’ as a dictionary