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

removed remote unit ids var from Relation #63

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

PietroPasotti
Copy link
Collaborator

@PietroPasotti PietroPasotti commented Oct 3, 2023

removed redundant remote unit ids (alternative constructor for remote relation data), legacy

before:
you could initialize a Relation with three remote units (empty databags) equivalently in one of two ways:

  • by passing remote_unit_ids=[1,3,5]
  • by passing remote_units_data={1:{}, 3:{}, 5:{}}

now:
remote_unit_ids is gone; only remote_units_data={1:{}, 3:{}, 5:{}} remains.

Why:

  • simpler API
  • simpler to determine when a relation is consistent (what if a user passes both?)
  • simpler to use the .replace() API: you don't have to replace both every time.

scenario/state.py Outdated Show resolved Hide resolved
@PietroPasotti PietroPasotti merged commit 8ee7720 into main Oct 3, 2023
2 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