@@ -102,10 +102,24 @@ def __init__(
102102
103103 @property
104104 def global_origin (self ):
105+ """Get the global origin of the bounding box.
106+
107+ Returns
108+ -------
109+ np.ndarray
110+ The global origin coordinates
111+ """
105112 return self ._global_origin
106113
107114 @global_origin .setter
108115 def global_origin (self , global_origin ):
116+ """Set the global origin of the bounding box.
117+
118+ Parameters
119+ ----------
120+ global_origin : array_like
121+ The global origin coordinates
122+ """
109123 if self .dimensions != len (global_origin ):
110124 logger .warning (
111125 f"Global origin has { len (global_origin )} dimensions but bounding box has { self .dimensions } "
@@ -114,20 +128,53 @@ def global_origin(self, global_origin):
114128
115129 @property
116130 def global_maximum (self ):
131+ """Get the global maximum coordinates of the bounding box.
132+
133+ Returns
134+ -------
135+ np.ndarray
136+ The global maximum coordinates (local maximum + global origin)
137+ """
117138 return self .maximum + self .global_origin
118139
119140 @property
120141 def valid (self ):
142+ """Check if the bounding box has valid origin and maximum values.
143+
144+ Returns
145+ -------
146+ bool
147+ True if both origin and maximum are set, False otherwise
148+ """
121149 return self ._origin is not None and self ._maximum is not None
122150
123151 @property
124152 def origin (self ) -> np .ndarray :
153+ """Get the origin coordinates of the bounding box.
154+
155+ Returns
156+ -------
157+ np.ndarray
158+ Origin coordinates
159+
160+ Raises
161+ ------
162+ LoopValueError
163+ If the origin is not set
164+ """
125165 if self ._origin is None :
126166 raise LoopValueError ("Origin is not set" )
127167 return self ._origin
128168
129169 @origin .setter
130170 def origin (self , origin : np .ndarray ):
171+ """Set the origin coordinates of the bounding box.
172+
173+ Parameters
174+ ----------
175+ origin : np.ndarray
176+ Origin coordinates
177+ """
131178 if self .dimensions != len (origin ):
132179 logger .warning (
133180 f"Origin has { len (origin )} dimensions but bounding box has { self .dimensions } "
@@ -136,24 +183,64 @@ def origin(self, origin: np.ndarray):
136183
137184 @property
138185 def maximum (self ) -> np .ndarray :
186+ """Get the maximum coordinates of the bounding box.
187+
188+ Returns
189+ -------
190+ np.ndarray
191+ Maximum coordinates
192+
193+ Raises
194+ ------
195+ LoopValueError
196+ If the maximum is not set
197+ """
139198 if self ._maximum is None :
140199 raise LoopValueError ("Maximum is not set" )
141200 return self ._maximum
142201
143202 @maximum .setter
144203 def maximum (self , maximum : np .ndarray ):
204+ """Set the maximum coordinates of the bounding box.
205+
206+ Parameters
207+ ----------
208+ maximum : np.ndarray
209+ Maximum coordinates
210+ """
145211 self ._maximum = maximum
146212
147213 @property
148214 def nelements (self ):
215+ """Get the total number of elements in the bounding box.
216+
217+ Returns
218+ -------
219+ int
220+ Total number of elements (product of nsteps)
221+ """
149222 return self .nsteps .prod ()
150223
151224 @property
152225 def volume (self ):
226+ """Calculate the volume of the bounding box.
227+
228+ Returns
229+ -------
230+ float
231+ Volume of the bounding box
232+ """
153233 return np .prod (self .maximum - self .origin )
154234
155235 @property
156236 def bb (self ):
237+ """Get a numpy array containing origin and maximum coordinates.
238+
239+ Returns
240+ -------
241+ np.ndarray
242+ Array with shape (2, n_dimensions) containing [origin, maximum]
243+ """
157244 return np .array ([self .origin , self .maximum ])
158245
159246
0 commit comments