Engine

class scine_chemoton.engine.Engine(credentials, fork=True)[source]

The Engine is a small class starting and stopping potentially infinitely running code acting on a reaction network in a database. All continuous jobs are called Gears (scine_chemoton.gears.Gears), see the appropriate part of this documentation for existing examples.

Parameters
  • : (fork) – db.Credentials (Scine::Database::Credentials): The credentials to a database storing a reaction network. The started process will connect and interact with the referenced database.

  • : – bool: If true, this will cause the Engine to start the process defined by the given Gear with a fork, meaning it will run in a separate thread.

run(single=False)[source]

Starts turning the given Gear (scine_chemoton.gears.Gears).

Parameters

: (single) – bool: If true, runs only a single iteration of the Gear’s loop. Default: false, meaning endless repetition of the loop.

Raises

AttributeError – If no gear was added to the engine, prior to starting it.

set_gear(gear)[source]
Parameters

: (gear) – Gear (scine_chemoton.gears.Gears): The gear to be used when starting this engine.

stop()[source]

In case of a forked job this will terminate the forked process.

Notes

The job will NOT be stopped gracefully.