schrodinger.stepper.stepper module¶
Framework for writing computational workflows and running them in a highly
distributed manner. Each step of the workflow is either a “mapping” operation
(see MapStep
) or “reducing” operation (see ReduceStep). These steps can then
be chained together using the `Chain
class.
For a more complete introduction, see WordCount tutorial:
For documentation on specific stepper features, see the following feature list. You can ctrl+f the feature tag to jump to the relevant docstrings.
Feature |
Tag |
---|---|
MapStep |
_map_step_ |
ReduceStep |
_reduce_step_ |
Chain |
_chain_ |
Settings |
_settings_ |
Serialization |
_serialization_ |
File Handling |
_file_handling_ |
Generic Steps |
_generics_ |
Custom Workflow |
_custom_workflows_ |
Double Batching |
_dbl_batching_ |
#=============================================================================== # Running stepper with custom, undistributed workflows <_custom_workflows_> #=============================================================================== To run steps that aren’t defined in the core suite: The script should be executed inside the working directory and import steps from a local package in the working directory.
Working dir contents:
script.py
my_lib/
__init__.py
steps.py
Minimal code in script.py if it needs to run under job control:
from schrodinger.job import launchapi
from schrodinger.ui.qt.appframework2 import application
from my_lib.steps import MyStep
def get_job_spec_from_args(argv):
jsb = launchapi.JobSpecificationArgsBuilder(argv)
jsb.setInputFile(__file__)
jsb.setInputDirectory('my_lib')
return jsb.getJobSpec()
def main():
step = MyStep()
set.getOutputs()
if __name__ == '__main__':
application.run_application(main)
#===============================================================================
# Generic Steps <_generics_>
#===============================================================================
Steps that can be run on any data type can be created by using the GENERIC
sentinel type as the input or output type of a step. The step will then
receive all inputs as serialized strings and should return all string outputs.
Example:
>>> class DeduplicateStep(ReduceStep):
... Input = Output = GENERIC
...
... def reduceFunction(self, inps):
... yield from sorted(set(inps))
...
>>> class IdentityStep(MapStep):
... Input = Output = int
...
... def mapFunction(self, value):
... yield value
...
>>> class DeduplicatedIdentityChain(Chain):
... def buildChain(self):
... self.addStep(IdentityStep())
... self.addStep(DeduplicateStep())
... self.addStep(IdentityStep())
...
>>> chain = DeduplicatedIdentityChain()
>>> chain.setInputs([1, 2, 3, 1, 2, 3])
>>> chain.getOutputs()
[1, 2, 3]
These steps can be chained together with any steps, regardless of the input or output types of the other steps.
- NOTE::
No validation is done to guarantee that the input type of the step after a generic step is the same as the output type of the precedeing step. The behavior for this circumstance is undefined and will likely resulted in an error.
#=============================================================================== # Double Batching <_dbl_batching_> #=============================================================================== Job launch speeds at the time of writing is about one job per 3 or 4 seconds. This rate becomes insufficient once we need more than a few hundred workers. To get around this, stepper employs a pattern we coin “double batching”, where we create subjobs whose sole purpose is to themselves create the subjobs that actually run the steps.
NOTE:: We use double-batching for the PubSub implementation of stepper as well as the file-based implementation. The literal meaning of “double-batching” doesn’t apply as well to the PubSub implementation but the general pattern of launching subjobs to launch more subjobs still applies.
#=============================================================================== # Environment variables and global settings #===============================================================================
Settings:
- SCHRODINGER_STEPPER_DEBUG
Set to 1 to have most files brought back from a workflow run. Set to 2 to have _all_ files brought back.
- SCHRODINGER_STEPPER_LOG_LEVEL
Set to an integer or name representing the log level to use for the logger. Valid log names are in decreasing order of verbosity NOTSET, DEBUG, INFO, WARN, ERROR, FATAL, and CRITICAL. Set to DEBUG to see log messages from cloud clients.
- SCHRODINGER_GCP_KEY
Expected when running stepper with pubsub and bigquery. Should be a path to the gcp service key. See
for more information on generating gcp service keys.
- SCHRODINGER_CLOUD_VENV
A path to the python executable of a virtualenv that can be used for interfacing with GCP or AWS. This virtualenv should be accessible on all nodes that a stepper workflow will be run on in addition to having all necessary python client libraries.
- SCHRODINGER_GCP_ENABLED
Optional setting to signify that the current machine is a GCP compute engine. Setting this will make SCHRODINGER_GCP_KEY also optional as credentials will be inferred from the GCP compute engine. SCHRODINGER_GCP_KEY will have precedence over the compute engine’s default credentials if set.
- SCHRODINGER_CLOUD_WORKER_TIMEOUT
Optional debug setting. If set, pubsub workers will timeout after SCHRODINGER_CLOUD_WORKER_TIMEOUT minutes.
- SCHRODINGER_GCP_NUM_PUBSUB_WORKERS
Sets the default number of pubsub workers that will be used. If not set, one will be used. Note that this value can still be overridden by a workflow’s configuration.
- SCHRODINGER_STEPPER_ERROR_THRESHOLD
Sets the batching error threshold. If not set, 0.9 will be used. Note that this value can still be overridden by a workflow’s configuration.
- schrodinger.stepper.stepper.get_debug_level()¶
- class schrodinger.stepper.stepper.ElapsedFormatter¶
Bases:
object
A stepper logging formatter that includes how much time has elapsed since a start time in all messages.
FORMATTER.start()
is safe to call multiple times, the start time will be set to the time of the earliest call.Example usage:
logger.debug("Message before debug.") # Message before debug. FORMATTER.start() time.wait(1) logger.debug("My message") # <STEPPER> DEBUG +00:00:01: My message
- __init__()¶
- start()¶
- format(record)¶
- schrodinger.stepper.stepper.ichunked(iterable, n)¶
Reimplementation of more_itertools.ichunked that does not cache n items of iterable at a time.
Breaks
iterable
into sub-iterables withn
elements each.Note that unlike more_itertools.ichunked, an error will be raised if you try to iterate over a chunk before its previous chunk has been consumed.
- class schrodinger.stepper.stepper.StepperFile(value='', *args, **kwargs)¶
Bases:
schrodinger.tasks.tasks.TaskFile
- LOCAL = 1¶
- STATIC = 2¶
- __contains__(key, /)¶
Return key in self.
- __init__(path='', resource_type=ResourceType.LOCAL)¶
- __len__()¶
Return len(self).
- capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold()¶
Return a version of the string suitable for caseless comparisons.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub[, start[, end]]) int ¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
- encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- endswith(suffix[, start[, end]]) bool ¶
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
- expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub[, start[, end]]) int ¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- format(*args, **kwargs) str ¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str ¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_obj)¶
Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.
- Parameters
json_dict (dict) – A dictionary loaded from a JSON string or file.
- Returns
An instance of the derived class.
- Return type
cls
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- index(sub[, start[, end]]) int ¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower()¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- replace(old, new, count=- 1, /)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rfind(sub[, start[, end]]) int ¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(sub[, start[, end]]) int ¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(sep=None, maxsplit=- 1)¶
Return a list of the words in the string, using sep as the delimiter string.
- sep
The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.
- maxsplit
Maximum number of splits to do. -1 (the default value) means no limit.
Splits are done starting at the end of the string and working to the front.
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(sep=None, maxsplit=- 1)¶
Return a list of the words in the string, using sep as the delimiter string.
- sep
The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.
- maxsplit
Maximum number of splits to do. -1 (the default value) means no limit.
- splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- startswith(prefix[, start[, end]]) bool ¶
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.
- Returns
A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper()¶
Return a copy of the string converted to uppercase.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- class schrodinger.stepper.stepper.StepperFolder(value='', *args, **kwargs)¶
Bases:
schrodinger.tasks.tasks.TaskFolder
- LOCAL = 1¶
- STATIC = 2¶
- __contains__(key, /)¶
Return key in self.
- __init__(path='', resource_type=ResourceType.LOCAL)¶
- __len__()¶
Return len(self).
- capitalize()¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold()¶
Return a version of the string suitable for caseless comparisons.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub[, start[, end]]) int ¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
- encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- endswith(suffix[, start[, end]]) bool ¶
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
- expandtabs(tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub[, start[, end]]) int ¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- format(*args, **kwargs) str ¶
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping) str ¶
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_obj)¶
Abstract method that must be defined by all derived classes. Takes in a dictionary and constructs an instance of the derived class.
- Parameters
json_dict (dict) – A dictionary loaded from a JSON string or file.
- Returns
An instance of the derived class.
- Return type
cls
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- index(sub[, start[, end]]) int ¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isalpha()¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isascii()¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- isdecimal()¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit()¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isidentifier()¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- islower()¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- isspace()¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- istitle()¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isupper()¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower()¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- replace(old, new, count=- 1, /)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rfind(sub[, start[, end]]) int ¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
- rindex(sub[, start[, end]]) int ¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(sep=None, maxsplit=- 1)¶
Return a list of the words in the string, using sep as the delimiter string.
- sep
The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.
- maxsplit
Maximum number of splits to do. -1 (the default value) means no limit.
Splits are done starting at the end of the string and working to the front.
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(sep=None, maxsplit=- 1)¶
Return a list of the words in the string, using sep as the delimiter string.
- sep
The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result.
- maxsplit
Maximum number of splits to do. -1 (the default value) means no limit.
- splitlines(keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- startswith(prefix[, start[, end]]) bool ¶
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase()¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title()¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Abstract method that must be defined by all derived classes. Converts an instance of the derived class into a jsonifiable object.
- Returns
A dict made up of JSON native datatypes or Jsonable objects. See the link below for a table of such types. https://docs.python.org/2/library/json.html#encoders-and-decoders
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper()¶
Return a copy of the string converted to uppercase.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- class schrodinger.stepper.stepper.StepTaskInput(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- dehydrated_step: schrodinger.stepper.stepper._DehydratedStep¶
See
_BaseStep._dehydrateStep
for documentation.
- debug_mode: bool¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- misc_input_filenames: List[schrodinger.tasks.tasks.TaskFile]¶
A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- misc_input_folders: List[schrodinger.tasks.tasks.TaskFolder]¶
A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- debug_modeChanged¶
- debug_modeReplaced¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- dehydrated_stepChanged¶
- dehydrated_stepReplaced¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- misc_input_filenamesChanged¶
- misc_input_filenamesReplaced¶
- misc_input_foldersChanged¶
- misc_input_foldersReplaced¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- class schrodinger.stepper.stepper.StepTaskOutput(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- output_file: schrodinger.tasks.tasks.TaskFile¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- run_info: dict¶
A Param to represent dictionaries. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
value_class
keyword argument to specify what type of class the values will be. This information will be used for jsonifying the dictionary if specified. (Note that non-string keys are not currently supported for jsonification. This may change in the future. See PANEL-13029).
- misc_output_filenames: List[schrodinger.tasks.tasks.TaskFile]¶
A Param to represent lists. Values of this param will have a
mutated
signal that will be emitted whenever any mutation method is called.The constructor optionally takes a
item_class
keyword argument to specify what type of class the items in the list will be. This information will be used for jsonifying the list if specified.
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- misc_output_filenamesChanged¶
- misc_output_filenamesReplaced¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output_fileChanged¶
- output_fileReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run_infoChanged¶
- run_infoReplaced¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- class schrodinger.stepper.stepper.StepTaskMixin(*args, step=None, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParamMixin
This class must be mixed in with a subclass of AbstractComboTask. The resulting task class may be used to run any step as a task, provided the input, output, and settings classes are all JSONable.
- DEFAULT_TASKDIR_SETTING = 1¶
- __init__(*args, step=None, **kwargs)¶
- addLicenseReservation(license, num_tokens=1)¶
- setStep(step)¶
- getStepClass()¶
- mainFunction()¶
- class schrodinger.stepper.stepper.StepSubprocessTask(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.stepper.stepper.StepTaskMixin
,schrodinger.tasks.tasks.ComboSubprocessTask
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = 1¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- ENTRYPOINT = 'combotask_entry_point.py'¶
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, step=None, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- backendMain()¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- getStepClass()¶
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- inputChanged¶
- inputReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isBackendMode()¶
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- property json_filename¶
- property json_out_filename¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- mainFunction()¶
- makeCmd()¶
@overrides: AbstractCmdTask
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runBackend()¶
- runCmd(cmd)¶
- runInProcess()¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setStep(step)¶
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
@overrides: AbstractTask
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.stepper.stepper.StepJobTask(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.stepper.stepper.StepTaskMixin
,schrodinger.tasks.jobtasks.ComboJobTask
- isCanceled() bool ¶
Whether the job underlying the task is canceled.
If there is no job associated with the task, then this returns False.
- mainFunction()¶
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = 1¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- ENTRYPOINT = 'combotask_entry_point.py'¶
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- property PROGRAM_NAME¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, step=None, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- backendMain()¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configToJobConfigAdapter(json_dict)¶
- classmethod configureParam()¶
@overrides: parameters.CompoundParam
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- getJob() Optional[schrodinger.job.jobcontrol.Job] ¶
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- getShFilename()¶
- getStepClass()¶
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inWriteMode()¶
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: paramters.CompoundParam
- inputChanged¶
- inputReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isBackendMode()¶
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- job_config: JobConfig¶
Subclass JobConfig to customize what job settings are available for a given jobtask. To disable an option, set an ordinary (non-param) class variable with value None for that option.
Subclasses may add any arbitrary options as desired; it is the responsibility of the task to handle those options.
- job_configChanged¶
- job_configReplaced¶
- job_id¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- property json_filename¶
- property json_out_filename¶
- kill()¶
@overrides: tasks.AbstractTask
- killTimer(self, id: int)¶
- makeCmd()¶
@overrides: tasks.AbstractCmdTask
Child classes must override.
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
@overrides: tasks.AbstractTask
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runBackend()¶
@overrides: AbstractComboTask
- runCmd(cmd)¶
@overrides: tasks.AbstractCmdTask
- runInProcess()¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- runToCmd(skip_preprocessing=False)¶
Does the same thing as start except it doesn’t actually launch the job. Instead it just returns the final job cmd.
Intended to be used for running jobtasks on JobDJ, which requires a job cmd rather than a task.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setJob(job: schrodinger.job.jobcontrol.Job)¶
” Use given
jobcontrol.Job
to incorporate job results into the task and run postprocessors. Example:task = FooTask() cmd = task.runToCommand() job = jobcontrol.launch_job(cmd) job.wait() task.setJob(job)
If the job has not been downloaded, the task will be set to FAILED with a SetJobRuntimeError.
- Parameters
job –
jobcontrol.Job
with results to incorporate into the task.
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setStep(step)¶
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
@overrides: AbstractTask
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- stop()¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- write(skip_preprocessing=False)¶
- writeStuZipFile()¶
- class schrodinger.stepper.stepper.Topic(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
An abstraction over a container of messages in a Publish/Subscribe model
- Variables
name – the name of the topic
num_uploaded_msgs – the number of messages that were uploaded to this topic; it is not reflective of the number of messages currently in the topic.
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- num_uploaded_msgs: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- nameChanged¶
- nameReplaced¶
- num_uploaded_msgsChanged¶
- num_uploaded_msgsReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- class schrodinger.stepper.stepper.BatchSettings(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- size: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- task_class: type¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- hostname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- use_pubsub: bool¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- num_pubsub_workers: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- error_threshold: float¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- error_thresholdChanged¶
- error_thresholdReplaced¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- hostnameChanged¶
- hostnameReplaced¶
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- num_pubsub_workersChanged¶
- num_pubsub_workersReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- sizeChanged¶
- sizeReplaced¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- task_classChanged¶
- task_classReplaced¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- use_pubsubChanged¶
- use_pubsubReplaced¶
- valueChanged¶
- class schrodinger.stepper.stepper.Serializer¶
Bases:
object
<_serialization_> A class for defining special serialization for some datatype. Serialization by default uses the
json
protocol, but if a specialized protocol is wanted instead, users can subclass this class to do so.Subclasses should:
- Define
DataType
. This is the class that this serializer can encode/decode.
- Define
- Define
toString(self, output)
, which defines how to serialize an output.
- Define
- Define
fromString(self, input_str)
, which defines how to deserialize an input.
- Define
This can then be used as the
InputSerializer
orOutputSerializer
for any step.Here’s an example for defining an int that’s serialized in base-two as opposed to base-ten:
class IntBaseTwoSerializer(Serializer): DataType = int def toString(self, output): return bin(output) # 7 -> '0b111' def fromString(self, input_str): return int(input_str[2:], 2) # '0b111' -> 7
This can then be used anywhere you’d use an int as the output or input in a step. For example:
class SquaringStep(MapStep): Input = int InputSerializer = IntBaseTwoSerializer Output = int OutputSerializer = IntBaseTwoSerializer def mapFunction(self, inp): yield inp**2
Now, any time that a
SquaringStep
would read its inputs from a file or write its outputs to a file, it’ll do so using using a base-two representation.- DataType = NotImplemented¶
- serialize(items, fname)¶
Write
items
to a file namedfname
.
- deserialize(fname)¶
Read in items from
fname
. :type fname: str :rtype: iterable[self.DataType]
- fromString(input_str)¶
- toString(output)¶
- exception schrodinger.stepper.stepper.ValidationIssue(source_step, msg)¶
Bases:
RuntimeError
- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.stepper.stepper.SettingsError(source_step, msg)¶
Bases:
schrodinger.stepper.stepper.ValidationIssue
Used in conjunction with
_BaseStep.validateSettings
to report an error with settings. Constructed with the step with the invalid settings and an error message, e.g.SettingsError(bad_step, "Step does not have required settings."
)- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.stepper.stepper.SettingsWarning(source_step, msg)¶
Bases:
schrodinger.stepper.stepper.ValidationIssue
Used in conjunction with
_BaseStep.validateSettings
to report a warning with settings. Constructed with the step with the invalid settings and an error message, e.g.SettingsWarning(bad_step, "Step setting FOO should ideally be positive"
)- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.stepper.stepper.ResourceError(source_step, msg)¶
Bases:
schrodinger.stepper.stepper.ValidationIssue
Used in conjunction with
_BaseStep.validateSettings
to report an error with a resource setting. Constructed with the step with the invalid setting and an error message, e.g.,ResourceError(bad_step, "Step setting 'file' has not been set."
)- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.stepper.stepper.LocalResourceError(source_step, msg)¶
Bases:
schrodinger.stepper.stepper.ResourceError
A ResourceError specifically for local StepperFile and StepperFolder validations, i.e., resources that are on a job submission host and may have to be transferred to compute resources
- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception schrodinger.stepper.stepper.StaticResourceError(source_step, msg)¶
Bases:
schrodinger.stepper.stepper.ResourceError
A ResourceError specifically for static StepperFile and StepperFolder validations, i.e., resources that are not necessarily available on a job submission host
- __init__(source_step, msg)¶
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class schrodinger.stepper.stepper.PubsubEnabledStepMixin(*args, **kwargs)¶
Bases:
object
A mixin that allows a step to be run using PubSub.
Steps with this mixin will have batch settings that have a
use_pubsub
flag and anum_pubsub_workers
integer. Flippinguse_pubsub
to on will have the step load up all its inputs into a pubsub topic before spinning upnum_pubsub_workers
subjobs that will all take from the input topic, run the step’s computation on it, and upload it to an output topic.Calling
my_pubsub_step.getOutputs()
will return all the outputs from the output topic, so to a user this will all be implementation detail.- __init__(*args, **kwargs)¶
- property topic_prefix¶
- property topic_suffix¶
- outputs(*args, **kwargs)¶
- usingPubsub()¶
- getInputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- setInputTopic(inp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- getOutputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- setOutputTopic(outp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- initializeTopics()¶
- class schrodinger.stepper.stepper.UnbatchedReduceStep(settings=None, config=None, step_id=None, metrics_logger_depth=None, _run_info=None, **kwargs)¶
Bases:
schrodinger.stepper.stepper._BaseStep
” An unbatchable ReduceStep. See ReduceStep for more information.
- reduceFunction(inputs)¶
- Input = None¶
- InputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Output = None¶
- OutputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Settings¶
- __init__(settings=None, config=None, step_id=None, metrics_logger_depth=None, _run_info=None, **kwargs)¶
See class docstring for info on the different constructor arguments.
- blockSignals(self, b: bool) bool ¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getLicenseRequirements()¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- report(prefix='')¶
Report the settings and batch settings for this step.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setInputFile(fname)¶
- setInputs(*args, **kwargs)¶
- setObjectName(self, name: str)¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- 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]
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- class schrodinger.stepper.stepper.ReduceStep(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper._BatchableStepMixin
,schrodinger.stepper.stepper.UnbatchedReduceStep
<_reduce_step_> A computational step that performs a function on a collection of inputs to produce output items.
To construct a ReduceStep:
Implement reduceFunction
Define Input (the type expected by the mapFunction)
Define Output (the type of item produced by the mapFunction)
Define Settings (data class for any settings needed by the mapFunction)
- 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
- Input = None¶
- InputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Output = None¶
- OutputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Settings¶
- __init__(*args, **kwargs)¶
See class docstring for info on the different constructor arguments.
- blockSignals(self, b: bool) bool ¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getInputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getLicenseRequirements()¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- initializeTopics()¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- report(prefix='')¶
Report the settings and batch settings for this step.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBatchSettings(*args, **kwargs)¶
- setInputFile(fname)¶
- setInputTopic(inp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setInputs(*args, **kwargs)¶
- setObjectName(self, name: str)¶
- setOutputTopic(outp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- property topic_prefix¶
- property topic_suffix¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- usingPubsub()¶
- 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]
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- class schrodinger.stepper.stepper.UnbatchedMapStep(settings=None, config=None, step_id=None, metrics_logger_depth=None, _run_info=None, **kwargs)¶
Bases:
schrodinger.stepper.stepper.UnbatchedReduceStep
<_unbatchability_> An unbatchable MapStep. See MapStep for more information.
- reduceFunction(inputs)¶
- mapFunction(input)¶
- Input = None¶
- InputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Output = None¶
- OutputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Settings¶
- __init__(settings=None, config=None, step_id=None, metrics_logger_depth=None, _run_info=None, **kwargs)¶
See class docstring for info on the different constructor arguments.
- blockSignals(self, b: bool) bool ¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getLicenseRequirements()¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- report(prefix='')¶
Report the settings and batch settings for this step.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setInputFile(fname)¶
- setInputs(*args, **kwargs)¶
- setObjectName(self, name: str)¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- 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]
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- class schrodinger.stepper.stepper.MapStep(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper._BatchableStepMixin
,schrodinger.stepper.stepper.UnbatchedMapStep
<_map_step_> A computational step that performs a function on input items from an input source to produce output items.
To construct a MapStep:
Implement mapFunction
Define Input (the type expected by the mapFunction)
Optionally define a InputSerializer (see
Serializer
for more info.)Define Output (the type of item produced by the mapFunction)
Optionally define a OutputSerializer (see
Serializer
for more info.)Define Settings (data class for any settings needed by the mapFunction)
- mapFunction(input)¶
The main computation for this step. This function should take in a single input item and return an iterable of outputs. This allows a single output to produce multiple ouputs (e.g. enumeration).
The output may be yielded as a generator, in order to reduce memory usage.
If only a single output is produced for each input, return it as a single-element list.
- Parameters
input –
this will be a single input item from the input source. Implementer is encouraged to use a more descriptive, context- specific variable name. Example:
- def mapFunction(self, starting_smiles):
…
- Input = None¶
- InputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Output = None¶
- OutputSerializer¶
alias of
schrodinger.stepper.stepper._DynamicSerializer
- Settings¶
- __init__(*args, **kwargs)¶
See class docstring for info on the different constructor arguments.
- blockSignals(self, b: bool) bool ¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getInputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getLicenseRequirements()¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- initializeTopics()¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- reduceFunction(inputs)¶
- removeEventFilter(self, a0: QObject)¶
- report(prefix='')¶
Report the settings and batch settings for this step.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBatchSettings(*args, **kwargs)¶
- setInputFile(fname)¶
- setInputTopic(inp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setInputs(*args, **kwargs)¶
- setObjectName(self, name: str)¶
- setOutputTopic(outp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- property topic_prefix¶
- property topic_suffix¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- usingPubsub()¶
- 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]
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- class schrodinger.stepper.stepper.UnbatchedChain(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper.UnbatchedReduceStep
- property Input¶
- property Output¶
- property InputSerializer¶
The default serializer that simply uses
json.loads
andjson.dumps
- property OutputSerializer¶
The default serializer that simply uses
json.loads
andjson.dumps
- setInputs(inputs: Iterable[Any], starting_step_id: Optional[str] = None)¶
Set the inputs for the chain. If
starting_step_id
is specified, then all steps before the specified starting step will be skipped. This is useful for resuming a chain’s computation.
- setInputFile(input_file: str, starting_step_id: Optional[str] = None)¶
Set the input file for the chain. If
starting_step_id
is specified, then all steps before the specified starting step will be skipped. This is useful for resuming a chain’s computation.
- setStartingStep(starting_step: str)¶
- validateSettings()¶
Check whether the chain settings are valid and return a list of
SettingsError
andSettingsWarning
to report any invalid settings. Default implementation simply returns problems from all child steps.- Return type
list[TaskError or TaskWarning]
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings for the chain as well as for every step in the chain that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- __init__(*args, **kwargs)¶
See class docstring for info on the different constructor arguments.
- __len__()¶
- addStep(step)¶
- report(prefix='')¶
Report the workflow steps and their settings (recursively).
- Parameters
prefix (str) – the text to start each line with
- validateChain()¶
Checks that the declaration of the chain is internally consistent - i.e. that each step is valid and each step’s Input class matches the preceding step’s Output class.
- reduceFunction(inputs)¶
- buildChain()¶
This method must be implemented by subclasses to build the chain. The chain is built by modifying self.steps. The chain’s composition may be dependent on self.settings.
- Settings¶
- blockSignals(self, b: bool) bool ¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getLicenseRequirements()¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- class schrodinger.stepper.stepper.Chain(*args, **kwargs)¶
Bases:
schrodinger.stepper.stepper._BatchableStepMixin
,schrodinger.stepper.stepper.UnbatchedChain
<_chain_> Run a series of steps. The steps must be created by overriding buildChain.
- getLicenseRequirements()¶
- property Input¶
- property InputSerializer¶
The default serializer that simply uses
json.loads
andjson.dumps
- property Output¶
- property OutputSerializer¶
The default serializer that simply uses
json.loads
andjson.dumps
- Settings¶
- __init__(*args, **kwargs)¶
See class docstring for info on the different constructor arguments.
- __len__()¶
- addStep(step)¶
- blockSignals(self, b: bool) bool ¶
- buildChain()¶
This method must be implemented by subclasses to build the chain. The chain is built by modifying self.steps. The chain’s composition may be dependent on self.settings.
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cleanUp()¶
Hook for adding any type of work that needs to happen after all outputs are exhausted or if some outputs are created and the step is destroyed.
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- getInputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getMetricsLoggerDepth() Optional[int] ¶
- getOutputSerializer()¶
- getOutputTopic() Optional[schrodinger.stepper.stepper.Topic] ¶
- getOutputs()¶
Gets all the outputs in a list by fully iterating the output generator.
- getResources(param_type, resource_type)¶
Get the stepper resources in the settings for the chain as well as for every step in the chain that are instances of
param_type
and have a resource_type attribute that isresource_type
.Note does not work for list/set/tuple subparams in the settings.
- Parameters
param_type (tasks._TaskResource) – the resource parameter type
resource_type (ResourceType) – the type of resource to get
- Returns
the set of stepper resources of
resource_type
- Return type
set of tasks._TaskResource
- getRunInfo()¶
- getStepDepth() int ¶
Get the depth of a step which is defined as how nested it is. A step run in isolation (i.e. not within a chain) has a depth level of 0.
- getStepId()¶
- inherits(self, classname: str) bool ¶
- initializeTopics()¶
- inputs()¶
- installEventFilter(self, a0: QObject)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- outputs(*args, **kwargs)¶
- parent(self) QObject ¶
- prettyPrintRunInfo()¶
Format and print info about the step’s run.
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- reduceFunction(inputs)¶
- removeEventFilter(self, a0: QObject)¶
- report(prefix='')¶
Report the workflow steps and their settings (recursively).
- Parameters
prefix (str) – the text to start each line with
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBatchSettings(*args, **kwargs)¶
- setInputFile(input_file: str, starting_step_id: Optional[str] = None)¶
Set the input file for the chain. If
starting_step_id
is specified, then all steps before the specified starting step will be skipped. This is useful for resuming a chain’s computation.
- setInputTopic(inp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setInputs(inputs: Iterable[Any], starting_step_id: Optional[str] = None)¶
Set the inputs for the chain. If
starting_step_id
is specified, then all steps before the specified starting step will be skipped. This is useful for resuming a chain’s computation.
- setObjectName(self, name: str)¶
- setOutputTopic(outp_topic: Optional[schrodinger.stepper.stepper.Topic])¶
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- setSettings(*args, **kwargs)¶
- setStartingStep(starting_step: str)¶
- setUp()¶
Hook for adding any type of work that needs to happen before any outputs are created.
- signalsBlocked(self) bool ¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- property topic_prefix¶
- property topic_suffix¶
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- usingPubsub()¶
- validateChain()¶
Checks that the declaration of the chain is internally consistent - i.e. that each step is valid and each step’s Input class matches the preceding step’s Output class.
- validateSettings()¶
Check whether the chain settings are valid and return a list of
SettingsError
andSettingsWarning
to report any invalid settings. Default implementation simply returns problems from all child steps.- Return type
list[TaskError or TaskWarning]
- writeOutputsToFile(fname)¶
Write outputs to
fname
. By default, the output file will consist of one line for each output with whatever is produced when passing the out- put tostr
. Override this method if more complex behavior is needed.
- schrodinger.stepper.stepper.get_all_steps_and_chains(step: schrodinger.stepper.stepper._BaseStep) Set[schrodinger.stepper.stepper._BaseStep] ¶
Given a step, return a set of all steps it contains and itself. For example, given a chain A with the following topology:
A |-------| B C |-------| D E
this method will return:
A -> set([A, B, C, D, E]) B -> set[B]) C -> set([C, D, E])