gpp-client 26.5.1.dev2__tar.gz → 26.5.1.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/PKG-INFO +1 -1
  2. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/workflow_state.py +40 -27
  3. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/__init__.py +92 -14
  4. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/client.py +9 -0
  5. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/custom_fields.py +1177 -282
  6. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/custom_mutations.py +34 -0
  7. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/custom_queries.py +0 -12
  8. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/custom_typing_fields.py +148 -16
  9. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/enums.py +55 -17
  10. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/fragments.py +113 -0
  11. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_goats_observations.py +3 -3
  12. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/input_types.py +253 -25
  13. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/scheduler_observations_updates.py +26 -1
  14. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/.gitignore +0 -0
  15. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/LICENSE +0 -0
  16. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/README.md +0 -0
  17. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/graphql/README.md +0 -0
  18. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/pyproject.toml +0 -0
  19. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/__init__.py +0 -0
  20. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/__init__.py +0 -0
  21. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/cli.py +0 -0
  22. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/__init__.py +0 -0
  23. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/attachment.py +0 -0
  24. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/goats.py +0 -0
  25. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/observation.py +0 -0
  26. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/program.py +0 -0
  27. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/scheduler.py +0 -0
  28. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/site_status.py +0 -0
  29. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/target.py +0 -0
  30. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/commands/workflow_state.py +0 -0
  31. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/console.py +0 -0
  32. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/output.py +0 -0
  33. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/cli/utils.py +0 -0
  34. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/client.py +0 -0
  35. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/constants.py +0 -0
  36. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/__init__.py +0 -0
  37. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/atom.py +0 -0
  38. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/attachment.py +0 -0
  39. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/base.py +0 -0
  40. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/goats.py +0 -0
  41. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/observation.py +0 -0
  42. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/program.py +0 -0
  43. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/scheduler.py +0 -0
  44. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/site_status.py +0 -0
  45. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/domains/target.py +0 -0
  46. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/environment.py +0 -0
  47. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/exceptions.py +0 -0
  48. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/async_base_client.py +0 -0
  49. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/base_model.py +0 -0
  50. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/base_operation.py +0 -0
  51. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/clone_observation.py +0 -0
  52. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/clone_target.py +0 -0
  53. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_call_for_proposals.py +0 -0
  54. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_observation.py +0 -0
  55. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_program.py +0 -0
  56. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_target_by_program_id.py +0 -0
  57. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_target_by_program_reference.py +0 -0
  58. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/create_target_by_proposal_reference.py +0 -0
  59. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/delete_call_for_proposals_by_id.py +0 -0
  60. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/delete_observation_by_id.py +0 -0
  61. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/delete_observation_by_reference.py +0 -0
  62. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/delete_program_by_id.py +0 -0
  63. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/delete_target_by_id.py +0 -0
  64. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/exceptions.py +0 -0
  65. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_call_for_proposals.py +0 -0
  66. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_calls_for_proposals.py +0 -0
  67. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_goats_programs.py +0 -0
  68. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observation.py +0 -0
  69. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observation_attachments_by_id.py +0 -0
  70. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observation_attachments_by_reference.py +0 -0
  71. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observation_workflow_state_by_id.py +0 -0
  72. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observation_workflow_state_by_reference.py +0 -0
  73. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_observations.py +0 -0
  74. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_attachments_by_id.py +0 -0
  75. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_attachments_by_proposal_reference.py +0 -0
  76. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_attachments_by_reference.py +0 -0
  77. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_by_id.py +0 -0
  78. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_by_proposal_reference.py +0 -0
  79. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_program_by_reference.py +0 -0
  80. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_programs.py +0 -0
  81. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_scheduler_all_programs_id.py +0 -0
  82. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_scheduler_programs.py +0 -0
  83. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_target_by_id.py +0 -0
  84. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/get_targets.py +0 -0
  85. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/obs_calculation_update.py +0 -0
  86. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/observation_edit.py +0 -0
  87. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/package_environment.py +0 -0
  88. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/ping.py +0 -0
  89. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/program_edit.py +0 -0
  90. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/restore_call_for_proposals_by_id.py +0 -0
  91. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/restore_observation_by_id.py +0 -0
  92. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/restore_observation_by_reference.py +0 -0
  93. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/restore_program_by_id.py +0 -0
  94. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/restore_target_by_id.py +0 -0
  95. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/set_observation_workflow_state.py +0 -0
  96. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/target_edit.py +0 -0
  97. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_call_for_proposals_by_id.py +0 -0
  98. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_calls_for_proposals.py +0 -0
  99. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_observation_by_id.py +0 -0
  100. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_observation_by_reference.py +0 -0
  101. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_observations.py +0 -0
  102. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_program_by_id.py +0 -0
  103. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_programs.py +0 -0
  104. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_target_by_id.py +0 -0
  105. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/generated/update_targets.py +0 -0
  106. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/logging_utils.py +0 -0
  107. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/rest/__init__.py +0 -0
  108. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/rest/client.py +0 -0
  109. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/rest/utils.py +0 -0
  110. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/settings.py +0 -0
  111. {gpp_client-26.5.1.dev2 → gpp_client-26.5.1.dev3}/src/gpp_client/urls.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gpp-client
3
- Version: 26.5.1.dev2
3
+ Version: 26.5.1.dev3
4
4
  Summary: Gemini Program Platform client.
5
5
  Project-URL: Homepage, https://github.com/gemini-hlsw/gpp-client
6
6
  Project-URL: Source, https://github.com/gemini-hlsw/gpp-client
@@ -6,17 +6,20 @@ __all__ = ["WorkflowStateDomain"]
6
6
 
7
7
  import asyncio
8
8
  import logging
9
- from typing import Any
10
9
 
11
10
  from gpp_client.domains.base import BaseDomain
12
11
  from gpp_client.exceptions import GPPClientError, GPPRetryableError, GPPValidationError
13
12
  from gpp_client.generated.enums import CalculationState, ObservationWorkflowState
14
13
  from gpp_client.generated.get_observation_workflow_state_by_id import (
15
14
  GetObservationWorkflowStateById,
15
+ GetObservationWorkflowStateByIdObservationWorkflow,
16
16
  )
17
17
  from gpp_client.generated.get_observation_workflow_state_by_reference import (
18
18
  GetObservationWorkflowStateByReference,
19
19
  )
20
+ from gpp_client.generated.set_observation_workflow_state import (
21
+ SetObservationWorkflowStateSetObservationWorkflowState,
22
+ )
20
23
 
21
24
  logger = logging.getLogger(__name__)
22
25
 
@@ -73,7 +76,7 @@ class WorkflowStateDomain(BaseDomain):
73
76
  observation_id: str,
74
77
  *,
75
78
  workflow_state: ObservationWorkflowState,
76
- ) -> dict[str, Any]:
79
+ ) -> SetObservationWorkflowStateSetObservationWorkflowState:
77
80
  """
78
81
  Update the workflow state of an observation by its ID, or return the current
79
82
  workflow if already set.
@@ -95,8 +98,8 @@ class WorkflowStateDomain(BaseDomain):
95
98
 
96
99
  Returns
97
100
  -------
98
- dict[str, Any]
99
- The returned workflow state for the observation.
101
+ SetObservationWorkflowStateSetObservationWorkflowState
102
+ The workflow details for the observation after the operation.
100
103
 
101
104
  Raises
102
105
  ------
@@ -113,7 +116,7 @@ class WorkflowStateDomain(BaseDomain):
113
116
  workflow_state.value,
114
117
  )
115
118
  result = await self.get_by_id(observation_id=observation_id)
116
- workflow = result["workflow"]
119
+ workflow = result.observation.workflow
117
120
 
118
121
  # If calculation is not 'READY', raise an error to retry later.
119
122
  try:
@@ -121,25 +124,35 @@ class WorkflowStateDomain(BaseDomain):
121
124
  except RuntimeError as exc:
122
125
  self.raise_error(GPPRetryableError, exc)
123
126
 
124
- # If the desired state is already set, return as-is.
127
+ # If the desired state is already set, return the current workflow
128
+ # rebuilt as the mutation response model.
125
129
  if _check_already_set(workflow, workflow_state):
126
- # Return the same shape as other return paths.
127
130
  logger.debug(
128
131
  "Workflow state for observation ID %s is already %s; no update needed.",
129
132
  observation_id,
130
133
  workflow_state.value,
131
134
  )
132
- return workflow["value"]
135
+ return (
136
+ SetObservationWorkflowStateSetObservationWorkflowState.model_validate(
137
+ workflow.value.model_dump(by_alias=True)
138
+ )
139
+ )
133
140
  # Validate the requested workflow state against 'validTransitions'.
134
141
  try:
135
142
  _check_valid_transition(workflow, workflow_state)
136
143
  except ValueError as exc:
137
144
  self.raise_error(GPPValidationError, exc)
138
145
 
139
- return await self._graphql.set_observation_workflow_state(
146
+ mutation_result = await self._graphql.set_observation_workflow_state(
140
147
  observation_id=observation_id,
141
148
  state=workflow_state,
142
149
  )
150
+ payload = mutation_result.set_observation_workflow_state
151
+ if payload is None:
152
+ raise GPPClientError(
153
+ "GPP returned no payload for setObservationWorkflowState."
154
+ )
155
+ return payload
143
156
 
144
157
  async def update_by_id_with_retry(
145
158
  self,
@@ -149,7 +162,7 @@ class WorkflowStateDomain(BaseDomain):
149
162
  max_attempts: int = 10,
150
163
  initial_delay: float = 0.0,
151
164
  retry_delay: float = 1.0,
152
- ) -> dict[str, Any]:
165
+ ) -> SetObservationWorkflowStateSetObservationWorkflowState:
153
166
  """
154
167
  Update the workflow state of an observation by its ID, retrying if the
155
168
  observation is not ready.
@@ -172,8 +185,8 @@ class WorkflowStateDomain(BaseDomain):
172
185
 
173
186
  Returns
174
187
  -------
175
- dict[str, Any]
176
- The returned workflow state for the observation.
188
+ SetObservationWorkflowStateSetObservationWorkflowState
189
+ The workflow details for the observation after the operation.
177
190
 
178
191
  Raises
179
192
  ------
@@ -216,30 +229,30 @@ class WorkflowStateDomain(BaseDomain):
216
229
  self.raise_error(type(exc), exc)
217
230
 
218
231
 
219
- def _check_ready(workflow: dict[str, Any]) -> None:
232
+ def _check_ready(workflow: GetObservationWorkflowStateByIdObservationWorkflow) -> None:
220
233
  """
221
234
  Raise an error if the observation calculation is not in the ``READY`` state.
222
235
 
223
236
  Parameters
224
237
  ----------
225
- workflow : dict[str, Any]
226
- The workflow data structure returned by ``get_by_id()``.
238
+ workflow : GetObservationWorkflowStateByIdObservationWorkflow
239
+ The workflow Pydantic model returned by ``get_by_id().observation.workflow``.
227
240
 
228
241
  Raises
229
242
  ------
230
243
  RuntimeError
231
244
  If the calculation state is not ``READY``.
232
245
  """
233
- if workflow["state"] != CalculationState.READY.value:
246
+ if workflow.state != CalculationState.READY:
234
247
  raise RuntimeError(
235
248
  "Observation calculation is not READY (current state: "
236
- f"{workflow['state']}). Please retry after background processing "
249
+ f"{workflow.state.value}). Please retry after background processing "
237
250
  "is complete."
238
251
  )
239
252
 
240
253
 
241
254
  def _check_already_set(
242
- workflow: dict[str, Any],
255
+ workflow: GetObservationWorkflowStateByIdObservationWorkflow,
243
256
  workflow_state: ObservationWorkflowState,
244
257
  ) -> bool:
245
258
  """
@@ -247,8 +260,8 @@ def _check_already_set(
247
260
 
248
261
  Parameters
249
262
  ----------
250
- workflow : dict[str, Any]
251
- The workflow data structure returned by ``get_by_id()``.
263
+ workflow : GetObservationWorkflowStateByIdObservationWorkflow
264
+ The workflow Pydantic model returned by ``get_by_id().observation.workflow``.
252
265
  workflow_state : ObservationWorkflowState
253
266
  The desired workflow state.
254
267
 
@@ -258,11 +271,11 @@ def _check_already_set(
258
271
  ``True`` if the current workflow state matches the desired state,
259
272
  otherwise ``False``.
260
273
  """
261
- return workflow["value"]["state"] == workflow_state.value
274
+ return workflow.value.state == workflow_state
262
275
 
263
276
 
264
277
  def _check_valid_transition(
265
- workflow: dict[str, Any],
278
+ workflow: GetObservationWorkflowStateByIdObservationWorkflow,
266
279
  workflow_state: ObservationWorkflowState,
267
280
  ) -> None:
