-
Notifications
You must be signed in to change notification settings - Fork 4
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
Conversation
…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
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 |
There was a problem hiding this comment.
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?
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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) |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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
* Misc cleanup/alignment with Django conventions * Allow writes to scoring DB * Fix opening transaction in scoringdb * Default to rgd db in db write router
I resolved the merge conflicts so that the new UI and endpoints associated with the new UI should work properly. |
There was a problem hiding this 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 👍
No description provided.