Skip to content

For threshold + distinct threshold, why does the child connection type matter? #50

Open
@georgiashay

Description

@georgiashay

This bit of code is confusing to me:

for i, child in zip(range(num_progresses_to_count), open_children):
    satisfied_courses.update(satisfied_by_category[i])
    if child.statement.connection_type == CONNECTION_TYPE_ALL:
        num_courses_satisfied += (child.is_fulfilled and len(child.satisfied_courses) > 0)
    else:
        num_courses_satisfied += len(satisfied_by_category[i])

This means that children with connection type all can only ever contribute 1 course to satisfied courses, but children with connection type any can contribute as many courses as they have. I'm not totally understanding the logic here, because it seems in both case that any courses satisfying the children contribute to the parents regardless of child connection type. The current code leads to strange behavior where e.g. a parent demanding >= 4 subjects would not be satisfied by a child with 4 subjects if that child happened to be an "all" type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions