simplex-solver 3.2.2__cp39-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. simplex_solver-3.2.2.dist-info/DELVEWHEEL +2 -0
  2. simplex_solver-3.2.2.dist-info/METADATA +94 -0
  3. simplex_solver-3.2.2.dist-info/RECORD +84 -0
  4. simplex_solver-3.2.2.dist-info/WHEEL +5 -0
  5. simplex_solver.libs/.load-order-simplex_solver-3.2.2 +1 -0
  6. simplex_solver.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
  7. simplexui/__init__.py +86 -0
  8. simplexui/_version.py +1 -0
  9. simplexui/channelBox.py +867 -0
  10. simplexui/comboCheckDialog.py +396 -0
  11. simplexui/commands/__init__.py +16 -0
  12. simplexui/commands/alembicCommon.py +1148 -0
  13. simplexui/commands/alembic_walker.py +299 -0
  14. simplexui/commands/applyCorrectives.py +452 -0
  15. simplexui/commands/correctiveInterface.py +259 -0
  16. simplexui/commands/expandedExport.py +434 -0
  17. simplexui/commands/hdf5Convert.py +62 -0
  18. simplexui/commands/mayaCorrectiveInterface.py +159 -0
  19. simplexui/commands/mayatonumpy.py +416 -0
  20. simplexui/commands/mesh.py +1085 -0
  21. simplexui/commands/poseblendlib.py +168 -0
  22. simplexui/commands/reorderSimplexPoints.py +102 -0
  23. simplexui/commands/replaceDefinitionJson.py +74 -0
  24. simplexui/commands/rigidAlign.py +97 -0
  25. simplexui/commands/unsubdivide.py +1222 -0
  26. simplexui/commands/uvTransfer.py +976 -0
  27. simplexui/dragFilter.py +334 -0
  28. simplexui/falloffDialog.py +504 -0
  29. simplexui/img/ChefHead.png +0 -0
  30. simplexui/img/frozen.png +0 -0
  31. simplexui/interface/__init__.py +30 -0
  32. simplexui/interface/dummyInterface.py +1313 -0
  33. simplexui/interface/mayaInterface.py +2294 -0
  34. simplexui/interfaceModel.py +655 -0
  35. simplexui/interfaceModelTrees.py +456 -0
  36. simplexui/items/__init__.py +50 -0
  37. simplexui/items/accessor.py +145 -0
  38. simplexui/items/combo.py +645 -0
  39. simplexui/items/dragItem.py +44 -0
  40. simplexui/items/falloff.py +748 -0
  41. simplexui/items/group.py +267 -0
  42. simplexui/items/progression.py +613 -0
  43. simplexui/items/shape.py +384 -0
  44. simplexui/items/simplex.py +1734 -0
  45. simplexui/items/slider.py +632 -0
  46. simplexui/items/stack.py +147 -0
  47. simplexui/items/traversal.py +780 -0
  48. simplexui/items/treeItem.py +441 -0
  49. simplexui/main.pyw +22 -0
  50. simplexui/menu/__init__.py +73 -0
  51. simplexui/menu/dummyPlugins/__init__.py +16 -0
  52. simplexui/menu/genericPlugins/__init__.py +16 -0
  53. simplexui/menu/genericPlugins/_builtins.py +270 -0
  54. simplexui/menu/genericPlugins/checkPossibleCombos.py +48 -0
  55. simplexui/menu/genericPlugins/exportSplit.py +67 -0
  56. simplexui/menu/genericPlugins/showFalloffs.py +26 -0
  57. simplexui/menu/genericPlugins/showTraversals.py +26 -0
  58. simplexui/menu/genericPlugins/simplexUvTransfer.py +106 -0
  59. simplexui/menu/genericPlugins/unsubdivide.py +72 -0
  60. simplexui/menu/mayaPlugins/__init__.py +16 -0
  61. simplexui/menu/mayaPlugins/exportOther.py +53 -0
  62. simplexui/menu/mayaPlugins/extractProgressives.py +68 -0
  63. simplexui/menu/mayaPlugins/freezeCombo.py +247 -0
  64. simplexui/menu/mayaPlugins/generateShapeIncrementals.py +99 -0
  65. simplexui/menu/mayaPlugins/importObjs.py +199 -0
  66. simplexui/menu/mayaPlugins/linearizeTraversal.py +60 -0
  67. simplexui/menu/mayaPlugins/makeShelfBtn.py +67 -0
  68. simplexui/menu/mayaPlugins/relaxToSelection.py +76 -0
  69. simplexui/menu/mayaPlugins/reloadDefinition.py +44 -0
  70. simplexui/menu/mayaPlugins/snapToNeutral.py +71 -0
  71. simplexui/menu/mayaPlugins/softSelectToCluster.py +201 -0
  72. simplexui/menu/mayaPlugins/tweakMix.py +136 -0
  73. simplexui/menu/mayaPlugins/updateRestShape.py +113 -0
  74. simplexui/pysimplex.lib +0 -0
  75. simplexui/pysimplex.pyd +0 -0
  76. simplexui/simplexDialog.py +1547 -0
  77. simplexui/travCheckDialog.py +419 -0
  78. simplexui/traversalDialog.py +299 -0
  79. simplexui/ui/comboCheckDialog.ui +475 -0
  80. simplexui/ui/falloffDialog.ui +243 -0
  81. simplexui/ui/simplexDialog.ui +1458 -0
  82. simplexui/ui/travCheckDialog.ui +488 -0
  83. simplexui/ui/traversalDialog.ui +532 -0
  84. simplexui/utils.py +307 -0
