:py:mod:`causal_testing.specification.variable` =============================================== .. py:module:: causal_testing.specification.variable .. autoapi-nested-parse:: This module contains the Variable abstract class, as well as its concrete extensions: Input, Output and Meta. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: causal_testing.specification.variable.Variable causal_testing.specification.variable.Input causal_testing.specification.variable.Output causal_testing.specification.variable.Meta Attributes ~~~~~~~~~~ .. autoapisummary:: causal_testing.specification.variable.T .. py:data:: T .. py:class:: Variable(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False) Bases: :py:obj:`abc.ABC` An abstract class representing causal variables. :param str name: The name of the variable. :param T datatype: The datatype of the variable. :param rv_generic distribution: The expected distribution of the variable values. :attr name: :attr datatype: :attr distribution: :attr hidden: .. py:attribute:: name :type: str .. py:attribute:: datatype :type: T .. py:attribute:: distribution :type: scipy.stats._distn_infrastructure.rv_generic .. py:method:: __repr__() Return repr(self). .. py:method:: typestring() -> str Return the type of the Variable, e.g. INPUT, or OUTPUT. Note that this is NOT the datatype (int, str, etc.). :return: A string representing the variable Type. :rtype: str .. py:method:: copy(name: str = None) -> Variable Return a new instance of the Variable with the given name, or with the original name if no name is supplied. :param str name: The variable name. :return: A new Variable instance. :rtype: Variable .. py:class:: Input(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False) Bases: :py:obj:`Variable` An extension of the Variable class representing inputs. .. py:class:: Output(name: str, datatype: T, distribution: scipy.stats._distn_infrastructure.rv_generic = None, hidden: bool = False) Bases: :py:obj:`Variable` An extension of the Variable class representing outputs. .. py:class:: Meta(name: str, datatype: T, populate: collections.abc.Callable[[pandas.DataFrame], pandas.DataFrame]) Bases: :py:obj:`Variable` An extension of the Variable class representing metavariables. These are variables which are relevant to the _causal_ structure and properties we may want to test, but are not directly related to the computational model either as inputs or outputs. :param str name: The name of the variable. :param T datatype: The datatype of the variable. :param Callable[[DataFrame], DataFrame] populate: Populate a given dataframe containing runtime data with the metavariable values as calculated from model inputs and ouputs. :attr populate: The populate function. .. py:attribute:: populate :type: collections.abc.Callable[[pandas.DataFrame], pandas.DataFrame]