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

[FEATURE] Object Mutability Consistency #308

Open
4 tasks done
e-lo opened this issue Nov 29, 2022 · 3 comments · May be fixed by #327
Open
4 tasks done

[FEATURE] Object Mutability Consistency #308

e-lo opened this issue Nov 29, 2022 · 3 comments · May be fixed by #327
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@e-lo
Copy link
Collaborator

e-lo commented Nov 29, 2022

User Story

As a user I'd like to have a consistent expectation about if I am modifying an object in-place or creating a mutated copy.

Status

  • Defined
  • Planned
  • Implemented
  • Tested

Context

Right now, there is are public methods in roadway and transit network objects that:

  • mutate the object in-place
  • return the mutated object
  • have an option to do either

This inconsistency in the API has caused lots of confusion and bugs.

Resolution Ideas

Add and implement the following design principle:

  • Public methods of the transit and roadway networks should always return a copied, mutated form of the network object

Priority

High

Level of Effort

Low

Project

Is there a funder or project associated with this feature?

Who should be involved?

Implementer:
Commenters:
Users:
Reviewers:

Risk

Will this potentially break anything?

Tests

What are relevant tests or what tests need to be created in order to determine that this issue is complete?

@e-lo e-lo added the enhancement New feature or request label Nov 29, 2022
@e-lo e-lo added this to the v1.0 milestone Nov 29, 2022
@e-lo e-lo self-assigned this Nov 29, 2022
@e-lo
Copy link
Collaborator Author

e-lo commented Nov 30, 2022

Update: will test performance of deep copy on a real-size network to evaluate if this is an ok default.

@e-lo
Copy link
Collaborator Author

e-lo commented Dec 6, 2022

Performance: Copying the instance of the full bay area network takes a little over than a second.

image

@lmz @DavidOry thoughts?

@DavidOry
Copy link
Member

DavidOry commented Dec 7, 2022

Well that's encouraging. Perhaps we create another issue to remind us to test this once version 1 is released, but for now move ahead with your original plan?

@e-lo e-lo linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants