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

Proposals for T&E scoring db #392

Merged
merged 27 commits into from
Jun 3, 2024
Merged

Proposals for T&E scoring db #392

merged 27 commits into from
Jun 3, 2024

Conversation

JHUAPL-hjg1
Copy link
Collaborator

No description provided.

JHUAPL and others added 20 commits April 9, 2024 08:50
…s_scoring

# Conflicts:
#	django/src/rdwatch_scoring/models/__init__.py
#	django/src/rdwatch_scoring/models/annotation_proposal_site.py
#	django/src/rdwatch_scoring/views/model_run.py
#	django/src/rdwatch_scoring/views/observation.py
#	django/src/rdwatch_scoring/views/site_image.py
# Conflicts:
#	vue/src/mapstyle/rdwatchtiles.ts
#	vue/vite.config.ts
Comment on lines 99 to 120
if proposal:
site_observations = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id, sensor_name=baseConstellation
).count()

site_db_model = AnnotationProposalSite
baseSiteEval = AnnotationProposalSite.objects.get(pk=site_eval_id)
geometry = baseSiteEval.geometry
else:
site_observations = Observation.objects.filter(
site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = Observation.objects.filter(
site_uuid=site_eval_id, sensor=baseConstellation
).count()

site_db_model = Site
baseSiteEval = Site.objects.get(pk=site_eval_id)
geometry = baseSiteEval.union_geometry
Copy link
Contributor

Choose a reason for hiding this comment

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

In the interest of keeping the get_siteobservations_images API the same between the rdwatch and rdwatch_scoring apps, would something like this work?

Suggested change
if proposal:
site_observations = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id, sensor_name=baseConstellation
).count()
site_db_model = AnnotationProposalSite
baseSiteEval = AnnotationProposalSite.objects.get(pk=site_eval_id)
geometry = baseSiteEval.geometry
else:
site_observations = Observation.objects.filter(
site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = Observation.objects.filter(
site_uuid=site_eval_id, sensor=baseConstellation
).count()
site_db_model = Site
baseSiteEval = Site.objects.get(pk=site_eval_id)
geometry = baseSiteEval.union_geometry
try:
site_db_model = AnnotationProposalSite
baseSiteEval = AnnotationProposalSite.objects.get(pk=site_eval_id)
geometry = baseSiteEval.geometry
site_observations = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = AnnotationProposalObservation.objects.filter(
annotation_proposal_site_uuid=site_eval_id, sensor_name=baseConstellation
).count()
except AnnotationProposalSite.DoesNotExist:
site_db_model = Site
baseSiteEval = Site.objects.get(pk=site_eval_id)
geometry = baseSiteEval.union_geometry
site_observations = Observation.objects.filter(
site_uuid=site_eval_id
) # need a full list for min/max times
site_obs_count = Observation.objects.filter(
site_uuid=site_eval_id, sensor=baseConstellation
).count()

Any thoughts @JHUAPL-hjg1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mvandenburgh What's the benefit of keeping the get_siteobservations_images API the same?
proposal was added as a parameter to almost all endpoints and functions for scoring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pushed an update to address this: 5f73568

Comment on lines 393 to 399
def cancel_generate_images_task(model_run_uuid: UUID4, proposal: bool) -> None:
if proposal:
sites = AnnotationProposalSite.objects.filter(
annotation_proposal_set_uuid=model_run_uuid
)
else:
sites = Site.objects.filter(evaluation_run_uuid=model_run_uuid)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here about removing the proposal arg to avoid changing the function signature.

Suggested change
def cancel_generate_images_task(model_run_uuid: UUID4, proposal: bool) -> None:
if proposal:
sites = AnnotationProposalSite.objects.filter(
annotation_proposal_set_uuid=model_run_uuid
)
else:
sites = Site.objects.filter(evaluation_run_uuid=model_run_uuid)
def cancel_generate_images_task(model_run_uuid: UUID4) -> None:
sites = AnnotationProposalSite.objects.filter(
annotation_proposal_set_uuid=model_run_uuid
)
if not sites.exists():
sites = Site.objects.filter(evaluation_run_uuid=model_run_uuid)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Pushed an update to address this: 5f73568

mvandenburgh and others added 5 commits April 18, 2024 12:49
* Misc cleanup/alignment with Django conventions

* Allow writes to scoring DB

* Fix opening transaction in scoringdb

* Default to rgd db in db write router
@BryonLewis
Copy link
Contributor

I resolved the merge conflicts so that the new UI and endpoints associated with the new UI should work properly.
There are some minor remaining issues that I created a new Issue for these: #431
They can be addressed in a new PR.
I've tested the basics of downloading, viewing editing polygons and label activities and they seem to work.
I suggest someone else make an additional pass on the functionality in this PR.

Copy link
Contributor

@mvandenburgh mvandenburgh left a comment

Choose a reason for hiding this comment

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

I merged the latest main in and tested this locally. I had to push one minor change to fix the vector tile endpoint since it got changed since this PR was opened, but besides that LGTM 👍

@mvandenburgh mvandenburgh merged commit 9c04440 into main Jun 3, 2024
8 checks passed
@mvandenburgh mvandenburgh deleted the proposals_scoring branch June 3, 2024 23:44
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.

None yet

3 participants