Skip to content

Commit 81193ca

Browse files
committed
Geometry._ntot replaces _shape["ntot"]
1 parent ca5b919 commit 81193ca

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/stagpy/step.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def __init__(self, header: dict[str, Any], step: Step):
4444
"sph": False,
4545
"cyl": False,
4646
"axi": False,
47-
"ntot": list(header["nts"]) + [header["ntb"]],
4847
}
4948
self._init_shape()
5049

@@ -58,25 +57,29 @@ def _scale_radius_mo(self, radius: NDArray) -> NDArray:
5857
def aspect_ratio(self) -> tuple[float, float]:
5958
return self._step.sdat.par.nml["geometry"]["aspect_ratio"]
6059

60+
@cached_property
61+
def _ntot(self) -> tuple[int, int, int, int]:
62+
return (*self._header["nts"], self._header["ntb"])
63+
6164
@cached_property
6265
def nttot(self) -> int:
6366
"""Number of grid point along the x/theta direction."""
64-
return self._shape["ntot"][0]
67+
return self._ntot[0]
6568

6669
@cached_property
6770
def nptot(self) -> int:
6871
"""Number of grid point along the y/phi direction."""
69-
return self._shape["ntot"][1]
72+
return self._ntot[1]
7073

7174
@cached_property
7275
def nrtot(self) -> int:
7376
"""Number of grid point along the z/r direction."""
74-
return self._shape["ntot"][2]
77+
return self._ntot[2]
7578

7679
@cached_property
7780
def nbtot(self) -> int:
7881
"""Number of blocks."""
79-
return self._shape["ntot"][3]
82+
return self._ntot[3]
8083

8184
@property
8285
def nxtot(self) -> int:

0 commit comments

Comments
 (0)