Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions obsidian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
import obsidian.exceptions as exceptions
import obsidian.acquisition as acquisition
import obsidian.plotting as plotting
import obsidian.surrogates as surrogates
11 changes: 11 additions & 0 deletions obsidian/campaign/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,14 @@ def load_state(cls,
new_campaign.constrain_outputs(const)

return new_campaign

def copy(self):
"""
Creates a deep copy of the Campaign object.

A shortcut for saving and then loading the state. The presence of the torch objects prevents a direct deepcopy.

Returns:
Campaign: A deep copy of the Campaign object.
"""
return self.__class__.load_state(self.save_state())
Loading