Skip to content

Make deepcopy of config before modifying#22

Merged
keraJLi merged 5 commits intokeraJLi:mainfrom
TheodoreWolf:theo/fix-config-copy
May 26, 2025
Merged

Make deepcopy of config before modifying#22
keraJLi merged 5 commits intokeraJLi:mainfrom
TheodoreWolf:theo/fix-config-copy

Conversation

@TheodoreWolf
Copy link
Copy Markdown
Contributor

Problem

When initialising a new algo class for a second time, we can get an error due to agent_kwargs being modified in place.

Proposed solution

Add a deepcopy of the config before it is modified by the various algo classes. Also added a basic test case for this.

@keraJLi
Copy link
Copy Markdown
Owner

keraJLi commented May 22, 2025

Hi there! First of all, thank you for the pull request on #1.
I appreciate that you added tests for the changes! However, I think a more direct test would be to compare the input dictionary before and after creating the algorithm. Would you be able to change this? Otherwise, I can take care of it at a later date.
Cheers!

@TheodoreWolf
Copy link
Copy Markdown
Contributor Author

That makes sense! Will do :)

@keraJLi keraJLi merged commit 74a207f into keraJLi:main May 26, 2025
3 checks passed
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.

2 participants