Tasks.task module

Description

This module defines the ParaMol.Objective_function.Tasks.task.Task class, which is the Task base class.

class ParaMol.Tasks.task.Task(task_name)

Bases: object

ParaMol Task base class

Parameters

task_name (str) – Name of the task.

static create_objective_function(objective_function_settings, restart_settings, parameter_space, properties, systems)

Method that creates the ObjectiveFunction instances

Parameters
  • objective_function_settings (dict) – ObjectiveFunction settings dictionary.

  • restart_settings (dict) – Restart settings dictionary.

  • parameter_space (ParaMol.Parameter_space.parameter_space.ParameterSpace) – Instance of the ParameterSpace.

  • properties (list of ParaMol properties) – List containing the instances of the properties that will enter the objective function.

  • systems (list of ParaMol.System.system.ParaMolSystem) – List containing instances of ParaMol systems.

Returns

properties (list of ParaMol properties) – List containing the instances of the properties that will enter the objective function.

static create_optimizer(method, optimizer_settings)

Method that creates the Optimizer instance.

Parameters
  • method (str) – Optimizer method.

  • optimizer_settings (dict) – Dictionary containing the optimizer settings.

Returns

optimizer

static create_parameter_space(settings, systems, interface=None, preconditioning=True, symmetry_constrained=True, restart=False)

Method that created the ParameterSpace object instance.

Parameters
  • settings (dict) – Dictionary containing global ParaMol settings.

  • systems (list of ParaMol.System.system.ParaMolSystem) – List containing instances of ParaMol systems.

  • interface (ParaMol.Utils.interface.ParaMolInterface) – ParaMol interface instance.

  • preconditioning (bool) – Flag that signal whether or not the preconditioning of the parameters is done when this method is run.

  • restart (bool) – Flag that controls whether or not to perform a restart.

  • symmetry_constrained (bool) – Whether or not to apply symmetry constraints when calling get_optimizable_parameters (should be True, except for RESP explicit and LLS).

Returns

parameter_space (ParaMol.Parameter_space.parameter_space.ParameterSpace)

static create_properties(properties_settings, parameter_space_settings, systems, parameter_space)

Method that creates the Property instances :param properties_settings: Properties settings dictionary. :type properties_settings: dict :param parameter_space_settings: Properties settings dictionary. :type parameter_space_settings: dict :param systems: List containing instances of ParaMol systems. :type systems: list of ParaMol.System.system.ParaMolSystem :param parameter_space: Instance of the ParameterSpace. :type parameter_space: ParaMol.Parameter_space.parameter_space.ParameterSpace

Returns

properties (list of ParaMol properties) – List containing the instances of the properties that will enter the objective function.

static read_restart_pickle(restart_settings, interface, restart_dict_key)

Method that reads restart pickle.

Parameters
  • restart_settings (dict) – Dictionary containing global ParaMol settings.

  • interface (ParaMol.Utils.interface.ParaMolInterface) – ParaMol system instance.

  • restart_dict_key (str) – Key that defines the name of the restart file.

Returns

class_dict (dict) – self.__dict__ of the class to be stored into a pickle.

run_task(*args, **kwargs)

Method that is used when a task is not implemented.

Parameters
  • args (any) –

  • kwargs (any) –

Returns

Raises NotImplementedError

static write_restart_pickle(restart_settings, interface, restart_dict_key, class_dict)

Method that writes restart pickle.

Parameters
  • restart_settings (dict) – Dictionary containing global ParaMol settings.

  • interface (ParaMol.Utils.interface.ParaMolInterface) – ParaMol system instance.

  • restart_dict_key (str) – Key that defines the name of the restart file.

  • class_dict (dict) – self.__dict__ of the class to be stored into a pickle.

Returns

class_dict (dict) – self.__dict__ of the class to be stored into a pickle.