MCPcopy
hub / github.com/vladmandic/sdnext / _count_steps_below

Function _count_steps_below

modules/processing_correction.py:205–211  ·  view source on GitHub ↗

Count scheduler timesteps below a threshold.

(pipe, threshold)

Source from the content-addressed store, hash-verified

203
204
205def _count_steps_below(pipe, threshold):
206 """Count scheduler timesteps below a threshold."""
207 timesteps = getattr(getattr(pipe, 'scheduler', None), 'timesteps', None)
208 if timesteps is None:
209 return 1
210 count = sum(1 for t in timesteps.tolist() if t < threshold)
211 return max(count, 1)
212
213
214def correction_callback(p, timestep, kwargs, pipe=None, initial: bool = False, step: int = 0):

Callers 1

correction_callbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected