File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,16 @@ class Geometry:
3737 output by StagYY.
3838 """
3939
40- def __init__ (self , header : dict [str , Any ], step : Step ):
41- self ._header = header
40+ def __init__ (self , step : Step ):
4241 self ._step = step
4342
43+ @cached_property
44+ def _header (self ) -> Mapping [str , Any ]:
45+ hdr = self ._step .fields ._header
46+ if hdr is None :
47+ raise error .NoGeomError (self ._step )
48+ return hdr
49+
4450 def _scale_radius_mo (self , radius : NDArray ) -> NDArray :
4551 """Rescale radius for evolving MO runs."""
4652 if self ._step .sdat .par .get ("magma_oceans_in" , "evolving_magma_oceans" , False ):
@@ -382,9 +388,7 @@ def geom(self) -> Geometry:
382388 [`Geometry`][stagpy.step.Geometry] instance holding geometry information.
383389 It is issued from binary files holding field information.
384390 """
385- if self ._header is None :
386- raise error .NoGeomError (self .step )
387- return Geometry (self ._header , self .step )
391+ return Geometry (self .step )
388392
389393
390394@dataclass (frozen = True )
You can’t perform that action at this time.
0 commit comments