@@ -0,0 +1,613 @@
1
+ # Copyright 2016, Blur Studio
2
+ #
3
+ # This file is part of Simplex.
4
+ #
5
+ # Simplex is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU Lesser General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # Simplex is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public License
16
+ # along with Simplex. If not, see <http://www.gnu.org/licenses/>.
17
+ from __future__ import annotations
18
+
19
+ from typing import TYPE_CHECKING, Any
20
+
21
+ from ..utils import getNextName
22
+ from .accessor import SimplexTreeAccessor
23
+ from .dragItem import Draggable
24
+ from .stack import stackable
25
+ from .treeItem import TreeItem
26
+
27
+ if TYPE_CHECKING:
28
+ from .combo import Combo
29
+ from .falloff import Falloff
30
+ from .shape import Shape
31
+ from .simplex import Simplex
32
+ from .slider import Slider
33
+ from .traversal import Traversal
34
+
35
+
36
+ class ProgPair(SimplexTreeAccessor, Draggable):
37
+ classDepth: int = 9
38
+
39
+ def __init__(self, simplex: Simplex, shape: Shape, value: float) -> None:
40
+ super().__init__(simplex)
41
+ self.shape: Shape = shape
42
+ self._value: float = value
43
+ self.prog: Progression | None = None
44
+ self.minValue: float = -1.0
45
+ self.maxValue: float = 1.0
46
+ if not shape.isRest and self not in self.shape.progPairs:
47
+ self.shape.progPairs.append(self)
48
+
49
+ @property
50
+ def name(self) -> str:
51
+ return self.shape.name
52
+
53
+ @name.setter
54
+ def name(self, value: str) -> None:
55
+ self.shape.name = value
56
+
57
+ def buildDefinition(
58
+ self, simpDict: dict[str, Any], legacy: bool
59
+ ) -> tuple[int, float]:
60
+ idx = self.shape.buildDefinition(simpDict, legacy)
61
+ return idx, self.value
62
+
63
+ def __lt__(self, other: Any) -> bool:
64
+ return self.value < other.value
65
+
66
+ @property
67
+ def value(self) -> float:
68
+ return self._value
69
+
70
+ @value.setter
71
+ @stackable
72
+ def value(self, val: float) -> None:
73
+ from .slider import Slider
74
+
75
+ self._value = val
76
+ if self.prog is None:
77
+ raise ValueError(
78
+ "Can't set the value of a progPair that doesn't have a controller"
79
+ )
80
+
81
+ if isinstance(self.prog.controller, Slider):
82
+ self.prog.controller.setRange()
83
+
84
+ @stackable
85
+ def delete(self) -> None:
86
+ if self.prog is None:
87
+ return
88
+ with self.removeItemManager(self):
89
+ ppairs = self.prog.pairs
90
+ ridx = ppairs.index(self)
91
+ pp = ppairs.pop(ridx)
92
+ if not pp.shape.isRest:
93
+ pp.shape.progPairs.remove(pp)
94
+ if not pp.shape.progPairs:
95
+ self.simplex.shapes.remove(pp.shape)
96
+ self.DCC.deleteShape(pp.shape)
97
+
98
+ def treeRow(self) -> int:
99
+ if self.prog is None:
100
+ return 0
101
+ return self.prog.pairs.index(self)
102
+
103
+ def treeParent(self) -> TreeItem | None:
104
+ from .slider import Slider
105
+
106
+ if self.prog is None:
107
+ return None
108
+
109
+ par = self.prog
110
+ if isinstance(par.controller, Slider):
111
+ par = par.controller
112
+ return par
113
+
114
+ def treeData(self, column) -> Any | None:
115
+ if column == 0:
116
+ return self.name
117
+ if column == 2:
118
+ return self.value
119
+ return None
120
+
121
+
122
+ class Progression(SimplexTreeAccessor):
123
+ """A set of shapes to interpolate between
124
+
125
+ A Progression is a collection of shape/value pairs, and an interpolation type.
126
+ Progressions don't exist on their own, they are always part of a higher-level object
127
+ like a Combo, Slider, or Traversal. The ProgPairs are always sorted by value
128
+
129
+ Progressions should always have a shape at 0 (which is almost always the rest shape)
130
+ and a shape at either -1 or 1.
131
+ They can also have other shapes at any value between 0 and the extremes.
132
+
133
+ Sliders give users direct control over the value that is passed to the progression.
134
+ Combos and Traversals use input values to control their progressions.
135
+
136
+ Progressions can use different interpolations.
137
+ The simplest is 'linear', which blends in a straight line between shapes.
138
+ The 'spline' interp uses Catmull-Rom spline values.
139
+ The 'splitspline' builds separate Catmull-Rom splines for positive and negative values
140
+
141
+ Parameters
142
+ ----------
143
+ name : str
144
+ The name for the Progression. Usually just copies the name of its controller
145
+ simplex : Simplex
146
+ The Simplex system
147
+ pairs : [ProgPair
148
+ The ProgPairs that will make up this Progression.
149
+ If None, the a default Rest at 0.0 pair will be created.
150
+ interp : str
151
+ The interpolation for this Progression. Defaults to 'spline'
152
+ falloffs : [Falloff
153
+ A list of Fallofs to apply to the progression
154
+ Defaults to None
155
+ """
156
+
157
+ classDepth: int = 8
158
+ interpTypes: tuple[tuple[str, str], ...] = (
159
+ ("Linear", "linear"),
160
+ ("Spline", "spline"),
161
+ ("Split Spline", "splitspline"),
162
+ )
163
+
164
+ def __init__(
165
+ self,
166
+ name: str,
167
+ simplex: Simplex,
168
+ pairs: list[ProgPair] | None = None,
169
+ interp: str = "spline",
170
+ falloffs: list[Falloff] | None = None,
171
+ ) -> None:
172
+ super().__init__(simplex)
173
+
174
+ if self.simplex.restShape is None:
175
+ raise RuntimeError("Simplex is not initialized with a rest shape")
176
+
177
+ with self.stack.store(self):
178
+ self._name: str = name
179
+ self._interp: str = interp
180
+ self.falloffs: list[Falloff] = falloffs or []
181
+ self.controller: Slider | Combo | Traversal | None = None
182
+
183
+ self.pairs: list[ProgPair]
184
+ if pairs is None:
185
+ self.pairs = [ProgPair(self.simplex, self.simplex.restShape, 0.0)]
186
+ else:
187
+ self.pairs = pairs
188
+
189
+ for pair in self.pairs:
190
+ pair.prog = self
191
+
192
+ for falloff in self.falloffs:
193
+ falloff.children.append(self)
194
+ self._buildIdx: int | None = None
195
+
196
+ @property
197
+ def name(self) -> str:
198
+ return self._name
199
+
200
+ @name.setter
201
+ def name(self, value: str) -> None:
202
+ self._name = value
203
+
204
+ @property
205
+ def interp(self) -> str:
206
+ """Get the interp for this Progression"""
207
+ return self._interp
208
+
209
+ @interp.setter
210
+ @stackable
211
+ def interp(self, value: str) -> None:
212
+ """Set the interp for this Progression"""
213
+ self._interp = value
214
+
215
+ def getShapeIndex(self, shape: Shape) -> int:
216
+ """Get the index of the given shape in this progression
217
+
218
+ Parameters
219
+ ----------
220
+ shape : Shape
221
+ The shape to get the index of
222
+
223
+ Returns
224
+ -------
225
+ : int
226
+ The index of the ProgPair that contains the given shape
227
+ """
228
+ for i, p in enumerate(self.pairs):
229
+ if p.shape == shape:
230
+ return i
231
+ raise ValueError(f"Provided shape:{shape.name} is not in the list")
232
+
233
+ def getShapes(self) -> list[Shape]:
234
+ """Return the Shapes in this Progression
235
+
236
+ Returns
237
+ -------
238
+ : type
239
+ ([Shape, ....]): The shapes in the Progression
240
+ """
241
+ return [i.shape for i in self.pairs]
242
+
243
+ def getValues(self) -> list[float]:
244
+ """Return the values in this Progression
245
+
246
+ Returns
247
+ -------
248
+ : type
249
+ ([float, ....]): The values in the Progression
250
+ """
251
+ return [i.value for i in self.pairs]
252
+
253
+ def getInsertIndex(self, tVal: float) -> int:
254
+ """Get the index to insert a pair with value tVal
255
+
256
+ Parameters
257
+ ----------
258
+ tVal : float
259
+ The value to get the insertion index for
260
+
261
+ Returns
262
+ -------
263
+ : int
264
+ The insertion index
265
+ """
266
+ values = self.getValues()
267
+ if not values:
268
+ return 0
269
+ elif tVal <= values[0]:
270
+ return 0
271
+ elif tVal >= values[-1]:
272
+ return len(self.pairs)
273
+ else:
274
+ for i in range(1, len(values)):
275
+ if values[i - 1] <= tVal < values[i]:
276
+ return i
277
+ return 0
278
+
279
+ def getShapeAtValue(self, val: float, tol: float = 0.0001) -> Shape | None:
280
+ """Return the shape at the given value
281
+
282
+ Parameters
283
+ ----------
284
+ val :
285
+ float
286
+ tol :
287
+ float (Default value = 0.0001)
288
+
289
+ Returns
290
+ -------
291
+ : type
292
+ (Shape or None): The shape found with the given value, or None if nothing was found
293
+ """
294
+ for pp in self.pairs:
295
+ if abs(pp.value - val) < tol:
296
+ return pp.shape
297
+ return None
298
+
299
+ @classmethod
300
+ def loadV2(cls, simplex: Simplex, data: dict[str, Any]) -> Progression:
301
+ """Load the data from a version2 formatted json dictionary
302
+
303
+ Parameters
304
+ ----------
305
+ simplex : Simplex
306
+ The Simplex system that's being built
307
+ data : dict
308
+ The chunk of the json dict used to build this object
309
+
310
+ Returns
311
+ -------
312
+ : Progression
313
+ The specified Progression
314
+ """
315
+ name = data["name"]
316
+ pairs = data["pairs"]
317
+ interp = data.get("interp", "spline")
318
+ foIdxs = data.get("falloffs", [])
319
+ pairs = [ProgPair(simplex, simplex.shapes[s], v) for s, v in pairs]
320
+ fos = [simplex.falloffs[i] for i in foIdxs]
321
+ return cls(name, simplex, pairs=pairs, interp=interp, falloffs=fos)
322
+
323
+ def buildDefinition(self, simpDict: dict[str, Any], legacy: bool) -> int:
324
+ """Output a dictionary definition of this object
325
+
326
+ Parameters
327
+ ----------
328
+ simpDict : dict
329
+ The dictionary that is being built
330
+ legacy : bool
331
+ Whether to write out the legacy definition, or the newer one
332
+ """
333
+ if self._buildIdx is None:
334
+ idxPairs = [pair.buildDefinition(simpDict, legacy) for pair in self.pairs]
335
+ idxPairs.sort(key=lambda x: x[1])
336
+ idxs, values = list(zip(*idxPairs))
337
+ foIdxs = [f.buildDefinition(simpDict, legacy) for f in self.falloffs]
338
+ self._buildIdx = len(simpDict["progressions"])
339
+ if legacy:
340
+ x = [self.name, idxs, values, self.interp, foIdxs]
341
+ simpDict.setdefault("progressions", []).append(x)
342
+ else:
343
+ x = {
344
+ "name": self.name,
345
+ "pairs": idxPairs,
346
+ "interp": self.interp,
347
+ "falloffs": foIdxs,
348
+ }
349
+ simpDict.setdefault("progressions", []).append(x)
350
+ return self._buildIdx
351
+
352
+ def clearBuildIndex(self) -> None:
353
+ """Clear the build index of this object
354
+
355
+ The buildIndex is stored when building a definition dictionary
356
+ that keeps track of its index for later referencin
357
+ """
358
+ self._buildIdx = None
359
+ for pair in self.pairs:
360
+ pair.shape.clearBuildIndex()
361
+ for fo in self.falloffs:
362
+ fo.clearBuildIndex()
363
+
364
+ @stackable
365
+ def moveShapeToProgression(self, shapePair: ProgPair) -> None:
366
+ """Remove the shapePair from its current progression and set it in a new progression
367
+
368
+ Parameters
369
+ ----------
370
+ shapePair : progPair
371
+ The ProgPair to take
372
+ """
373
+ oldProg = shapePair.prog
374
+ if oldProg is not None:
375
+ oldProg.pairs.remove(shapePair)
376
+ self.pairs.append(shapePair)
377
+ shapePair.prog = self
378
+
379
+ @stackable
380
+ def setShapesValues(self, values: list[float]) -> None:
381
+ """Set all the Shape's values
382
+
383
+ Parameters
384
+ ----------
385
+ values : [float
386
+ The values to set
387
+ """
388
+ from .slider import Slider
389
+
390
+ for pp, val in zip(self.pairs, values):
391
+ pp.value = val
392
+
393
+ if isinstance(self.controller, Slider):
394
+ self.controller.updateRange()
395
+
396
+ def siblingRename(
397
+ self, shape: Shape, newName: str, currentLinks: dict
398
+ ) -> dict[type, dict[str, tuple[SimplexTreeAccessor, int]]]:
399
+ # This is part of the in-progress linked naming system
400
+ # get name change
401
+ return {}
402
+
403
+ @stackable
404
+ def addFalloff(self, falloff: Falloff) -> None:
405
+ """Add a falloff to a slider's falloff list
406
+
407
+ Parameters
408
+ ----------
409
+ falloff : Falloff
410
+ The falloff to add
411
+ """
412
+ if falloff not in self.falloffs:
413
+ self.falloffs.append(falloff)
414
+ falloff.children.append(self)
415
+ self.DCC.addProgFalloff(self, falloff)
416
+
417
+ @stackable
418
+ def removeFalloff(self, falloff: Falloff) -> None:
419
+ """Remove a falloff from a slider's falloff list
420
+
421
+ Parameters
422
+ ----------
423
+ falloff : Falloff
424
+ The falloff to remove
425
+ """
426
+ if falloff in self.falloffs:
427
+ self.falloffs.remove(falloff)
428
+ falloff.children.remove(self)
429
+ self.DCC.removeProgFalloff(self, falloff)
430
+
431
+ @stackable
432
+ def createShape(
433
+ self, shapeName: str | None = None, tVal: float | None = None
434
+ ) -> ProgPair:
435
+ """Create a shape and add it to a progression
436
+
437
+ Parameters
438
+ ----------
439
+ shapeName : str or None
440
+ The name to give the shape
441
+ If None, give it a default value
442
+ tVal : float or None
443
+ The value to give the new ProgPair
444
+ if None, give it a "smart" default
445
+
446
+ Returns
447
+ -------
448
+ : ProgPair
449
+ The newly created ProgPair
450
+ """
451
+ from .slider import Slider
452
+
453
+ pp, idx = self.newProgPair(shapeName, tVal)
454
+ with self.insertItemManager(self, row=idx):
455
+ pp.prog = self
456
+ self.pairs.insert(idx, pp)
457
+
458
+ if isinstance(self.controller, Slider):
459
+ self.controller.updateRange()
460
+
461
+ return pp
462
+
463
+ def newProgPair(
464
+ self, shapeName: str | None = None, tVal: float | None = None
465
+ ) -> tuple[ProgPair, int]:
466
+ """Create a shape and DO NOT add it to a progression
467
+
468
+ Parameters
469
+ ----------
470
+ shapeName : str or None
471
+ The name to give the shape
472
+ If None, give it a default value
473
+ tVal : float or None
474
+ The value to give the new ProgPair
475
+ if None, give it a "smart" default
476
+
477
+ Returns
478
+ -------
479
+ : ProgPair
480
+ The newly created ProgPair
481
+ : int
482
+ The insertion index for this ProgPair into this Progression
483
+ """
484
+ from .shape import Shape
485
+
486
+ if tVal is None:
487
+ tVal = self.guessNextTVal()
488
+
489
+ if shapeName is None:
490
+ if self.controller is not None:
491
+ if abs(tVal) == 1.0:
492
+ shapeName = self.controller.name
493
+ else:
494
+ neg = "n" if tVal < 0.0 else ""
495
+ shapeName = f"{self.controller.name}_{neg}{int(abs(tVal) * 100)}"
496
+
497
+ currentNames = [i.name for i in self.simplex.shapes]
498
+ shapeName = getNextName(shapeName, currentNames)
499
+
500
+ idx = self.getInsertIndex(tVal)
501
+ shape = Shape(shapeName, self.simplex)
502
+ pp = ProgPair(self.simplex, shape, tVal)
503
+ return pp, idx
504
+
505
+ def guessNextTVal(self) -> float:
506
+ """Given the current progression values, make an educated guess what's next.
507
+
508
+ Returns
509
+ -------
510
+ : float
511
+ The "smart" guess for the next tVal
512
+ """
513
+ # The question remains if negative or
514
+ # intermediate values are more important
515
+ # I think intermediate
516
+ vals = [i.value for i in self.pairs]
517
+ mnv = min(vals)
518
+ mxv = max(vals)
519
+ if mnv == 0.0 and mxv == 1.0:
520
+ for c in [0.5, 0.25, 0.75, -1.0]:
521
+ if c not in vals:
522
+ return c
523
+ if mnv == -1.0 and mxv == 1.0:
524
+ for c in [0.5, -0.5, 0.25, -0.25, 0.75, -0.75]:
525
+ if c not in vals:
526
+ return c
527
+ return 1.0
528
+
529
+ @stackable
530
+ def deleteShape(self, shape: Shape) -> None:
531
+ """Delete a shape from the system and the DCC
532
+
533
+ Parameters
534
+ ----------
535
+ shape : Shape
536
+ The shape to delete
537
+ """
538
+ ridx = None
539
+ for i, pp in enumerate(self.pairs):
540
+ if pp.shape == shape:
541
+ ridx = i
542
+ if ridx is None:
543
+ raise RuntimeError("Shape does not exist to remove")
544
+
545
+ pp = self.pairs[ridx]
546
+ with self.removeItemManager(pp):
547
+ self.pairs.pop(ridx)
548
+ if not shape.isRest:
549
+ self.simplex.shapes.remove(shape)
550
+ self.DCC.deleteShape(shape)
551
+
552
+ @stackable
553
+ def delete(self) -> None:
554
+ """Delete the Progression and all its Shapes"""
555
+ with self.removeItemManager(self):
556
+ for pp in self.pairs[:]:
557
+ if pp.shape.isRest:
558
+ continue
559
+ self.simplex.shapes.remove(pp.shape)
560
+ self.DCC.deleteShape(pp.shape)
561
+
562
+ def getRange(self) -> tuple[float, float]:
563
+ """Get the range for this Progression
564
+ Returns
565
+ -------
566
+ : float
567
+ The minimum value
568
+ : float
569
+ The maximum value
570
+ """
571
+ vals = [i.value for i in self.pairs]
572
+ return min(vals), max(vals)
573
+
574
+ def getExtremePairs(self) -> list[ProgPair]:
575
+ """Get the ProgPairs where the value is -1 or 1
576
+
577
+ Returns
578
+ -------
579
+ : [ProgPair, ...]
580
+ ProgPairs whose values are -1 or 1
581
+ """
582
+ ret = []
583
+ for pp in self.pairs:
584
+ if abs(pp.value) != 1.0:
585
+ continue
586
+ ret.append(pp)
587
+ return ret
588
+
589
+ def treeChild(self, row: int) -> TreeItem:
590
+ return self.pairs[row]
591
+
592
+ def treeRow(self) -> int:
593
+ from .combo import Combo
594
+ from .traversal import Traversal
595
+
596
+ if isinstance(self.controller, Traversal):
597
+ # Show the progression after the mult and prog
598
+ return 2
599
+ elif isinstance(self.controller, Combo):
600
+ # Show the progression after the comboPairs
601
+ return len(self.controller.pairs)
602
+ return 0
603
+
604
+ def treeParent(self) -> TreeItem | None:
605
+ return self.controller
606
+
607
+ def treeChildCount(self) -> int:
608
+ return len(self.pairs)
609
+
610
+ def treeData(self, column: int) -> Any | None:
611
+ if column == 0:
612
+ return "SHAPES"
613
+ return None