core.components.reducer#

Copyright (c) Meta, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Classes#

Reducer

Represents an abstraction over things that reduce the results written by a set of runner.

MockReducer

Used for testing

Module Contents#

class core.components.reducer.Reducer#

Represents an abstraction over things that reduce the results written by a set of runner.

Note

When running with the fairchemv2 cli, the job_config and runner_config attributes are set at runtime to those given in the config file.

job_config#

a managed attribute that gives access to the job config

Type:

DictConfig

runner_config#

a managed attributed that gives access to the calling runner config

Type:

DictConfig

job_config#
runner_config#
property runner_type: type[fairchem.core.components.runner.Runner]#
Abstractmethod:

The runner type this reducer is associated with.

abstract reduce() Any#

Use file pattern to reduce

abstract save_state(checkpoint_location: str, is_preemption: bool = False) bool#
abstract load_state(checkpoint_location: str | None) None#
class core.components.reducer.MockReducer#

Bases: Reducer

Used for testing

property runner_type#

The runner type this reducer is associated with.

reduce() Any#

Use file pattern to reduce

save_state(checkpoint_location: str, is_preemption: bool = False) bool#
load_state(checkpoint_location: str | None) None#