
    %g<                     <    d Z ddlZddlmZmZ ddlZ G d d      Zy)z>Container for metadata parsed from the output of a CmdStan run    N)AnyDictc                       e Zd ZdZdeeef   ddfdZdefdZe	deeef   fd       Z
e	deeej                  f   fd       Ze	deeej                  f   fd	       Zy)
InferenceMetadataz
    CmdStan configuration and contents of output file parsed out of
    the Stan CSV file header comments and column headers.
    Assumes valid CSV files.
    configreturnNc                 F   || _         t        j                  |d         }|j                         D ci c]  \  }}|j	                  d      s|| c}}| _        |j                         D ci c]  \  }}|j	                  d      r|| c}}| _        yc c}}w c c}}w )z"Initialize object from CSV headers
raw_header__N)_cmdstan_configstanioparse_headeritemsendswith_method_vars
_stan_vars)selfr   varskvs        W/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/cmdstanpy/stanfit/metadata.py__init__zInferenceMetadata.__init__   s    %""6,#78  $zz|
aqzz$/?AqD
  $zz|
a1::d3CAqD


s   BB.BBc                 8    dj                  | j                        S )NzMetadata:
{}
)formatr   r   s    r   __repr__zInferenceMetadata.__repr__   s     ''(<(<==    c                 @    t        j                  | j                        S )z
        Returns a dictionary containing a set of name, value pairs
        parsed out of the Stan CSV file header.  These include the
        command configuration and the CSV file header row information.
        Uses deepcopy for immutability.
        )copydeepcopyr   r   s    r   cmdstan_configz InferenceMetadata.cmdstan_config   s     }}T1122r   c                     | j                   S )zH
        Method variable names always end in `__`, e.g. `lp__`.
        )r   r   s    r   method_varszInferenceMetadata.method_vars)   s    
    r   c                     | j                   S )zK
        These are the user-defined variables in the Stan program.
        )r   r   s    r   	stan_varszInferenceMetadata.stan_vars0   s    
 r   )__name__
__module____qualname____doc__r   strr   r   r   propertyr!   r   Variabler#   r%    r   r   r   r   	   s    

tCH~ 

$ 

># > 3S#X 3 3 !T#v"67 ! ! 4V__ 45  r   r   )r)   r   typingr   r   r   r   r-   r   r   <module>r/      s    D   , ,r   