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

restore dose-unit endpoint values to endpoint list #729

Merged
merged 27 commits into from
Nov 9, 2022
Merged

Conversation

shapiromatron
Copy link
Owner

@shapiromatron shapiromatron commented Nov 9, 2022

#704 simplified how endpoint list views were generated, but we removed the JS implementation of the views which simplified the data which was available for the view. This PR restores the original view, where dose-unit specific data (NOEL, LOEL, BMD, and BMDL) are presented for each endpoint.

We implement by a custom database query, so we don't need to build the whole JS instance of the object, but instead query for what's needed. The end result is a faster view, though we lose the desirable caching properties of the serialized objects.

@shapiromatron shapiromatron changed the base branch from main to prefilters November 9, 2022 04:43
Copy link
Collaborator

@munnsmunns munnsmunns left a comment

Choose a reason for hiding this comment

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

Looks good Andy!

Base automatically changed from prefilters to main November 9, 2022 16:46
@rabstejnek rabstejnek changed the base branch from main to dual-screening-wf November 9, 2022 16:50
@rabstejnek rabstejnek changed the base branch from dual-screening-wf to main November 9, 2022 16:51
# Conflicts:
#	hawc/apps/animal/filterset.py
#	hawc/apps/animal/templates/animal/endpoint_list.html
#	hawc/apps/animal/views.py
#	hawc/apps/epi/filterset.py
#	hawc/apps/epi/views.py
#	hawc/apps/epimeta/filterset.py
#	hawc/apps/epimeta/views.py
#	hawc/apps/invitro/filterset.py
#	hawc/apps/invitro/views.py
@@ -104,9 +104,51 @@ def by_dose_regime(self, dose_regime):
return self.filter(dose_regime=dose_regime)


class EndpointQuerySet(QuerySet):
def annotate_dose_values(self, dose_units: Optional[DoseUnits] = None) -> QuerySet:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reaaaallly cool!

@shapiromatron shapiromatron merged commit 981accd into main Nov 9, 2022
@shapiromatron shapiromatron deleted the loel-lists branch November 9, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants