Skip to content

Commit 72c7337

Browse files
Formatting
1 parent 30ccc10 commit 72c7337

12 files changed

+218
-218
lines changed

geos-mesh/src/geos/mesh/model/QualityMetricSummary.py

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,34 @@ def getIndex( self: Self ) -> int:
6060
"""Get stat index.
6161
6262
Returns:
63-
int: index
63+
int: Index
6464
"""
6565
return self.value[ 0 ]
6666

6767
def getString( self: Self ) -> str:
6868
"""Get stat name.
6969
7070
Returns:
71-
str: name
71+
str: Name
7272
"""
7373
return self.value[ 1 ]
7474

7575
def getType( self: Self ) -> object:
7676
"""Get stat type.
7777
7878
Returns:
79-
object: type
79+
object: Type
8080
"""
8181
return self.value[ 2 ]
8282

8383
def compute( self: Self, array: Iterable[ float ] ) -> int | float:
8484
"""Compute statistics using function.
8585
8686
Args:
87-
array (Iterable[float]): input array
87+
array (Iterable[float]): Input array
8888
8989
Returns:
90-
int | float: output stat
90+
int | float: Output stat
9191
"""
9292
return self.value[ 3 ]( array )
9393

@@ -96,10 +96,10 @@ def getNameFromIndex( index: int ) -> str:
9696
"""Get stat name from index.
9797
9898
Args:
99-
index (int): index
99+
index (int): Index
100100
101101
Returns:
102-
str: name
102+
str: Name
103103
"""
104104
return list( StatTypes )[ index ].getString()
105105

@@ -108,10 +108,10 @@ def getIndexFromName( name: str ) -> int:
108108
"""Get stat index from name.
109109
110110
Args:
111-
name (str): name
111+
name (str): Name
112112
113113
Returns:
114-
int: index
114+
int: Index
115115
"""
116116
for stat in list( StatTypes ):
117117
if stat.getString() == name:
@@ -123,10 +123,10 @@ def getTypeFromIndex( index: int ) -> object:
123123
"""Get stat type from index.
124124
125125
Args:
126-
index (int): index
126+
index (int): Index
127127
128128
Returns:
129-
object: type
129+
object: Type
130130
"""
131131
return list( StatTypes )[ index ].getType()
132132

@@ -184,15 +184,15 @@ def getCellTypeCountsObject( self: Self ) -> int:
184184
"""Get cell type counts.
185185
186186
Returns:
187-
int: number of cell
187+
int: Number of cell
188188
"""
189189
return self._counts
190190

191191
def getCellTypeCountsOfCellType( self: Self, cellType: int ) -> int:
192192
"""Get cell type counts.
193193
194194
Returns:
195-
int: number of cell
195+
int: Number of cell
196196
"""
197197
return self._counts.getTypeCount( cellType )
198198

