1111
1212import pandas
1313
14- from . import __version__ , conf , phyvars , stagyydata
14+ from . import __version__ , phyvars , stagyydata
1515from ._helpers import baredoc
16- from .config import CONFIG_LOCAL
16+ from .config import CONFIG_LOCAL , Config
1717
1818if typing .TYPE_CHECKING :
1919 from typing import Callable , Iterable , Mapping , Optional , Sequence , Tuple , Union
@@ -29,6 +29,8 @@ def info_cmd() -> None:
2929 Other Parameters:
3030 conf.info
3131 """
32+ from . import conf
33+
3234 sdat = stagyydata .StagyyData (conf .core .path )
3335 lsnap = sdat .snaps [- 1 ]
3436 lstep = sdat .steps [- 1 ]
@@ -138,6 +140,8 @@ def var_cmd() -> None:
138140 See :mod:`stagpy.phyvars` where the lists of variables organized by command
139141 are defined.
140142 """
143+ from . import conf
144+
141145 print_all = not any (getattr (conf .var , fld .name ) for fld in fields (conf .var ))
142146 if print_all or conf .var .field :
143147 print ("field:" )
@@ -169,7 +173,7 @@ def version_cmd() -> None:
169173 print (f"stagpy version: { __version__ } " )
170174
171175
172- def config_pp (subs : Iterable [str ]) -> None :
176+ def config_pp (subs : Iterable [str ], conf : Config ) -> None :
173177 """Pretty print of configuration options.
174178
175179 Args:
@@ -199,7 +203,9 @@ def config_cmd() -> None:
199203 Other Parameters:
200204 conf.config
201205 """
206+ from . import conf
207+
202208 if conf .config .create :
203209 conf .default_ ().to_file_ (CONFIG_LOCAL )
204210 else :
205- config_pp (sec .name for sec in fields (conf ))
211+ config_pp (( sec .name for sec in fields (conf )), conf )
0 commit comments