Skip to content

fix: correct meeting attendance calculations#4536

Merged
rjsparks merged 10 commits intoietf-tools:mainfrom
rjsparks:attended_grooming
Oct 13, 2022
Merged

fix: correct meeting attendance calculations#4536
rjsparks merged 10 commits intoietf-tools:mainfrom
rjsparks:attended_grooming

Conversation

@rjsparks
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 30, 2022

Codecov Report

Merging #4536 (d1373c3) into main (2981242) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head d1373c3 differs from pull request most recent head d5bae3d. Consider uploading reports for the commit d5bae3d to get more accurate results

@@            Coverage Diff             @@
##             main    #4536      +/-   ##
==========================================
- Coverage   88.44%   88.43%   -0.01%     
==========================================
  Files         296      296              
  Lines       39701    39683      -18     
==========================================
- Hits        35112    35094      -18     
  Misses       4589     4589              
Impacted Files Coverage Δ
ietf/stats/views.py 88.75% <ø> (ø)
ietf/meeting/models.py 87.08% <100.00%> (+0.04%) ⬆️
ietf/stats/utils.py 54.00% <100.00%> (+0.19%) ⬆️
ietf/doc/views_search.py 89.02% <0.00%> (-0.42%) ⬇️
ietf/submit/forms.py 82.70% <0.00%> (ø)
ietf/nomcom/utils.py 91.28% <0.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Copy Markdown
Collaborator

@rpcross rpcross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider that some people register (and attend) both onsite and remote. Some 40+ examples in 114. Usually people who registered one-day onsite. In this case total unique attendees would be less than onsite attendees + remote attendees.

Comment thread ietf/meeting/models.py Outdated
if number is None or number < 110:
return None
Attendance = namedtuple('Attendance', 'onsite online')
Attendance = namedtuple('Attendance', 'onsite online') # TODO: these should probably be 'onsite remote'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with TODO comment, 'remote' matches the identifier in the Registration system

Comment thread ietf/meeting/models.py Outdated
meetingregistration__attended=True,
meetingregistration__reg_type__contains='remote',
).distinct().count(),
onsite=attended.filter(meetingregistration__reg_type='onsite').count(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inaccurate as it will include Persons with 'onsite' registrations for previous meetings

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - the test in 8549cd0 demonstrates this.

@jennifer-richards
Copy link
Copy Markdown
Member

jennifer-richards commented Oct 6, 2022

Consider that some people register (and attend) both onsite and remote. Some 40+ examples in 114. Usually people who registered one-day onsite. In this case total unique attendees would be less than onsite attendees + remote attendees.

What is the best way to report this? Is the complexity of adding a total unique attendees in addition to onsite/remote warranted or would it be adequate to, say, count someone as onsite if they were onsite at all?

Edit: in the current implementation, someone who registered both for online and remote will be counted in both bins.

Comment thread ietf/meeting/models.py
@rjsparks rjsparks marked this pull request as ready for review October 11, 2022 16:02
@rjsparks
Copy link
Copy Markdown
Member Author

Input from the IETF Chair and Secretariat: They would like anyone who attended in person to only be counted as an in-person attendee even if they also registered/attended remotely.

Copy link
Copy Markdown
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving - one possible change to consider and take or leave.

Comment thread ietf/meeting/models.py
).distinct()

onsite=set(attended.filter(meetingregistration__meeting=self, meetingregistration__reg_type='onsite'))
remote=set(attended.filter(meetingregistration__meeting=self, meetingregistration__reg_type='remote'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to do the exclusion in the query and just pull the counts over to Python? I'm thinking something like:

  onsite = attended.filter(...type='onsite').count()
  remote = attended.filter(...type='remote').exclude(...type='onsite').count()

(I'm not sure if that's an improvement.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started there and it produced surprisingly wrong results. i have a dim memory that there is a bug in the stack that causes the sql query to fail - don't remember if the issue was in Django2 or in mysql. So I just avoided it for now, and I think the result is actually a little more readable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does trade off doing things in django's memory rather than the databases, but this isn't a performance crunchpoint.

@rjsparks rjsparks merged commit 6dd6165 into ietf-tools:main Oct 13, 2022
@rjsparks rjsparks deleted the attended_grooming branch October 13, 2022 15:56
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants