Skip to content

Add campaign copy and fix missing surrogates module at the package level#94

Open
tautomer wants to merge 1 commit intoMSDLLCpapers:mainfrom
tautomer:campaign_copy
Open

Add campaign copy and fix missing surrogates module at the package level#94
tautomer wants to merge 1 commit intoMSDLLCpapers:mainfrom
tautomer:campaign_copy

Conversation

@tautomer
Copy link
Collaborator

A simple new method was added to 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())

basically just a short hand of save and then load for quick branching of the existing campaign.

import obsidian.surrogates as surrogates is added to the package level, so we will not see the following linter issues anymore. The modules works fine without this line, but completion and linting are totally broken.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant