nspyre.misc.misc

A collection of miscellaneous functionality.

Module Contents

Classes

ProcessRunner

Run a function in a new process.

Functions

run_experiment(exp_cls, fun_name, constructor_args, ...)

Create an instance of the experiment class and run the experiment function.

class nspyre.misc.misc.ProcessRunner(kill=True)

Run a function in a new process.

Parameters:

kill – Whether to kill a previously running process that hasn’t completed.

run(fun, *args, **kwargs)

Run the provided function in a separate process.

Parameters:
  • fun – Function to run.

  • args – Arguments to pass to fun.

  • kwargs – Keyword arguments to pass to fun.

Raises:

RuntimeError – The function from a previous call is still running.

running()

Return True if the process is running.

kill()

Kill the process.

nspyre.misc.misc.run_experiment(exp_cls, fun_name, constructor_args, constructor_kwargs, fun_args, fun_kwargs)

Create an instance of the experiment class and run the experiment function.

Parameters:
  • exp_cls (Type) –

  • fun_name (str) –

  • constructor_args (list) –

  • constructor_kwargs (Dict) –

  • fun_args (list) –

  • fun_kwargs (Dict) –