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

Develop #280

Merged
merged 9 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data_aggregator/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/dao.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/management/commands/_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/management/commands/_mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/management/commands/create_and_run_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/management/commands/create_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/management/commands/run_jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
11 changes: 6 additions & 5 deletions data_aggregator/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down Expand Up @@ -767,7 +767,8 @@ def get_subaccount_activity(self, sis_term_id=None, week_num=None):
prefetch = Prefetch(
"subaccountactivity_set",
queryset=SubaccountActivity.objects.filter(
Q(subaccount_id__startswith="uwcourse")
Q(subaccount_id__startswith="uwcourse"),
~Q(subaccount_id__endswith="nqpilot")
).order_by("subaccount_id"),
to_attr="subaccounts")

Expand Down Expand Up @@ -874,10 +875,10 @@ def adoption_rate(self):
try:
rate = round(
((active_courses - active_ind_study_courses) /
(courses - xlist_courses - ind_study_courses -
xlist_ind_study_courses)) * 100, ndigits=2)
(courses - xlist_courses - ind_study_courses +
xlist_ind_study_courses)) * 100, ndigits=1)
except ZeroDivisionError:
rate = 0.00
rate = 0.0

return rate

Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/report_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/db_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_analytics_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_assignment_view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_dao.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_jobs_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_management_commands.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_metadata_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
10 changes: 5 additions & 5 deletions data_aggregator/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down Expand Up @@ -845,24 +845,24 @@ def test_get_subaccount_activity(self):
subaccount = report.subaccounts[0]
self.assertEqual(subaccount.term_id, term)
self.assertEqual(subaccount.subaccount_id, "uwcourse:tacoma")
self.assertEqual(subaccount.adoption_rate(), 30.14)
self.assertEqual(subaccount.adoption_rate(), 30.0)

subaccount = report.subaccounts[1]
self.assertEqual(subaccount.term_id, term)
self.assertEqual(
subaccount.subaccount_id, "uwcourse:tacoma:test-college")
self.assertEqual(subaccount.adoption_rate(), 96.15)
self.assertEqual(subaccount.adoption_rate(), 95.2)

subaccount = report.subaccounts[2]
self.assertEqual(subaccount.term_id, term)
self.assertEqual(
subaccount.subaccount_id,
"uwcourse:tacoma:test-college:test-department")
self.assertEqual(subaccount.adoption_rate(), 73.78)
self.assertEqual(subaccount.adoption_rate(), 73.8)
self.assertEqual(subaccount.csv_export_data(), [
"2013-spring", 10, "uwcourse:tacoma:test-college:test-department",
"Test Department", "Tacoma", "Test College", "Test Department",
73.78, 199, 122, 33, 1, 2, 0, 54, 21, 678, 528, 12, 631, 3, 8,
73.8, 199, 122, 33, 1, 2, 0, 54, 21, 678, 528, 12, 631, 3, 8,
65, 786, 453, 678, 2, 23, 456, 776, 900, 4, 41, 33, 77, 76, 98])


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_pages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_participation_view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_rad_view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
8 changes: 4 additions & 4 deletions data_aggregator/tests/test_report_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down Expand Up @@ -223,14 +223,14 @@ def test_generate_report_csv(self):
"conferences_views,discussions_views,files_views,general_views,"
"grades_views,groups_views,modules_views,other_views,pages_views,"
"quizzes_views\n"
"2013-spring,10,uwcourse:tacoma,Tacoma,Tacoma,,,30.14,595,151,91,"
"2013-spring,10,uwcourse:tacoma,Tacoma,Tacoma,,,30.0,595,151,91,"
"3,12,1,1154,1121,11678,11528,1112,11631,113,118,1165,11786,11453,"
"11678,112,1123,11456,11776,11900,114,1141,1133,1177,1176,1198\n"
"2013-spring,10,uwcourse:tacoma:test-college,College of Test,"
"Tacoma,Test College,,96.15,268,202,51,2,8,1,154,121,1678,1528,"
"Tacoma,Test College,,95.2,268,202,51,2,8,1,154,121,1678,1528,"
"112,1631,13,18,165,1786,1453,1678,12,123,1456,1776,1900,14,141,"
"133,177,176,198\n"
"2013-spring,10,uwcourse:tacoma:test-college:test-department,"
"Test Department,Tacoma,Test College,Test Department,73.78,199,"
"Test Department,Tacoma,Test College,Test Department,73.8,199,"
"122,33,1,2,0,54,21,678,528,12,631,3,8,65,786,453,678,2,23,456,"
"776,900,4,41,33,77,76,98\n"))
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_threading.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/test_utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/tests/view_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/threads.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0

from django.urls import re_path
Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/api/analytics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/api/jobs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/api/metadata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion data_aggregator/views/pages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 UW-IT, University of Washington
# Copyright 2025 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0


Expand Down