Skip to content

Chore/hawc-1169 merge bioassay branch#4

Draft
shanethacker wants to merge 30 commits intomainfrom
chore/HAWC-1169-merge-bioassay-branch
Draft

Chore/hawc-1169 merge bioassay branch#4
shanethacker wants to merge 30 commits intomainfrom
chore/HAWC-1169-merge-bioassay-branch

Conversation

@shanethacker
Copy link
Collaborator

This is for work concerning updating the bioassay code with the latest HAWC code and merging the bioassay code into main after testing.

DookTibs and others added 30 commits February 6, 2024 17:25
* initial animalv2 model declarations

* implement initial feedback items

* help text cleanup and TODO removals

* dose_group_id added

* updated animalv2 migration file

* fixed ruff formatting issue on animalv2 migration file

---------

Co-authored-by: Tom Feiler <tom.feiler@icf.com>
Co-authored-by: Andy Shapiro <shapiromatron@gmail.com>
* initial animalv2 model declarations

* implement initial feedback items

* help text cleanup and TODO removals

* dose_group_id added

* updated animalv2 migration file

* fixed ruff formatting issue on animalv2 migration file

* add animal_version flag to assessment

* enable basic UI functionality for animalv2 experiments

can we CRUD an Experiment; next step is to do a sub-object in htmx style.

* update experiment form to match mockup layout

* enable UI functionality for animalv2 chemicals

first sub-object in htmx style

* animalv2 tests first checkin

model tests (and a model update after finding a typo)

* additional animalv2 tests

* enable UI functionality for animalv2 animalgroups

* enable (partial) UI functionality for animalv2 treatments

note, dosegroups are not yet implemented for treatments.

* enable integrated subform UI functionality for dose groups associated with a treatment

* run `make format`

* implemented most feedback from draft PR

still having ruff-related formatting issues; resolving that before merging this into bioassay-v2.

* intentional format error introduction

troubleshooting ruff/CICD issues on my side

* removing intentional formatting errors

* switch test fixture back to animalv1 to avoid breaking existing integration tests

* implement endpoint UI

* implement observationtime UI

* implement DataExtraction UI

* move away from mutable argument default

* updated fixtures file with new animalv2 fields

* add additional test coverage for animalv2

modeled after epiv2. Not complete; hit hour cap.

* Update Animal V2 HTMX viewsets (#1048)

* update templates to new htmx pattern

* bring forward crud_url change

* fix some url issues

* condense htmx viewset urls

* fix template issues

* merge with main, use common templates

* fix data extraction url

* format

* html format

* fix animalv2 test helper

* add formset handling to shared _object_edit_row template

* fix study detail merge

* indent

* cleanup after merge

* fix spacing diff

* remove old template artifact

* fix migrations

* update comments

* improve layout

* use smarter clone method name

* rename context variable

* fix htmx style editing for experiment updates

---------

Co-authored-by: Andy Shapiro <shapiro.andy@epa.gov>
Co-authored-by: Andy Shapiro <shapiromatron@gmail.com>

* change url from ani-bioassay to animal-bioassay

* move logic out of is_valid and into clean where possible

* remove extrajs from experiment form template

note - used only when initially creating experiment. When editing/associating
sub-objects, template is not even used.

* various minor reformatting/cleanup fixes

As per code review, stuff like:
* switching multiline imports back to single line where ruff allows
* backing out of unneeded reformatting changes
* comment cleanups
* etc.

(I think my ruff must have been misconfigured at some point, introducing
some of these errors)

* switch from hastext/safe to optional table row for comment display

* convert handcoded colgroup html to use the bs4 templatetag

* remove DoseGroupFormHelper and similars and switch to a common generic version

* collapse various aniv2 migrations into single cleaned up ones

* change v2_timepoints from prop to method and switch to standard Django get approach

* rework FormsetConfiguration as dataclass; add type hints and explanatory comments

* fix migrations

* htmx updates

* fix tests

* update test_forms

* cleanup type annotations and add TODO to comments

* add a feature flag

* review comments

* review JS

---------

Co-authored-by: Tom Feiler <tom.feiler@icf.com>
Co-authored-by: Andy Shapiro <shapiromatron@gmail.com>
Co-authored-by: Andy Shapiro <shapiro.andy@epa.gov>
Co-authored-by: Matt Munns <mmunns16@gmail.com>
Co-authored-by: casey1173 <caseyhansen1999@gmail.com>
* added study level value schema and migration

* added admin view and sample fixture value

* added CRUDL operations

* added animalv2 htmx and views unit tests

* updated table display and test case for update

* fix htmx_alert

* htmx updates

* update test

* update lists

* show values on study detail page

* few more comments from final review

* fix new test

---------

Co-authored-by: Berkowitz <55586@icf.com>
Co-authored-by: Casey Hansen <42587248+caseyhans@users.noreply.github.com>
Co-authored-by: casey1173 <caseyhansen1999@gmail.com>
Co-authored-by: Andy Shapiro <shapiromatron@gmail.com>
# Conflicts:
#	pyproject.toml
* animalv2 api

Implements API for all of the animalv2 model, including study level values.
Includes test coverage.

* adding aniv2 studylevelvalues to test fixture

seeing if this fixes the test in github env

* add migrations

* poe format

* reorder content types in fixture

* reduce content being returned by serializer

* cleanup some of boilerplate code

---------

Co-authored-by: Andy Shapiro <shapiro.andy@epa.gov>
* add guidelines and guideline profiles

* add obvervations to models

* update experiment and observation model

* add observation UI and logic

* Add experiment observations tab to sidebar

* update assessment form and toxrefdb text

* Add tests

* lint changes

* move Observation model from vocab to animalv2

* make enable observations false

* biome format

* minor edits to observation checks

* create a vocab.Guideline table

* refine vocab app; remove api for guidelines

* revert vocab changes

* use foreign key for guidelines

* remove ExperimentFilterList

* whoops; undo delete

* remove sidebar link

* add line to observations page

* refactor animalv2 observations

* format

* fix djhtml on windows

* use standard manager class

---------

Co-authored-by: 63080 <63080_icfcorp>
Co-authored-by: Andy Shapiro <shapiro.andy@epa.gov>
Co-authored-by: Andy Shapiro <shapiromatron@gmail.com>
Shared permission class that allows reads for any authenticated user
and writes for users who are team members or PMs on any assessment.
- Add UpdateModelMixin and DestroyModelMixin to Endpoint viewset
- Set http_method_names = METHODS_NO_PUT (PATCH only, no PUT)
- Add perform_update/perform_destroy with logging and cache busting
- Fix EndpointSerializer.validate to use self.instance.animal_group on update
- Skip name/name_term requirement on partial updates not touching those fields
- Add EndpointSerializer.update for nested groups/effects on PATCH
- Add ReferenceCreateSerializer for creating manual references
- Add CreateModelMixin to ReferenceViewSet with serializer switching
- Automatically links new references to the assessment's manual-import Search
- Enables two-step workflow: create reference, then create study from reference_id
- Add SpeciesViewSet with full CRUD and IsTeamMemberOrHigher permissions
- Expand StrainViewSet from LIST-only to full CRUD ModelViewSet
- Both use METHODS_NO_PUT (PATCH only, no PUT)
- Register species endpoint at /assessment/api/species/
- Add ObservationSerializer for the Observation model
- Add ObservationViewSet with EditPermissionsCheckMixin pattern
- Register at /animalv2/api/observation/
- Add CreateModelMixin to DoseUnitsViewSet
- Add IsTeamMemberOrHigher permission class
- Add GuidelineSerializer and GuidelineProfileSerializer
- Add GuidelineViewSet and GuidelineProfileViewSet with IsTeamMemberOrHigher perms
- Register at /vocab/api/guideline/ and /vocab/api/guideline-profile/
- AnimalClient: add update_endpoint, delete_endpoint
- LiteratureClient: add create_reference
- AssessmentClient: add list_species, create_species, list_strains,
  create_strain, create_dose_units
- VocabClient: add list_guidelines, create_guideline,
  list_guideline_profiles, create_guideline_profile
Tests for: endpoint update/delete, reference creation, species/strain/dose-units
CRUD, observation CRUD, and guideline/guideline-profile CRUD.
- Fix EndpointSerializer partial update validation: use existing instance
  values for fields not in PATCH data instead of hardcoded defaults
- Fix Observation test: use Term.objects.first() since Observation.endpoint
  is a FK to Term, not to animalv2.Endpoint
- Disable pagination on Guideline/GuidelineProfile viewsets (small lookup
  tables that should return flat lists)
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.

7 participants