Skip to content

Conversation

davner
Copy link
Member

@davner davner commented Oct 21, 2025

  • Added target ID to form data in GPPModel's createTooObservation method.
  • Updated test suite for GPPTooViewSet to remove deprecated tests and add new tests for observing mode properties.
  • Refactored GMOS North and South Long Slit serializers to include nested structure for inputs.
  • Simplified tests for CloneTargetSerializer and CloneObservationSerializer, focusing on essential fields.
  • Introduced new tests for ObservingModeSerializer and SiderealSerializer to ensure validation and serialization logic.
  • Corrected code and unit tests to reflect changes in field names from 'unit' to 'units' in brightness tests.
  • Removed obsolete test files for CloneObservation and CloneTarget.

Checklist

  • Added a release note in doc/changes using the PR number.

@davner davner self-assigned this Oct 21, 2025
@davner davner requested a review from Copilot October 21, 2025 21:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements payload building functionality for creating Target of Opportunity (ToO) observations in GPP. The changes refactor serializers to use nested data structures, introduce new serializers for sidereal targets and observing modes, and update tests to reflect changes in field names and API structure. Key functionality includes appending target IDs to form data and properly structuring instrument-specific configurations.

  • Introduced SiderealSerializer and ObservingModeSerializer for handling target and observing mode properties
  • Refactored GMOS serializers to wrap validated data in instrument-specific keys (gmos_north_long_slit, gmos_south_long_slit)
  • Updated field name from 'unit' to 'units' throughout brightness-related code

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/goats_tom/static/js/gpp/gpp.js Adds target ID to form data in createTooObservation method
src/goats_tom/serializers/gpp/sidereal.py New serializer for sidereal target properties with validation
src/goats_tom/serializers/gpp/observing_mode.py New serializer for observing mode input with instrument registry integration
src/goats_tom/serializers/gpp/instruments/registry.py Simplified registry by removing input model mapping functionality
src/goats_tom/serializers/gpp/instruments/gmos_*.py Added nested structure wrapping for validated data
src/goats_tom/serializers/gpp/clone_target.py Simplified to only handle target ID validation
src/goats_tom/serializers/gpp/clone_observation.py Added scienceRequirements field to validated data
src/goats_tom/serializers/gpp/brightnesses.py Changed field name from 'unit' to 'units' and added debug print
src/goats_tom/api_views/gpp/toos.py Refactored to use new serializers and added debug print statements
tests/goats_tom/serializers/gpp/test_*.py Updated tests for new serializer behavior and field name changes
tests/goats_tom/api_views/gpp/test_toos.py Removed deprecated tests and added new tests for observing mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 82.96296% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.63%. Comparing base (c919750) to head (a6522dc).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/goats_tom/api_views/gpp/toos.py 25.80% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #467      +/-   ##
==========================================
- Coverage   78.91%   78.63%   -0.29%     
==========================================
  Files         264      269       +5     
  Lines        8390     8504     +114     
  Branches      490      493       +3     
==========================================
+ Hits         6621     6687      +66     
- Misses       1680     1727      +47     
- Partials       89       90       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- Add target ID to form data in GPPModel's createTooObservation method.
- Update test suite for GPPTooViewSet to remove deprecated tests and add new tests for observing mode properties.
- Refactor GMOS North and South Long Slit serializers to include nested structure for inputs.
- Correct code and unit tests to reflect changes in field names from 'unit' to 'units' in brightness tests.
- Remove obsolete test files for CloneObservation and CloneTarget.
@davner davner force-pushed the GOATS-985_GOATS-987/build-payload-add-goats-target-id branch from c63eef5 to adc9747 Compare October 21, 2025 21:48
@davner davner merged commit 8aa53b9 into main Oct 21, 2025
1 check passed
@davner davner deleted the GOATS-985_GOATS-987/build-payload-add-goats-target-id branch October 21, 2025 21:49
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.

1 participant