schrodinger.stepper.core_steps module¶
Core steps that are generally useful in workflows.
These steps are generic and often are highly optimized using privileged method access to stepper framework internals. It is strongly recommended to not subclass these methods or to use the the implementations as an example of what methods are safe to override in your own steps.
- class schrodinger.stepper.core_steps.DeduplicationStep(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper.ReduceStep
A step that deduplicates its inputs.
- Input = <object object>¶
- Output = <object object>¶
- reduceFunction(inputs)¶
The main computation for this step. This function should take in a iterable of inputs and return an iterable of outputs.
Example:
def reduceFunction(self, words): # Find all unique words seen_words = set() for word in words: if word not in seen_words: seen_words.add(word) yield word
- class schrodinger.stepper.core_steps.RandomSampleFilter(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper.ReduceStep
A filter that takes a random subsample. The sample size can be set through the step’s settings
n
.Implementation of Algorithm R, but without knowing the size of sequence to sample from. See https://en.wikipedia.org/wiki/Reservoir_sampling
- Input = <object object>¶
- Output = <object object>¶
- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- n: int¶
A parameter of the class.
- seed: int¶
A parameter of the class.
- nChanged¶
A
pyqtSignal
emitted by instances of the class.
- nReplaced¶
A
pyqtSignal
emitted by instances of the class.
- seedChanged¶
A
pyqtSignal
emitted by instances of the class.
- seedReplaced¶
A
pyqtSignal
emitted by instances of the class.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsError
andSettingsWarning
to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.- Return type
list[TaskError or TaskWarning]
- reduceFunction(inps)¶
The main computation for this step. This function should take in a iterable of inputs and return an iterable of outputs.
Example:
def reduceFunction(self, words): # Find all unique words seen_words = set() for word in words: if word not in seen_words: seen_words.add(word) yield word
- class schrodinger.stepper.core_steps.DedupeAndRandomSampleFilter(*args, **kwargs)¶
Bases:
schrodinger.stepper.core_steps.DeduplicationStep
- Input = <object object>¶
- Output = <object object>¶
- class Settings(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- n: int¶
A parameter of the class.
- seed: int¶
A parameter of the class.
- nChanged¶
A
pyqtSignal
emitted by instances of the class.
- nReplaced¶
A
pyqtSignal
emitted by instances of the class.
- seedChanged¶
A
pyqtSignal
emitted by instances of the class.
- seedReplaced¶
A
pyqtSignal
emitted by instances of the class.
- __init__(*args, **kwargs)¶
See class docstring for info on the different constructor arguments.
- validateSettings()¶
Check whether the step settings are valid and return a list of
SettingsError
andSettingsWarning
to report any invalid settings. Default implementation checks that all stepper files are set to valid file paths.- Return type
list[TaskError or TaskWarning]
- reduceFunction(inps)¶
The main computation for this step. This function should take in a iterable of inputs and return an iterable of outputs.
Example:
def reduceFunction(self, words): # Find all unique words seen_words = set() for word in words: if word not in seen_words: seen_words.add(word) yield word