Skip to main content

emulator_bank

emulator_bank

EmulatorBank domain object for history matching.

Classes

Name Description
EmulatorBank Manages storage and retrieval of emulators across iterations.

EmulatorBank

emulator_bank.EmulatorBank()

Manages storage and retrieval of emulators across iterations.

The EmulatorBank stores emulators organized by iteration number and feature name, providing methods for adding, retrieving, and managing the emulator collection.

Methods

Name Description
add_emulator Add an emulator for a specific iteration and feature.
clear Remove all emulators.
copy Create a deep copy of the emulator bank.
get_all_emulators Get all emulators in the bank.
get_all_features Get all unique feature names across all iterations.
get_all_iterations Get list of iteration numbers with emulators.
get_emulator Retrieve a specific emulator.
get_emulators_for_iteration Get all emulators for a specific iteration.
get_features_for_iteration Get feature names for a specific iteration.
get_latest_emulators Get emulators from the most recent iteration.
get_summary_statistics Get summary statistics about the emulator bank.
has_emulator Check if an emulator exists for specific iteration and feature.
has_emulators Check if any emulators exist in the bank.
load_from_directory Load emulators from disk.
remove_emulator Remove a specific emulator.
remove_iteration Remove all emulators for a specific iteration.
save_to_directory Save all emulators to disk.
summary Human-readable summary: emulators stored, by wave and feature.
add_emulator
emulator_bank.EmulatorBank.add_emulator(iteration, feature, emulator)

Add an emulator for a specific iteration and feature.

Parameters
Name Type Description Default
iteration int Iteration number (1-based) required
feature str Feature name required
emulator BaseEmulator Trained emulator instance required
clear
emulator_bank.EmulatorBank.clear()

Remove all emulators.

copy
emulator_bank.EmulatorBank.copy()

Create a deep copy of the emulator bank.

Returns
Name Type Description
EmulatorBank New EmulatorBank instance with copied emulators
get_all_emulators
emulator_bank.EmulatorBank.get_all_emulators()

Get all emulators in the bank.

get_all_features
emulator_bank.EmulatorBank.get_all_features()

Get all unique feature names across all iterations.

Returns
Name Type Description
List[str] List of unique feature names
get_all_iterations
emulator_bank.EmulatorBank.get_all_iterations()

Get list of iteration numbers with emulators.

Returns
Name Type Description
List[int] Sorted list of iteration numbers
get_emulator
emulator_bank.EmulatorBank.get_emulator(iteration, feature)

Retrieve a specific emulator.

Parameters
Name Type Description Default
iteration int Iteration number required
feature str Feature name required
Returns
Name Type Description
Optional[BaseEmulator] Emulator instance or None if not found
get_emulators_for_iteration
emulator_bank.EmulatorBank.get_emulators_for_iteration(iteration)

Get all emulators for a specific iteration.

Parameters
Name Type Description Default
iteration int Iteration number required
Returns
Name Type Description
Dict[str, BaseEmulator] Dict mapping feature names to emulators
get_features_for_iteration
emulator_bank.EmulatorBank.get_features_for_iteration(iteration)

Get feature names for a specific iteration.

Parameters
Name Type Description Default
iteration int Iteration number required
Returns
Name Type Description
List[str] List of feature names
get_latest_emulators
emulator_bank.EmulatorBank.get_latest_emulators()

Get emulators from the most recent iteration.

Returns
Name Type Description
Dict[str, BaseEmulator] Dict mapping feature names to emulators from latest iteration
get_summary_statistics
emulator_bank.EmulatorBank.get_summary_statistics()

Get summary statistics about the emulator bank.

Returns
Name Type Description
Dict Dict with summary information
has_emulator
emulator_bank.EmulatorBank.has_emulator(iteration, feature)

Check if an emulator exists for specific iteration and feature.

Parameters
Name Type Description Default
iteration int Iteration number required
feature str Feature name required
Returns
Name Type Description
bool True if emulator exists, False otherwise
has_emulators
emulator_bank.EmulatorBank.has_emulators()

Check if any emulators exist in the bank.

Returns
Name Type Description
bool True if any emulators exist, False otherwise
load_from_directory
emulator_bank.EmulatorBank.load_from_directory(directory_path)

Load emulators from disk.

Parameters
Name Type Description Default
directory_path str Directory containing saved emulators required
remove_emulator
emulator_bank.EmulatorBank.remove_emulator(iteration, feature)

Remove a specific emulator.

Parameters
Name Type Description Default
iteration int Iteration number required
feature str Feature name required
Returns
Name Type Description
bool True if emulator was removed, False if not found
remove_iteration
emulator_bank.EmulatorBank.remove_iteration(iteration)

Remove all emulators for a specific iteration.

Parameters
Name Type Description Default
iteration int Iteration number to remove required
save_to_directory
emulator_bank.EmulatorBank.save_to_directory(directory_path)

Save all emulators to disk.

Parameters
Name Type Description Default
directory_path str Directory to save emulators in required
summary
emulator_bank.EmulatorBank.summary()

Human-readable summary: emulators stored, by wave and feature.