-
Notifications
You must be signed in to change notification settings - Fork 75
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
Refactor subroles #1196
base: master
Are you sure you want to change the base?
Refactor subroles #1196
Conversation
@benjello is this the intented definition and use of subroles or am I missing something? |
>>> from openfisca_core import entities | ||
|
||
>>> entity = entities.GroupEntity("person", "", "", "", {}) | ||
>>> role = entities.Role({"key": "sorority"}, entity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sorority example is not very clear to me.
Examples: | ||
>>> from openfisca_core import entities | ||
|
||
>>> entity = entities.GroupEntity("person", "", "", "", {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The group entity is not clear here.
Depends on #1197
New features
SubRole
.Discussion
Currently, roles and subroles coexist and are used interchangeably, as
instances of the
Role
data model. This is very confusing, as the only thingthey have in common is the
key
attribute, shared with every other data modelin the
entities
module. By declaringSubRole
as an independent data modelfrom
Role
, we can make the distinction between the two clearer, improvingreadability, maintenance, debugging, and eventual extensibility of both.