Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Add passing_users to course summary #170

Merged
merged 1 commit into from
May 24, 2017
Merged

Add passing_users to course summary #170

merged 1 commit into from
May 24, 2017

Conversation

efischer19
Copy link
Contributor

EDU-153

This feels too easy - am I missing something?

@codecov-io
Copy link

codecov-io commented May 22, 2017

Codecov Report

Merging #170 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #170      +/-   ##
==========================================
+ Coverage   97.85%   97.85%   +<.01%     
==========================================
  Files          54       54              
  Lines        3119     3129      +10     
  Branches      234      236       +2     
==========================================
+ Hits         3052     3062      +10     
  Misses         42       42              
  Partials       25       25
Impacted Files Coverage Δ
analytics_data_api/v0/models.py 99.3% <100%> (ø) ⬆️
analytics_data_api/v0/views/course_summaries.py 98.36% <100%> (+0.08%) ⬆️
...s_data_api/v0/tests/views/test_course_summaries.py 100% <100%> (ø) ⬆️
analytics_data_api/v0/serializers.py 94.46% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a85c45...bdc0c95. Read the comment docs.

Copy link
Contributor

@dsjen dsjen left a comment

Choose a reason for hiding this comment

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

Yep! It really is just about that simple. We typically want to try to add some local "fake" data for testing too. You'll see an example at https://github.com/edx/edx-analytics-data-api/blob/master/analytics_data_api/management/commands/generate_fake_course_data.py#L167.

Thanks!

@dsjen
Copy link
Contributor

dsjen commented May 23, 2017

I just realized that we probably want to ensure that the exclude field can be used to exclude the passing_users field from the payload in both the top level and in the enrollment modes, since this functionality will be turned on later. Please let me know if that doesn't make sense!

@efischer19
Copy link
Contributor Author

No problem, I'll get that added this afternoon

count = int(ratio * daily_total)
pass_rate = min(random.normalvariate(.45 + (.1 * index), .15), 1.0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I utilize index here so we can get a higher pass rate for verified than we have for audit (scales with position in `enrollment_mode_ratios); is that overly complex for this data?

I also just guessed at the baseline pass rates (from 45% for audit up to 85% for verified), LMK if there's a more accurate value we ought to use.

Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

self.generate_data()
response = self.authenticated_get(self.path(exclude=[field]))
self.assertEquals(response.status_code, 200)
self.assertEquals(str(response.data).count(field), 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

self.assertNotIn(field, response.data) only works for the top-level (cumulative) field, not the per-mode field. This ensures the field is not present anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@dsjen dsjen left a comment

Choose a reason for hiding this comment

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

LGTM! Don't forget to add your name to AUTHORS though. 💯

count = int(ratio * daily_total)
pass_rate = min(random.normalvariate(.45 + (.1 * index), .15), 1.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

self.generate_data()
response = self.authenticated_get(self.path(exclude=[field]))
self.assertEquals(response.status_code, 200)
self.assertEquals(str(response.data).count(field), 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@@ -120,6 +121,10 @@ def postprocess_field_dict(self, field_dict):
# don't do expensive looping for programs if we are just going to throw it away
field_dict = self.add_programs(field_dict)

for field in self.exclude:
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for taking care of that!

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