@@ -82,10 +82,24 @@ def __init__(
8282
8383 @property
8484 def global_origin (self ):
85+ """Get the global origin of the bounding box.
86+
87+ Returns
88+ -------
89+ np.ndarray
90+ The global origin coordinates
91+ """
8592 return self ._global_origin
8693
8794 @global_origin .setter
8895 def global_origin (self , global_origin ):
96+ """Set the global origin of the bounding box.
97+
98+ Parameters
99+ ----------
100+ global_origin : array_like
101+ The global origin coordinates
102+ """
89103 if self .dimensions != len (global_origin ):
90104 logger .warning (
91105 f"Global origin has { len (global_origin )} dimensions but bounding box has { self .dimensions } "
@@ -94,20 +108,53 @@ def global_origin(self, global_origin):
94108
95109 @property
96110 def global_maximum (self ):
111+ """Get the global maximum coordinates of the bounding box.
112+
113+ Returns
114+ -------
115+ np.ndarray
116+ The global maximum coordinates (local maximum + global origin)
117+ """
97118 return self .maximum + self .global_origin
98119
99120 @property
100121 def valid (self ):
122+ """Check if the bounding box has valid origin and maximum values.
123+
124+ Returns
125+ -------
126+ bool
127+ True if both origin and maximum are set, False otherwise
128+ """
101129 return self ._origin is not None and self ._maximum is not None
102130
103131 @property
104132 def origin (self ) -> np .ndarray :
133+ """Get the origin coordinates of the bounding box.
134+
135+ Returns
136+ -------
137+ np.ndarray
138+ Origin coordinates
139+
140+ Raises
141+ ------
142+ LoopValueError
143+ If the origin is not set
144+ """
105145 if self ._origin is None :
106146 raise LoopValueError ("Origin is not set" )
107147 return self ._origin
108148
109149 @origin .setter
110150 def origin (self , origin : np .ndarray ):
151+ """Set the origin coordinates of the bounding box.
152+
153+ Parameters
154+ ----------
155+ origin : np.ndarray
156+ Origin coordinates
157+ """
111158 if self .dimensions != len (origin ):
112159 logger .warning (
113160 f"Origin has { len (origin )} dimensions but bounding box has { self .dimensions } "
@@ -116,24 +163,64 @@ def origin(self, origin: np.ndarray):
116163
117164 @property
118165 def maximum (self ) -> np .ndarray :
166+ """Get the maximum coordinates of the bounding box.
167+
168+ Returns
169+ -------
170+ np.ndarray
171+ Maximum coordinates
172+
173+ Raises
174+ ------
175+ LoopValueError
176+ If the maximum is not set
177+ """
119178 if self ._maximum is None :
120179 raise LoopValueError ("Maximum is not set" )
121180 return self ._maximum
122181
123182 @maximum .setter
124183 def maximum (self , maximum : np .ndarray ):
184+ """Set the maximum coordinates of the bounding box.
185+
186+ Parameters
187+ ----------
188+ maximum : np.ndarray
189+ Maximum coordinates
190+ """
125191 self ._maximum = maximum
126192
127193 @property
128194 def nelements (self ):
195+ """Get the total number of elements in the bounding box.
196+
197+ Returns
198+ -------
199+ int
200+ Total number of elements (product of nsteps)
201+ """
129202 return self .nsteps .prod ()
130203
131204 @property
132205 def volume (self ):
206+ """Calculate the volume of the bounding box.
207+
208+ Returns
209+ -------
210+ float
211+ Volume of the bounding box
212+ """
133213 return np .prod (self .maximum - self .origin )
134214
135215 @property
136216 def bb (self ):
217+ """Get a numpy array containing origin and maximum coordinates.
218+
219+ Returns
220+ -------
221+ np.ndarray
222+ Array with shape (2, n_dimensions) containing [origin, maximum]
223+ """
137224 return np .array ([self .origin , self .maximum ])
138225
139226 @nelements .setter
0 commit comments