@@ -204,8 +204,8 @@ def isCellStatsValidForMetricAndCellType(
204204
"""Returns True if input quality metric applies to input cell type.
205205
206206
Args:
207-
metricIndex (int): metric index
208-
cellType (int): cell type index
207+
metricIndex (int): Metric index
208+
cellType (int): Cell type index
209209
210210
Returns:
211211
bool: True if input quality metric applies
@@ -216,23 +216,23 @@ def getAllCellStats( self: Self ) -> pd.DataFrame:
216216
"""Get all cell stats including nan values.
217217
218218
Returns:
219-
pd.DataFrame: stats
219+
pd.DataFrame: Stats
220220
"""
221221
return self._cellStats
222222

223223
def getAllValidCellStats( self: Self ) -> pd.DataFrame:
224224
"""Get all valid cell stats.
225225
226226
Returns:
227-
pd.DataFrame: stats
227+
pd.DataFrame: Stats
228228
"""
229229
return self._cellStats.dropna( axis=1 )
230230

231231
def getAllValidOtherMetricStats( self: Self ) -> pd.DataFrame:
232232
"""Get all valid other metric stats.
233233
234234
Returns:
235-
pd.DataFrame: stats
235+
pd.DataFrame: Stats
236236
"""
237237
print( self._meshOtherStats.head() )
238238
return self._meshOtherStats.dropna( axis=1 )
@@ -246,12 +246,12 @@ def getCellStatValueFromStatMetricAndCellType(
246246
"""Get cell stat value for the given metric and cell types.
247247
248248
Args:
249-
metricIndex (int): metric index
250-
cellType (int): cell type index
251-
statType (StatTypes): stat number
249+
metricIndex (int): Metric index
250+
cellType (int): Cell type index
251+
statType (StatTypes): Stat number
252252
253253
Returns:
254-
float: stats value
254+
float: Stats value
255255
"""
256256
if ( metricIndex, cellType ) not in self._cellStats.columns:
257257
raise IndexError( f"Index ({metricIndex}, {cellType}) not in QualityMetricSummary stats" )
@@ -261,11 +261,11 @@ def getStatsFromMetricAndCellType( self: Self, metricIndex: int, cellType: int )
261261
"""Get stats for the given metric and cell types.
262262
263263
Args:
264-
metricIndex (int): metric index
265-
cellType (int): cell type index
264+
metricIndex (int): Metric index
265+
cellType (int): Cell type index
266266
267267
Returns:
268-
pd.Series: stats
268+
pd.Series: Stats
269269
"""
270270
if ( metricIndex, cellType ) not in self._cellStats.columns:
271271
raise IndexError( f"Index ({metricIndex}, {cellType}) not in QualityMetricSummary stats" )
@@ -278,10 +278,10 @@ def getStatsFromMetric(
278278
"""Get stats for the given metric index.
279279
280280
Args:
281-
metricIndex (int): metric index
281+
metricIndex (int): Metric index
282282
283283
Returns:
284-
pd.DataFrame: stats
284+
pd.DataFrame: Stats
285285
"""
286286
if metricIndex < QUALITY_METRIC_OTHER_START_INDEX:
287287
return self._cellStats.xs( metricIndex, level=self._LEVELS[ 0 ], axis=1 )
@@ -292,9 +292,9 @@ def setOtherStatValueFromMetric( self: Self, metricIndex: int, statType: StatTyp
292292
"""Set other stat value for the given metric.
293293
294294
Args:
295-
metricIndex (int): metric index
296-
statType (StatTypes): stat number
297-
value (int | float): value
295+
metricIndex (int): Metric index
296+
statType (StatTypes): Stat number
297+
value (int | float): Value
298298
"""
299299
if metricIndex not in self._meshOtherStats.columns:
300300
raise IndexError( f"Index {metricIndex} not in QualityMetricSummary meshOtherStats" )
@@ -307,10 +307,10 @@ def getCellStatsFromCellType(
307307
"""Get cell stats for the given cell type.
308308
309309
Args:
310-
cellType (int): cell type index
310+
cellType (int): Cell type index
311311
312312
Returns:
313-
pd.DataFrame: stats
313+
pd.DataFrame: Stats
314314
"""
315315
return self._cellStats.xs( cellType, level=self._LEVELS[ 1 ], axis=1 )
316316

@@ -319,10 +319,10 @@ def setCellStatValueFromStatMetricAndCellType( self: Self, metricIndex: int, cel
319319
"""Set cell stats for the given metric and cell types.
320320
321321
Args:
322-
metricIndex (int): metric index
323-
cellType (int): cell type index
324-
statType (StatTypes): stat number
325-
value (int | float): value
322+
metricIndex (int): Metric index
323+
cellType (int): Cell type index
324+
statType (StatTypes): Stat number
325+
value (int | float): Value
326326
"""
327327
if ( metricIndex, cellType ) not in self._cellStats.columns:
328328
raise IndexError( f"Index ({metricIndex}, {cellType}) not in QualityMetricSummary stats" )
@@ -332,7 +332,7 @@ def getComputedCellMetricIndexes( self: Self ) -> list[ Any ]:
332332
"""Get the list of index of computed cell quality metrics.
333333
334334
Returns:
335-
tuple[int]: list of metrics index
335+
tuple[int]: List of metrics index
336336
"""
337337
validCellStats: pd.DataFrame = self.getAllValidCellStats()
338338
columns: list[ int ] = validCellStats.columns.get_level_values( 0 ).to_list()
@@ -342,7 +342,7 @@ def getComputedOtherMetricIndexes( self: Self ) -> list[ Any ]:
342342
"""Get the list of index of computed other quality metrics.
343343
344344
Returns:
345-
tuple[int]: list of metrics index
345+
tuple[int]: List of metrics index
346346
"""
347347
validOtherStats: pd.DataFrame = self.getAllValidOtherMetricStats()
348348
columns: list[ int ] = [ validOtherStats.columns.to_list() ]
@@ -352,15 +352,15 @@ def getAllComputedMetricIndexes( self: Self ) -> list[ Any ]:
352352
"""Get the list of index of all computed metrics.
353353
354354
Returns:
355-
tuple[int]: list of metrics index
355+
tuple[int]: List of metrics index
356356
"""
357357
return self.getComputedCellMetricIndexes() + self.getComputedOtherMetricIndexes()
358358

359359
def plotSummaryFigure( self: Self ) -> Figure:
360360
"""Plot quality metric summary figure.
361361
362362
Returns:
363-
plt.figure: output Figure
363+
plt.figure: Output Figure
364364
"""
365365
computedCellMetrics: list[ int ] = self.getComputedCellMetricIndexes()
366366
computedOtherMetrics: list[ int ] = self.getComputedOtherMetricIndexes()
@@ -423,7 +423,7 @@ def _plotOtherMetricStats( self: Self, ax0: Axes ) -> None:
423423
424424
Args:
425425
ax0 (Axes): Axes object
426-
metricIndex (int): metric index
426+
metricIndex (int): Metric index
427427
"""
428428
# order of cell types in each axes
429429
computedMetrics: list[ int ] = self.getComputedOtherMetricIndexes()
@@ -470,7 +470,7 @@ def _plotCellMetricStats( self: Self, ax: Axes, metricIndex: int ) -> None:
470470
471471
Args:
472472
ax (Axes): Axes object
473-
metricIndex (int): metric index
473+
metricIndex (int): Metric index
474474
"""
475475
# get data to plot
476476
maxs: pd.Series = self._cellStats.loc[ StatTypes.MAX.getIndex(), metricIndex ]
@@ -515,16 +515,16 @@ def _plotRangePatch( self: Self, ax: Axes, metricIndex: int, cellType: int, ylim
515515
"""Plot quality metric ranges.
516516
517517
Args:
518-
ax (Axes): axes object
519-
metricIndex (int): metric index
520-
cellType (int): cell type index
521-
ylim0 (float): min y
522-
ylim1 (float): max y
523-
xtick (float): abscissa
524-
rangeRecWidth (float): patch width
518+
ax (Axes): Axes object
519+
metricIndex (int): Metric index
520+
cellType (int): Cell type index
521+
ylim0 (float): Min y
522+
ylim1 (float): Max y
523+
xtick (float): Abscissa
524+
rangeRecWidth (float): Patch width
525525
526526
Returns:
527-
tuple[float, float]: tuple containing miny and max y
527+
tuple[float, float]: Tuple containing min y and max y
528528
"""
529529
try:
530530
metric: MeshQualityMetricEnum = getQualityMetricFromIndex( metricIndex )
@@ -553,14 +553,14 @@ def _plotQualityRange( self: Self, ax: Axes, qualityRange: QualityRange, x: floa
553553
"""Plot quality range patches.
554554
555555
Args:
556-
ax (Axes): axes object
557-
qualityRange (QualityRange): quality ranges to plot
558-
x (float): origin abscissa of the patches
559-
ylim (tuple[float, float]): y limits for updates
560-
rangeRecWidth (float): patch width
556+
ax (Axes): Axes object
557+
qualityRange (QualityRange): Quality ranges to plot
558+
x (float): Origin abscissa of the patches
559+
ylim (tuple[float, float]): Y limits for updates
560+
rangeRecWidth (float): Patch width
561561
562562
Returns:
563-
tuple[float, float]: y limits for updates
563+
tuple[float, float]: Y limits for updates
564564
"""
565565
ylim0: float = ylim[ 0 ]
566566
ylim1: float = ylim[ 1 ]

0 commit comments

Comments
 (0)