parameters: (input,
            runtime_args: typing.Union[dict, typing.Sequence[dict]] = None,
            label: str = None,
            context=None)
return_statement: return handle
docstring: MD simulation operation.
  
      Arguments:
          input : valid simulation input
          runtime_args (dict): command line flags and arguments to be passed to mdrun (optional)
  
      Returns:
          runnable operation to perform the specified simulation
  
      The *output* attribute of the returned operation handle contains dynamically
      determined outputs from the operation.
  
      *input* may be a TPR file name or a an object providing the SimulationInput interface.
  
      *runtime_args* allows an optional dictionary of mdrun options, using the option flag
      (including the leading hyphen ``-``) as the dictionary key.
      For mdrun command line options that do not take a value (e.g. ``-noappend``),
      use ``None`` as the dictionary value.
  
      Note:
          New function names will be appearing to handle tasks that are separate
  
          "simulate" is plausibly a dispatcher or base class for various tasks
          dispatched by mdrun. Specific work factories are likely "minimize,"
          "test_particle_insertion," "legacy_simulation" (do_md), or "simulation"
          composition (which may be leap-frog, vv, and other algorithms)
docstring_summary: MD simulation operation.
docstring_tokens: MD simulation operation .
function: def mdrun(input,
            runtime_args: typing.Union[dict, typing.Sequence[dict]] = None,
            label: str = None,
            context=None):
      """MD simulation operation.
  
      Arguments:
          input : valid simulation input
          runtime_args (dict): command line flags and arguments to be passed to mdrun (optional)
  
      Returns:
          runnable operation to perform the specified simulation
  
      The *output* attribute of the returned operation handle contains dynamically
      determined outputs from the operation.
  
      *input* may be a TPR file name or a an object providing the SimulationInput interface.
  
      *runtime_args* allows an optional dictionary of mdrun options, using the option flag
      (including the leading hyphen ``-``) as the dictionary key.
      For mdrun command line options that do not take a value (e.g. ``-noappend``),
      use ``None`` as the dictionary value.
  
      Note:
          New function names will be appearing to handle tasks that are separate
  
          "simulate" is plausibly a dispatcher or base class for various tasks
          dispatched by mdrun. Specific work factories are likely "minimize,"
          "test_particle_insertion," "legacy_simulation" (do_md), or "simulation"
          composition (which may be leap-frog, vv, and other algorithms)
      """
      # The job of this function is to arrange for the creation of a workflow node
      # by transforming arguments into a DataSourceCollection and providing the
      # collection to a Director.
      # The Director is specific to the Operation (this module) but could be generated
      # with the help of simle metaprogramming in the future (e.g. just declare
      # requirements or helpers in a class definition).
      # Ref: gmxapi.abc.NodeBuilder and gmxapi.operation.NodeBuilder
  
      if runtime_args is None:
          runtime_args = {}
  
      handle_context = context
      if handle_context is not None:
          raise gmxapi.exceptions.MissingImplementationError(
              'context must be None. This factory is only for the Python UI right now.')
  
      target_context = _op.current_context()
      assert isinstance(target_context, _op.Context)
      # Get a director that will create a node in the standard context.
      node_director: StandardDirector = _op._get_operation_director(RegisteredOperation,
                                                                    context=target_context)
      assert isinstance(node_director, StandardDirector)
      # TODO: refine this protocol
      assert handle_context is None
      # Examine the input.
      if isinstance(input, ModuleObject):
          # The input is from read_tpr or modify_input.
          source_context = input
      else:
          # Allow automatic dispatching
          source_context = None
  
      # Depending on dispatching, the ResourceFactory may be one of several functor types.
      # TODO: Use a standard helper function to pass data and resources to the NodeDirector.
      #  Module-specific input processing logic should be explicit in this user-facing function
      #  or composed into the NodeDirector for this operation.
      resource_factory = node_director.resource_factory(source=source_context, target=target_context)
      # The resource_factory will ultimately produce a DataSourceCollection with help from the
      # InputCollectionDescription defined for this module. Per InputCollectionDescription.bind()
      # and the POSITIONAL_OR_KEYWORD property, the `input` could be provided as a positional
      # argument (as it was previously) and get bound to `_simulation_input`. Despite the
      # provisional nature of the `_simulation_input` input, this code is more readable when we
      # use a named parameter.
      resources: _op.DataSourceCollection = resource_factory(_simulation_input=input,
                                                             runtime_args=runtime_args)
      handle = node_director(resources=resources, label=label)
      # Note: One effect of the assertions above is to help the type checker infer
      # the return type of the handle. It is hard to convince the type checker that
      # the return value of the node builder is up-cast. We might be able to resolve
      # this by making both get_operation_director and ReadTprImplementation
      # generics of the handle type, or using the handle type as the key for
      # get_operation_director.
      return handle
function_tokens: def mdrun ( input , runtime_args : typing . Union [ dict , typing . Sequence [ dict ] ] = None , label : str = None , context = None ) : # The job of this function is to arrange for the creation of a workflow node # by transforming arguments into a DataSourceCollection and providing the # collection to a Director. # The Director is specific to the Operation (this module) but could be generated # with the help of simle metaprogramming in the future (e.g. just declare # requirements or helpers in a class definition). # Ref: gmxapi.abc.NodeBuilder and gmxapi.operation.NodeBuilder if runtime_args is None : runtime_args = { } handle_context = context if handle_context is not None : raise gmxapi . exceptions . MissingImplementationError ( 'context must be None. This factory is only for the Python UI right now.' ) target_context = _op . current_context ( ) assert isinstance ( target_context , _op . Context ) # Get a director that will create a node in the standard context. node_director : StandardDirector = _op . _get_operation_director ( RegisteredOperation , context = target_context ) assert isinstance ( node_director , StandardDirector ) # TODO: refine this protocol assert handle_context is None # Examine the input. if isinstance ( input , ModuleObject ) : # The input is from read_tpr or modify_input. source_context = input else : # Allow automatic dispatching source_context = None # Depending on dispatching, the ResourceFactory may be one of several functor types. # TODO: Use a standard helper function to pass data and resources to the NodeDirector. #  Module-specific input processing logic should be explicit in this user-facing function #  or composed into the NodeDirector for this operation. resource_factory = node_director . resource_factory ( source = source_context , target = target_context ) # The resource_factory will ultimately produce a DataSourceCollection with help from the # InputCollectionDescription defined for this module. Per InputCollectionDescription.bind() # and the POSITIONAL_OR_KEYWORD property, the `input` could be provided as a positional # argument (as it was previously) and get bound to `_simulation_input`. Despite the # provisional nature of the `_simulation_input` input, this code is more readable when we # use a named parameter. resources : _op . DataSourceCollection = resource_factory ( _simulation_input = input , runtime_args = runtime_args ) handle = node_director ( resources = resources , label = label ) # Note: One effect of the assertions above is to help the type checker infer # the return type of the handle. It is hard to convince the type checker that # the return value of the node builder is up-cast. We might be able to resolve # this by making both get_operation_director and ReadTprImplementation # generics of the handle type, or using the handle type as the key for # get_operation_director. return handle