lightcurvelynx.astro_utils.pzflow_node

A wrapper around pzflow sampling.

For the full pzflow package see: https://github.com/jfcrenshaw/pzflow

Classes

PZFlowNode

A node that wraps sampling from pzflow.

Module Contents

class PZFlowNode(flow_obj, node_label=None, **kwargs)[source]

Bases: lightcurvelynx.base_models.FunctionNode, citation_compass.CiteClass

A node that wraps sampling from pzflow.

References

flow[source]

The object from which to sample.

Type:

pzflow.flow.Flow or pzflow.flowEnsemble.FlowEnsemble

columns[source]

The column names for the output columns.

Type:

list of str

conditional_cols

The names of the conditional columns used when sampling the flow.

Type:

list of str

flow[source]
columns[source]
classmethod from_file(filename, node_label=None, **kwargs)[source]

Create a PZFlowNode from a saved flow file.

Parameters:
  • filename (str or Path) – The location of the saved flow.

  • node_label (str) – An optional human readable identifier (name) for the current node.

  • **kwargs (dict, optional) – Additional function arguments, including the input parameters for the flow.

compute(graph_state, rng_info=None, **kwargs)[source]

Return the given values.

Parameters:
  • graph_state (GraphState) – An object mapping graph parameters to their values. This object is modified in place as it is sampled.

  • rng_info (numpy.random._generator.Generator, optional) – Unused in this function, but included to provide consistency with other compute functions.

  • **kwargs (dict, optional) – Additional function arguments.

Returns:

results – The result of the computation. This return value is provided so that testing functions can easily access the results.

Return type:

any