@@ -117,6 +117,14 @@ def __repr__(self) -> str:
117117 # TODO - hamiltonian, profiling files
118118 return repr
119119
120+ def __getattr__ (self , attr : str ) -> np .ndarray :
121+ """Synonymous with ``fit.stan_variable(attr)"""
122+ try :
123+ return self .stan_variable (attr )
124+ except ValueError as e :
125+ # pylint: disable=raise-missing-from
126+ raise AttributeError (* e .args )
127+
120128 @property
121129 def chains (self ) -> int :
122130 """Number of chains."""
@@ -647,6 +655,9 @@ def stan_variable(
647655 and the sample consists of 4 chains with 1000 post-warmup draws,
648656 this function will return a numpy.ndarray with shape (4000,3,3).
649657
658+ This functionaltiy is also available via a shortcut using ``.`` -
659+ writing ``fit.a`` is a synonym for ``fit.stan_variable("a")``
660+
650661 :param var: variable name
651662
652663 :param inc_warmup: When ``True`` and the warmup draws are present in
@@ -769,6 +780,14 @@ def __repr__(self) -> str:
769780 )
770781 return repr
771782
783+ def __getattr__ (self , attr : str ) -> np .ndarray :
784+ """Synonymous with ``fit.stan_variable(attr)"""
785+ try :
786+ return self .stan_variable (attr )
787+ except ValueError as e :
788+ # pylint: disable=raise-missing-from
789+ raise AttributeError (* e .args )
790+
772791 def _validate_csv_files (self ) -> Dict [str , Any ]:
773792 """
774793 Checks that Stan CSV output files for all chains are consistent
@@ -1160,6 +1179,9 @@ def stan_variable(
11601179 and the sample consists of 4 chains with 1000 post-warmup draws,
11611180 this function will return a numpy.ndarray with shape (4000,3,3).
11621181
1182+ This functionaltiy is also available via a shortcut using ``.`` -
1183+ writing ``fit.a`` is a synonym for ``fit.stan_variable("a")``
1184+
11631185 :param var: variable name
11641186
11651187 :param inc_warmup: When ``True`` and the warmup draws are present in
0 commit comments