268
281
  """
@@ -270,8 +283,8 @@ def _check_valid_transition(
270
283
 
271
284
  Parameters
272
285
  ----------
273
- workflow : dict[str, Any]
274
- The workflow data structure returned by ``get_by_id()``.
286
+ workflow : GetObservationWorkflowStateByIdObservationWorkflow
287
+ The workflow Pydantic model returned by ``get_by_id().observation.workflow``.
275
288
  workflow_state : ObservationWorkflowState
276
289
  The desired workflow state to transition to.
277
290
 
@@ -281,9 +294,9 @@ def _check_valid_transition(
281
294
  If the requested transition is not allowed based on
282
295
  ``validTransitions``.
283
296
  """
284
- valid_transitions = workflow["value"].get("validTransitions", [])
285
- if workflow_state.value not in valid_transitions:
286
- valid_str = ", ".join(valid_transitions) or "None"
297
+ valid_transitions = workflow.value.valid_transitions or []
298
+ if workflow_state not in valid_transitions:
299
+ valid_str = ", ".join(t.value for t in valid_transitions) or "None"
287
300
  raise ValueError(
288
301
  f"Cannot transition to '{workflow_state.value}'. "
289
302
  f"Valid transitions are: {valid_str}."
@@ -78,6 +78,7 @@ from .enums import (
78
78
  AtomStage,
79
79
  AttachmentType,
80
80
  Band,
81
+ BasePositionType,
81
82
  BlindOffsetType,
82
83
  Breakpoint,
83
84
  BrightnessIntegratedUnits,
@@ -103,7 +104,6 @@ from .enums import (
103
104
  ExecutionEventType,
104
105
  ExecutionState,
105
106
  Existence,
106
- FilterType,
107
107
  Flamingos2CustomSlitWidth,
108
108
  Flamingos2Decker,
109
109
  Flamingos2Disperser,
@@ -126,6 +126,7 @@ from .enums import (
126
126
  GhostBinning,
127
127
  GhostIfu1FiberAgitator,
128
128
  GhostIfu2FiberAgitator,
129
+ GhostIfuMappingType,
129
130
  GhostReadMode,
130
131
  GhostResolutionMode,
131
132
  GmosAmpCount,
@@ -136,7 +137,6 @@ from .enums import (
136
137
  GmosDtax,
137
138
  GmosEOffsetting,
138
139
  GmosGratingOrder,
139
- GmosImagingVariantType,
140
140
  GmosLongSlitAcquisitionRoi,
141
141
  GmosNorthBuiltinFpu,
142
142
  GmosNorthDetector,
@@ -149,8 +149,11 @@ from .enums import (
149
149
  GmosSouthFilter,
150
150
  GmosSouthGrating,
151
151
  GmosSouthStageMode,
152
+ GnirsAcquisitionType,
152
153
  GnirsCamera,
154
+ GnirsDecker,
153
155
  GnirsFilter,
156
+ GnirsFpuOther,
154
157
  GnirsFpuSlit,
155
158
  GnirsGrating,
156
159
  GnirsPrism,
@@ -160,9 +163,9 @@ from .enums import (
160
163
  GuideState,
161
164
  HiiRegionSpectrum,
162
165
  Ignore,
163
- Igrins2OffsetMode,
164
166
  ImageQualityPreset,
165
167
  ImagingCapability,
168
+ ImagingVariantType,
166
169
  Instrument,
167
170
  ItcType,
168
171
  LineFluxIntegratedUnits,
@@ -194,6 +197,7 @@ from .enums import (
194
197
  Site,
195
198
  SkyBackground,
196
199
  SlewStage,
200
+ SlitOffsetMode,
197
201
  SmartGcalType,
198
202
  SpectroscopyCapability,
199
203
  StellarLibrarySpectrum,
@@ -266,6 +270,21 @@ from .fragments import (
266
270
  GmosSouthLongSlitDetails,
267
271
  GmosSouthLongSlitDetailsCentralWavelength,
268
272
  GmosSouthLongSlitDetailsOffsets,
273
+ Igrins2LongSlitAndVisitorOnObservingMode,
274
+ Igrins2LongSlitAndVisitorOnObservingModeIgrins2LongSlit,
275
+ Igrins2LongSlitAndVisitorOnObservingModeVisitor,
276
+ Igrins2LongSlitDetails,
277
+ Igrins2LongSlitDetailsDefaultOffsets,
278
+ Igrins2LongSlitDetailsDefaultOffsetsP,
279
+ Igrins2LongSlitDetailsDefaultOffsetsQ,
280
+ Igrins2LongSlitDetailsExplicitOffsets,
281
+ Igrins2LongSlitDetailsExplicitOffsetsP,
282
+ Igrins2LongSlitDetailsExplicitOffsetsQ,
283
+ Igrins2LongSlitDetailsExposureTimeMode,
284
+ Igrins2LongSlitDetailsOffsets,
285
+ Igrins2LongSlitDetailsOffsetsP,
286
+ Igrins2LongSlitDetailsOffsetsQ,
287
+ Igrins2LongSlitDetailsTelluricType,
269
288
  NonsiderealTargetDetails,
270
289
  ObservationCore,
271
290
  ObservationCoreReference,
@@ -333,6 +352,10 @@ from .fragments import (
333
352
  TimingWindowDetailsEndTimingWindowEndAfterRepeat,
334
353
  TimingWindowDetailsEndTimingWindowEndAfterRepeatPeriod,
335
354
  TimingWindowDetailsEndTimingWindowEndAt,
355
+ VisitorDetails,
356
+ VisitorDetailsAgsDiameter,
357
+ VisitorDetailsCentralWavelength,
358
+ VisitorDetailsTotalRequestTime,
336
359
  WorkflowCore,
337
360
  WorkflowDetails,
338
361
  WorkflowDetailsValue,
@@ -795,6 +818,7 @@ from .input_types import (
795
818
  DeclinationInput,
796
819
  DeleteProgramUserInput,
797
820
  DeleteProposalInput,
821
+ DeleteSequenceInput,
798
822
  DemoScienceInput,
799
823
  DirectorsTimeInput,
800
824
  EditAsterismsPatchInput,
@@ -811,6 +835,8 @@ from .input_types import (
811
835
  Flamingos2CustomMaskInput,
812
836
  Flamingos2DynamicInput,
813
837
  Flamingos2FpuMaskInput,
838
+ Flamingos2ImagingFilterInput,
839
+ Flamingos2ImagingInput,
814
840
  Flamingos2LongSlitAcquisitionInput,
815
841
  Flamingos2LongSlitInput,
816
842
  Flamingos2StaticInput,
@@ -823,9 +849,6 @@ from .input_types import (
823
849
  GhostIfuInput,
824
850
  GmosCcdModeInput,
825
851
  GmosCustomMaskInput,
826
- GmosGroupedImagingVariantInput,
827
- GmosImagingVariantInput,
828
- GmosInterleavedImagingVariantInput,
829
852
  GmosNodAndShuffleInput,
830
853
  GmosNorthAtomInput,
831
854
  GmosNorthDynamicInput,
@@ -837,7 +860,6 @@ from .input_types import (
837
860
  GmosNorthLongSlitInput,
838
861
  GmosNorthStaticInput,
839
862
  GmosNorthStepInput,
840
- GmosPreImagingVariantInput,
841
863
  GmosSouthAtomInput,
842
864
  GmosSouthDynamicInput,
843
865
  GmosSouthFpuInput,
@@ -848,7 +870,14 @@ from .input_types import (
848
870
  GmosSouthLongSlitInput,
849
871
  GmosSouthStaticInput,
850
872
  GmosSouthStepInput,
873
+ GnirsAcquisitionMirrorOutInput,
874
+ GnirsAtomInput,
875
+ GnirsDynamicInput,
876
+ GnirsLongSlitAcquisitionInput,
877
+ GnirsLongSlitInput,
878
+ GnirsStepInput,
851
879
  GoaPropertiesInput,
880
+ GroupedImagingVariantInput,
852
881
  GroupEditInput,
853
882
  GroupElementInput,
854
883
  GroupPropertiesInput,
@@ -859,6 +888,8 @@ from .input_types import (
859
888
  Igrins2StaticInput,
860
889
  Igrins2StepInput,
861
890
  ImagingScienceRequirementsInput,
891
+ ImagingVariantInput,
892
+ InterleavedImagingVariantInput,
862
893
  LargeProgramInput,
863
894
  LineFluxIntegratedInput,
864
895
  LineFluxSurfaceInput,
@@ -877,6 +908,7 @@ from .input_types import (
877
908
  PartnerSplitInput,
878
909
  PoorWeatherInput,
879
910
  PosAngleConstraintInput,
911
+ PreImagingVariantInput,
880
912
  ProgramEditInput,
881
913
  ProgramNotePropertiesInput,
882
914
  ProgramPropertiesInput,
@@ -908,11 +940,13 @@ from .input_types import (
908
940
  ReplaceFlamingos2SequenceInput,
909
941
  ReplaceGmosNorthSequenceInput,
910
942
  ReplaceGmosSouthSequenceInput,
943
+ ReplaceGnirsSequenceInput,
911
944
  ReplaceIgrins2SequenceInput,
912
945
  ResetAcquisitionInput,
913
946
  RevokeUserInvitationInput,
914
947
  RightAscensionArcInput,
915
948
  RightAscensionInput,
949
+ SchedulingConstraintsInput,
916
950
  ScienceRequirementsInput,
917
951
  SetAllocationsInput,
918
952
  SetGuideTargetNameInput,
@@ -922,6 +956,7 @@ from .input_types import (
922
956
  SiderealInput,
923
957
  SignalToNoiseExposureTimeModeInput,
924
958
  SiteCoordinateLimitsInput,
959
+ SlitTelescopeConfigsInput,
925
960
  SourceProfileInput,
926
961
  SpectralDefinitionIntegratedInput,
927
962
  SpectralDefinitionSurfaceInput,
@@ -934,6 +969,7 @@ from .input_types import (
934
969
  TargetEditInput,
935
970
  TargetEnvironmentInput,
936
971
  TargetPropertiesInput,
972
+ TelescopeConfigAlongSlitInput,
937
973
  TelescopeConfigGeneratorInput,
938
974
  TelescopeConfigInput,
939
975
  TelluricTypeInput,
@@ -1142,12 +1178,15 @@ from .scheduler_observations_updates import (
1142
1178
  SchedulerObservationsUpdates,
1143
1179
  SchedulerObservationsUpdatesObscalcUpdate,
1144
1180
  SchedulerObservationsUpdatesObscalcUpdateValue,
1181
+ SchedulerObservationsUpdatesObscalcUpdateValueConstraintSet,
1145
1182
  SchedulerObservationsUpdatesObscalcUpdateValueExecution,
1146
1183
  SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisits,
1147
1184
  SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatches,
1148
1185
  SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesAtomRecords,
1149
1186
  SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesAtomRecordsMatches,
1150
1187
  SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesObservation,
1188
+ SchedulerObservationsUpdatesObscalcUpdateValueWorkflow,
1189
+ SchedulerObservationsUpdatesObscalcUpdateValueWorkflowValue,
1151
1190
  )
1152
1191
  from .set_observation_workflow_state import (
1153
1192
  SetObservationWorkflowState,
@@ -1231,6 +1270,7 @@ __all__ = [
1231
1270
  "BandNormalizedIntegratedInput",
1232
1271
  "BandNormalizedSurfaceInput",
1233
1272
  "BaseModel",
1273
+ "BasePositionType",
1234
1274
  "BlindOffsetType",
1235
1275
  "Breakpoint",
1236
1276
  "BrightnessIntegratedUnits",
@@ -1329,6 +1369,7 @@ __all__ = [
1329
1369
  "DeleteProgramByIdUpdateProgramsProgramsAllGroupElementsObservation",
1330
1370
  "DeleteProgramUserInput",
1331
1371
  "DeleteProposalInput",
1372
+ "DeleteSequenceInput",
1332
1373
  "DeleteTargetById",
1333
1374
  "DeleteTargetByIdUpdateTargets",
1334
1375
  "DeleteTargetByIdUpdateTargetsTargets",
@@ -1367,7 +1408,6 @@ __all__ = [
1367
1408
  "ExposureTimeModeDetailsTimeAndCountTime",
1368
1409
  "ExposureTimeModeInput",
1369
1410
  "FastTurnaroundInput",
1370
- "FilterType",
1371
1411
  "Flamingos2AtomInput",
1372
1412
  "Flamingos2CustomMaskInput",
1373
1413
  "Flamingos2CustomSlitWidth",
@@ -1377,6 +1417,8 @@ __all__ = [
1377
1417
  "Flamingos2Filter",
1378
1418
  "Flamingos2Fpu",
1379
1419
  "Flamingos2FpuMaskInput",
1420
+ "Flamingos2ImagingFilterInput",
1421
+ "Flamingos2ImagingInput",
1380
1422
  "Flamingos2LongSlitAcquisitionInput",
1381
1423
  "Flamingos2LongSlitDetails",
1382
1424
  "Flamingos2LongSlitDetailsAcquisition",
@@ -1800,6 +1842,7 @@ __all__ = [
1800
1842
  "GhostIfu1FiberAgitator",
1801
1843
  "GhostIfu2FiberAgitator",
1802
1844
  "GhostIfuInput",
1845
+ "GhostIfuMappingType",
1803
1846
  "GhostReadMode",
1804
1847
  "GhostResolutionMode",
1805
1848
  "GmosAmpCount",
@@ -1812,10 +1855,6 @@ __all__ = [
1812
1855
  "GmosDtax",
1813
1856
  "GmosEOffsetting",
1814
1857
  "GmosGratingOrder",
1815
- "GmosGroupedImagingVariantInput",
1816
- "GmosImagingVariantInput",
1817
- "GmosImagingVariantType",
1818
- "GmosInterleavedImagingVariantInput",
1819
1858
  "GmosLongSlitAcquisitionRoi",
1820
1859
  "GmosNodAndShuffleInput",
1821
1860
  "GmosNorthAtomInput",
@@ -1838,7 +1877,6 @@ __all__ = [
1838
1877
  "GmosNorthStageMode",
1839
1878
  "GmosNorthStaticInput",
1840
1879
  "GmosNorthStepInput",
1841
- "GmosPreImagingVariantInput",
1842
1880
  "GmosRoi",
1843
1881
  "GmosSouthAtomInput",
1844
1882
  "GmosSouthBuiltinFpu",
@@ -1860,12 +1898,21 @@ __all__ = [
1860
1898
  "GmosSouthStageMode",
1861
1899
  "GmosSouthStaticInput",
1862
1900
  "GmosSouthStepInput",
1901
+ "GnirsAcquisitionMirrorOutInput",
1902
+ "GnirsAcquisitionType",
1903
+ "GnirsAtomInput",
1863
1904
  "GnirsCamera",
1905
+ "GnirsDecker",
1906
+ "GnirsDynamicInput",
1864
1907
  "GnirsFilter",
1908
+ "GnirsFpuOther",
1865
1909
  "GnirsFpuSlit",
1866
1910
  "GnirsGrating",
1911
+ "GnirsLongSlitAcquisitionInput",
1912
+ "GnirsLongSlitInput",
1867
1913
  "GnirsPrism",
1868
1914
  "GnirsReadMode",
1915
+ "GnirsStepInput",
1869
1916
  "GnirsWellDepth",
1870
1917
  "GoaPropertiesInput",
1871
1918
  "GraphQLClient",
@@ -1877,6 +1924,7 @@ __all__ = [
1877
1924
  "GroupEditInput",
1878
1925
  "GroupElementInput",
1879
1926
  "GroupPropertiesInput",
1927
+ "GroupedImagingVariantInput",
1880
1928
  "GuideProbe",
1881
1929
  "GuideState",
1882
1930
  "HiiRegionSpectrum",
@@ -1884,14 +1932,31 @@ __all__ = [
1884
1932
  "Ignore",
1885
1933
  "Igrins2AtomInput",
1886
1934
  "Igrins2DynamicInput",
1935
+ "Igrins2LongSlitAndVisitorOnObservingMode",
1936
+ "Igrins2LongSlitAndVisitorOnObservingModeIgrins2LongSlit",
1937
+ "Igrins2LongSlitAndVisitorOnObservingModeVisitor",
1938
+ "Igrins2LongSlitDetails",
1939
+ "Igrins2LongSlitDetailsDefaultOffsets",
1940
+ "Igrins2LongSlitDetailsDefaultOffsetsP",
1941
+ "Igrins2LongSlitDetailsDefaultOffsetsQ",
1942
+ "Igrins2LongSlitDetailsExplicitOffsets",
1943
+ "Igrins2LongSlitDetailsExplicitOffsetsP",
1944
+ "Igrins2LongSlitDetailsExplicitOffsetsQ",
1945
+ "Igrins2LongSlitDetailsExposureTimeMode",
1946
+ "Igrins2LongSlitDetailsOffsets",
1947
+ "Igrins2LongSlitDetailsOffsetsP",
1948
+ "Igrins2LongSlitDetailsOffsetsQ",
1949
+ "Igrins2LongSlitDetailsTelluricType",
1887
1950
  "Igrins2LongSlitInput",
1888
- "Igrins2OffsetMode",
1889
1951
  "Igrins2StaticInput",
1890
1952
  "Igrins2StepInput",
1891
1953
  "ImageQualityPreset",
1892
1954
  "ImagingCapability",
1893
1955
  "ImagingScienceRequirementsInput",
1956
+ "ImagingVariantInput",
1957
+ "ImagingVariantType",
1894
1958
  "Instrument",
1959
+ "InterleavedImagingVariantInput",
1895
1960
  "ItcType",
1896
1961
  "LargeProgramInput",
1897
1962
  "LineFluxIntegratedInput",
@@ -1997,6 +2062,7 @@ __all__ = [
1997
2062
  "PortDisposition",
1998
2063
  "PosAngleConstraintInput",
1999
2064
  "PosAngleConstraintMode",
2065
+ "PreImagingVariantInput",
2000
2066
  "ProgramCore",
2001
2067
  "ProgramDetail",
2002
2068
  "ProgramDetailActive",
@@ -2052,6 +2118,7 @@ __all__ = [
2052
2118
  "ReplaceFlamingos2SequenceInput",
2053
2119
  "ReplaceGmosNorthSequenceInput",
2054
2120
  "ReplaceGmosSouthSequenceInput",
2121
+ "ReplaceGnirsSequenceInput",
2055
2122
  "ReplaceIgrins2SequenceInput",
2056
2123
  "ResetAcquisitionInput",
2057
2124
  "RestoreCallForProposalsById",
@@ -2081,12 +2148,16 @@ __all__ = [
2081
2148
  "SchedulerObservationsUpdates",
2082
2149
  "SchedulerObservationsUpdatesObscalcUpdate",
2083
2150
  "SchedulerObservationsUpdatesObscalcUpdateValue",
2151
+ "SchedulerObservationsUpdatesObscalcUpdateValueConstraintSet",
2084
2152
  "SchedulerObservationsUpdatesObscalcUpdateValueExecution",
2085
2153
  "SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisits",
2086
2154
  "SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatches",
2087
2155
  "SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesAtomRecords",
2088
2156
  "SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesAtomRecordsMatches",
2089
2157
  "SchedulerObservationsUpdatesObscalcUpdateValueExecutionVisitsMatchesObservation",
2158
+ "SchedulerObservationsUpdatesObscalcUpdateValueWorkflow",
2159
+ "SchedulerObservationsUpdatesObscalcUpdateValueWorkflowValue",
2160
+ "SchedulingConstraintsInput",
2090
2161
  "ScienceBand",
2091
2162
  "ScienceMode",
2092
2163
  "ScienceRequirementsDetails",
@@ -2111,6 +2182,8 @@ __all__ = [
2111
2182
  "SiteCoordinateLimitsInput",
2112
2183
  "SkyBackground",
2113
2184
  "SlewStage",
2185
+ "SlitOffsetMode",
2186
+ "SlitTelescopeConfigsInput",
2114
2187
  "SmartGcalType",
2115
2188
  "SourceProfileInput",
2116
2189
  "SpectralDefinitionIntegratedInput",
@@ -2152,6 +2225,7 @@ __all__ = [
2152
2225
  "TargetProgramSummary",
2153
2226
  "TargetProgramSummaryProgram",
2154
2227
  "TargetPropertiesInput",
2228
+ "TelescopeConfigAlongSlitInput",
2155
2229
  "TelescopeConfigGeneratorInput",
2156
2230
  "TelescopeConfigGeneratorType",
2157
2231
  "TelescopeConfigInput",
@@ -2222,6 +2296,10 @@ __all__ = [
2222
2296
  "UserSuppliedEphemeris",
2223
2297
  "UserSuppliedEphemerisElement",
2224
2298
  "UserType",
2299
+ "VisitorDetails",
2300
+ "VisitorDetailsAgsDiameter",
2301
+ "VisitorDetailsCentralWavelength",
2302
+ "VisitorDetailsTotalRequestTime",
2225
2303
  "VisitorInput",
2226
2304
  "VisitorObservingModeType",
2227
2305
  "WaterVapor",
@@ -111,6 +111,15 @@ class GraphQLClient(AsyncBaseClient):
111
111
  value {
112
112
  id
113
113
  observationTime
114
+ constraintSet {
115
+ cloudExtinction
116
+ imageQuality
117
+ }
118
+ workflow {
119
+ value {
120
+ state
121
+ }
122
+ }
114
123
  execution {
115
124
  visits {
116
125
  matches {