Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive updated_copy() of nested components with path #1594

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Apr 10, 2024

Enables

new_simulation = simulation.updated_copy(size=new_size, path="structures/0/geometry")

to recursively perform

new_box = simulation.structures[i].geometry.updated_copy(size=new_size)
new_structure = simulation.structures[i].updated_copy(geometry=geometry)
new_structures = list(simulation.structures)
new_structures[i] = new_structure
new_simulation = simulation.updated_copy(structures=new_structures)

@tylerflex tylerflex added the 2.7 will go into version 2.7.* label Apr 10, 2024
@tylerflex tylerflex force-pushed the tyler/nested_copy branch 2 times, most recently from 52995d2 to 1f6b323 Compare April 10, 2024 03:44
@tylerflex tylerflex linked an issue Apr 10, 2024 that may be closed by this pull request
@momchil-flex momchil-flex merged commit 84b33be into pre/2.7 Apr 12, 2024
13 checks passed
@momchil-flex momchil-flex deleted the tyler/nested_copy branch April 12, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.7 will go into version 2.7.*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More convenient updated copy of nested fields
3 participants