across-client 0.1.dev50__py3-none-any.whl
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.
- across/__init__.py +21 -0
- across/client/__init__.py +3 -0
- across/client/_version.py +34 -0
- across/client/apis/__init__.py +17 -0
- across/client/apis/filter.py +66 -0
- across/client/apis/instrument.py +68 -0
- across/client/apis/observation.py +136 -0
- across/client/apis/observatory.py +77 -0
- across/client/apis/schedule.py +217 -0
- across/client/apis/telescope.py +78 -0
- across/client/apis/tools.py +68 -0
- across/client/client.py +138 -0
- across/client/core/__init__.py +0 -0
- across/client/core/config.py +22 -0
- across/client/py.typed +0 -0
- across_client-0.1.dev50.dist-info/METADATA +310 -0
- across_client-0.1.dev50.dist-info/RECORD +20 -0
- across_client-0.1.dev50.dist-info/WHEEL +5 -0
- across_client-0.1.dev50.dist-info/licenses/LICENSE +201 -0
- across_client-0.1.dev50.dist-info/top_level.txt +1 -0
across/__init__.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
NASA Docket No. GSC-19,469-1, and identified as "Astrophysics Cross-Observatory
|
|
3
|
+
Science Support (ACROSS) System
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
11
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
13
|
+
specific language governing permissions and limitations under the License.“
|
|
14
|
+
|
|
15
|
+
Copyright © 2025 United States Government as represented by the Administrator
|
|
16
|
+
of the National Aeronautics and Space Administration and The Penn State
|
|
17
|
+
Research Foundation. All rights reserved. This software is licensed under the
|
|
18
|
+
Apache 2.0 License.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '0.1.dev50'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 'dev50')
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = None
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from .filter import Filter
|
|
2
|
+
from .instrument import Instrument
|
|
3
|
+
from .observation import Observation
|
|
4
|
+
from .observatory import Observatory
|
|
5
|
+
from .schedule import Schedule
|
|
6
|
+
from .telescope import Telescope
|
|
7
|
+
from .tools import VisibilityCalculator
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"Filter",
|
|
11
|
+
"Instrument",
|
|
12
|
+
"Observation",
|
|
13
|
+
"Observatory",
|
|
14
|
+
"Schedule",
|
|
15
|
+
"Telescope",
|
|
16
|
+
"VisibilityCalculator",
|
|
17
|
+
]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import across.sdk.v1 as sdk
|
|
2
|
+
from across.sdk.v1.api_client_wrapper import ApiClientWrapper
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Filter:
|
|
6
|
+
"""
|
|
7
|
+
Client for interacting with Filter resources in the Across API.
|
|
8
|
+
|
|
9
|
+
Provides methods to retrieve single or multiple filters
|
|
10
|
+
by ID, name, wavelength, or instrument information.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, across_client: ApiClientWrapper):
|
|
14
|
+
"""
|
|
15
|
+
Initialize an Instrument client.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
across_client (ApiClientWrapper):
|
|
19
|
+
API client wrapper used to make requests to the Across API.
|
|
20
|
+
"""
|
|
21
|
+
self.across_client = across_client
|
|
22
|
+
|
|
23
|
+
def get(self, id: str) -> sdk.Filter:
|
|
24
|
+
"""
|
|
25
|
+
Retrieve a single Filter by ID.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
id (str):
|
|
29
|
+
The unique identifier of the Filter to retrieve.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
sdk.Filter:
|
|
33
|
+
The requested Filter object.
|
|
34
|
+
"""
|
|
35
|
+
return sdk.FilterApi(self.across_client).get_filter_filter_id_get(filter_id=id)
|
|
36
|
+
|
|
37
|
+
def get_many(
|
|
38
|
+
self,
|
|
39
|
+
name: str | None = None,
|
|
40
|
+
covers_wavelength: float | None = None,
|
|
41
|
+
instrument_name: str | None = None,
|
|
42
|
+
instrument_id: str | None = None,
|
|
43
|
+
) -> list[sdk.Filter]:
|
|
44
|
+
"""
|
|
45
|
+
Retrieve multiple filters filtered by optional criteria.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
name (str | None, optional):
|
|
49
|
+
Filter by filter name.
|
|
50
|
+
covers_wavelength (float | none, optional):
|
|
51
|
+
Filter by filters that contain wavelength value.
|
|
52
|
+
instrument_name (str | None, optional):
|
|
53
|
+
Filter by telescinstrumentope name.
|
|
54
|
+
instrument_id (str | None, optional):
|
|
55
|
+
Filter by instrument ID.
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
list[sdk.Filter]:
|
|
59
|
+
A list of filters matching the given filters.
|
|
60
|
+
"""
|
|
61
|
+
return sdk.FilterApi(self.across_client).get_many_filter_get(
|
|
62
|
+
name=name,
|
|
63
|
+
covers_wavelength=covers_wavelength,
|
|
64
|
+
instrument_name=instrument_name,
|
|
65
|
+
instrument_id=instrument_id,
|
|
66
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import across.sdk.v1 as sdk
|
|
4
|
+
from across.sdk.v1.api_client_wrapper import ApiClientWrapper
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Instrument:
|
|
8
|
+
"""
|
|
9
|
+
Client for interacting with Instrument resources in the Across API.
|
|
10
|
+
|
|
11
|
+
Provides methods to retrieve single or multiple instrument
|
|
12
|
+
by ID, name, instrument information, or creation date.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, across_client: ApiClientWrapper):
|
|
16
|
+
"""
|
|
17
|
+
Initialize an Instrument client.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
across_client (ApiClientWrapper):
|
|
21
|
+
API client wrapper used to make requests to the Across API.
|
|
22
|
+
"""
|
|
23
|
+
self.across_client = across_client
|
|
24
|
+
|
|
25
|
+
def get(self, id: str) -> sdk.Instrument:
|
|
26
|
+
"""
|
|
27
|
+
Retrieve a single Instrument by ID.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
id (str):
|
|
31
|
+
The unique identifier of the Instrument to retrieve.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
sdk.Instrument:
|
|
35
|
+
The requested Instrument object.
|
|
36
|
+
"""
|
|
37
|
+
return sdk.InstrumentApi(self.across_client).get_instrument(instrument_id=id)
|
|
38
|
+
|
|
39
|
+
def get_many(
|
|
40
|
+
self,
|
|
41
|
+
name: str | None = None,
|
|
42
|
+
telescope_name: str | None = None,
|
|
43
|
+
telescope_id: str | None = None,
|
|
44
|
+
created_on: datetime | None = None,
|
|
45
|
+
) -> list[sdk.Instrument]:
|
|
46
|
+
"""
|
|
47
|
+
Retrieve multiple instruments filtered by optional criteria.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
name (str | None, optional):
|
|
51
|
+
Filter by instrument name.
|
|
52
|
+
telescope_name (str | None, optional):
|
|
53
|
+
Filter by telescope name.
|
|
54
|
+
telescope_id (str | None, optional):
|
|
55
|
+
Filter by telescope ID.
|
|
56
|
+
created_on (datetime | None, optional):
|
|
57
|
+
Filter by creation timestamp.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
list[sdk.Instrument]:
|
|
61
|
+
A list of instruments matching the given filters.
|
|
62
|
+
"""
|
|
63
|
+
return sdk.InstrumentApi(self.across_client).get_instruments(
|
|
64
|
+
name=name,
|
|
65
|
+
telescope_name=telescope_name,
|
|
66
|
+
telescope_id=telescope_id,
|
|
67
|
+
created_on=created_on,
|
|
68
|
+
)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import across.sdk.v1 as sdk
|
|
4
|
+
from across.sdk.v1.api_client_wrapper import ApiClientWrapper
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Observation:
|
|
8
|
+
"""
|
|
9
|
+
Client for interacting with Observation resources in the Across API.
|
|
10
|
+
|
|
11
|
+
Provides methods to retrieve single or multiple observations
|
|
12
|
+
by ID, name, observation information, or creation date.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, across_client: ApiClientWrapper):
|
|
16
|
+
"""
|
|
17
|
+
Initialize an Observation client.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
across_client (ApiClientWrapper):
|
|
21
|
+
API client wrapper used to make requests to the Across API.
|
|
22
|
+
"""
|
|
23
|
+
self.across_client = across_client
|
|
24
|
+
|
|
25
|
+
def get(self, id: str) -> sdk.Observation:
|
|
26
|
+
"""
|
|
27
|
+
Retrieve a single Observation by ID.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
id (str):
|
|
31
|
+
The unique identifier of the Observation to retrieve.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
sdk.Observation:
|
|
35
|
+
The requested Observation object.
|
|
36
|
+
"""
|
|
37
|
+
return sdk.ObservationApi(self.across_client).get_observation(observation_id=id)
|
|
38
|
+
|
|
39
|
+
def get_many(
|
|
40
|
+
self,
|
|
41
|
+
page: int | None = None,
|
|
42
|
+
page_limit: int | None = None,
|
|
43
|
+
external_id: str | None = None,
|
|
44
|
+
schedule_ids: list[str | None] | None = None,
|
|
45
|
+
observatory_ids: list[str] | None = None,
|
|
46
|
+
telescope_ids: list[str] | None = None,
|
|
47
|
+
instrument_ids: list[str] | None = None,
|
|
48
|
+
status: sdk.ObservationStatus | None = None,
|
|
49
|
+
proposal: str | None = None,
|
|
50
|
+
object_name: str | None = None,
|
|
51
|
+
date_range_begin: datetime | None = None,
|
|
52
|
+
date_range_end: datetime | None = None,
|
|
53
|
+
bandpass_min: float | None = None,
|
|
54
|
+
bandpass_max: float | None = None,
|
|
55
|
+
bandpass_type: sdk.WavelengthBandpass | sdk.EnergyBandpass | sdk.FrequencyBandpass | None = None,
|
|
56
|
+
cone_search_ra: float | None = None,
|
|
57
|
+
cone_search_dec: float | None = None,
|
|
58
|
+
cone_search_radius: float | None = None,
|
|
59
|
+
type: sdk.ObservationType | None = None,
|
|
60
|
+
depth_value: float | None = None,
|
|
61
|
+
depth_unit: sdk.DepthUnit | None = None,
|
|
62
|
+
) -> sdk.PageObservation:
|
|
63
|
+
"""
|
|
64
|
+
Retrieve multiple observations filtered by optional criteria.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
page (int | None):
|
|
68
|
+
Filter by pagination page
|
|
69
|
+
page_limit (int | None):
|
|
70
|
+
Filter by number of records per page
|
|
71
|
+
external_id (str | None):
|
|
72
|
+
Filter by an external identifier.
|
|
73
|
+
schedule_ids (list[str | None] | None):
|
|
74
|
+
Filter by one or more schedule IDs.
|
|
75
|
+
observatory_ids (list[str] | None):
|
|
76
|
+
Filter by one or more observatory IDs.
|
|
77
|
+
telescope_ids (list[str] | None):
|
|
78
|
+
Filter by one or more telescope IDs.
|
|
79
|
+
instrument_ids (list[str] | None):
|
|
80
|
+
Filter by one or more instrument IDs.
|
|
81
|
+
status (sdk.ObservationStatus | None):
|
|
82
|
+
Filter by observation status.
|
|
83
|
+
proposal (str | None):
|
|
84
|
+
Filter by proposal identifier or name.
|
|
85
|
+
object_name (str | None):
|
|
86
|
+
Filter by target object name.
|
|
87
|
+
date_range_begin (datetime | None):
|
|
88
|
+
Filter for observations starting on or after this date.
|
|
89
|
+
date_range_end (datetime | None):
|
|
90
|
+
Filter for observations ending on or before this date.
|
|
91
|
+
bandpass_min (float | None):
|
|
92
|
+
Minimum bandpass value (in the unit defined by `bandpass_type`).
|
|
93
|
+
bandpass_max (float | None):
|
|
94
|
+
Maximum bandpass value (in the unit defined by `bandpass_type`).
|
|
95
|
+
bandpass_type (sdk.WavelengthBandpass | sdk.EnergyBandpass | sdk.FrequencyBandpass | None):
|
|
96
|
+
Type of bandpass measurement (wavelength, energy, or frequency).
|
|
97
|
+
cone_search_ra (float | None):
|
|
98
|
+
Right Ascension (RA) for cone search, in degrees.
|
|
99
|
+
cone_search_dec (float | None):
|
|
100
|
+
Declination (Dec) for cone search, in degrees.
|
|
101
|
+
cone_search_radius (float | None):
|
|
102
|
+
Search radius for cone search, in degrees.
|
|
103
|
+
type (sdk.ObservationType | None):
|
|
104
|
+
Filter by observation type.
|
|
105
|
+
depth_value (float | None):
|
|
106
|
+
Sensitivity or depth threshold value.
|
|
107
|
+
depth_unit (sdk.DepthUnit | None):
|
|
108
|
+
Unit for `depth_value`.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
list[sdk.Observation]:
|
|
112
|
+
A list of observations matching the given filters.
|
|
113
|
+
"""
|
|
114
|
+
return sdk.ObservationApi(self.across_client).get_observations(
|
|
115
|
+
page=page,
|
|
116
|
+
page_limit=page_limit,
|
|
117
|
+
external_id=external_id,
|
|
118
|
+
schedule_ids=schedule_ids,
|
|
119
|
+
observatory_ids=observatory_ids,
|
|
120
|
+
telescope_ids=telescope_ids,
|
|
121
|
+
instrument_ids=instrument_ids,
|
|
122
|
+
status=status,
|
|
123
|
+
proposal=proposal,
|
|
124
|
+
object_name=object_name,
|
|
125
|
+
date_range_begin=date_range_begin,
|
|
126
|
+
date_range_end=date_range_end,
|
|
127
|
+
bandpass_min=bandpass_min,
|
|
128
|
+
bandpass_max=bandpass_max,
|
|
129
|
+
bandpass_type=bandpass_type,
|
|
130
|
+
cone_search_ra=cone_search_ra,
|
|
131
|
+
cone_search_dec=cone_search_dec,
|
|
132
|
+
cone_search_radius=cone_search_radius,
|
|
133
|
+
type=type,
|
|
134
|
+
depth_value=depth_value,
|
|
135
|
+
depth_unit=depth_unit,
|
|
136
|
+
)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import across.sdk.v1 as sdk
|
|
4
|
+
from across.sdk.v1.api_client_wrapper import ApiClientWrapper
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Observatory:
|
|
8
|
+
"""
|
|
9
|
+
Client for interacting with Observatory resources in the Across API.
|
|
10
|
+
|
|
11
|
+
Provides methods to retrieve single or multiple observatories
|
|
12
|
+
by ID, name, type, telescope information, ephemeris type, or
|
|
13
|
+
creation date.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self, across_client: ApiClientWrapper):
|
|
17
|
+
"""
|
|
18
|
+
Initialize an Observatory client.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
across_client (ApiClientWrapper):
|
|
22
|
+
API client wrapper used to make requests to the Across API.
|
|
23
|
+
"""
|
|
24
|
+
self.across_client = across_client
|
|
25
|
+
|
|
26
|
+
def get(self, id: str) -> sdk.Observatory:
|
|
27
|
+
"""
|
|
28
|
+
Retrieve a single Observatory by ID.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
id (str):
|
|
32
|
+
The unique identifier of the observatory to retrieve.
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
sdk.Observatory:
|
|
36
|
+
The requested observatory object.
|
|
37
|
+
"""
|
|
38
|
+
return sdk.ObservatoryApi(self.across_client).get_observatory(observatory_id=id)
|
|
39
|
+
|
|
40
|
+
def get_many(
|
|
41
|
+
self,
|
|
42
|
+
name: str | None = None,
|
|
43
|
+
type: sdk.ObservatoryType | None = None,
|
|
44
|
+
telescope_name: str | None = None,
|
|
45
|
+
telescope_id: str | None = None,
|
|
46
|
+
ephemeris_type: list[sdk.EphemerisType] | None = None,
|
|
47
|
+
created_on: datetime | None = None,
|
|
48
|
+
) -> list[sdk.Observatory]:
|
|
49
|
+
"""
|
|
50
|
+
Retrieve multiple observatories filtered by optional criteria.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
name (str | None, optional):
|
|
54
|
+
Filter by observatory name.
|
|
55
|
+
type (sdk.ObservatoryType | None, optional):
|
|
56
|
+
Filter by observatory type.
|
|
57
|
+
telescope_name (str | None, optional):
|
|
58
|
+
Filter by telescope name.
|
|
59
|
+
telescope_id (str | None, optional):
|
|
60
|
+
Filter by telescope ID.
|
|
61
|
+
ephemeris_type (list[sdk.EphemerisType] | None, optional):
|
|
62
|
+
Filter by one or more ephemeris types.
|
|
63
|
+
created_on (datetime | None, optional):
|
|
64
|
+
Filter by creation timestamp.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
list[sdk.Observatory]:
|
|
68
|
+
A list of observatories matching the given filters.
|
|
69
|
+
"""
|
|
70
|
+
return sdk.ObservatoryApi(self.across_client).get_observatories(
|
|
71
|
+
name=name,
|
|
72
|
+
type=type,
|
|
73
|
+
telescope_name=telescope_name,
|
|
74
|
+
telescope_id=telescope_id,
|
|
75
|
+
ephemeris_type=ephemeris_type,
|
|
76
|
+
created_on=created_on,
|
|
77
|
+
)
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
|
|
3
|
+
import across.sdk.v1 as sdk
|
|
4
|
+
from across.sdk.v1.api_client_wrapper import ApiClientWrapper
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Schedule:
|
|
8
|
+
"""
|
|
9
|
+
Client for interacting with Schedule resources in the Across API.
|
|
10
|
+
|
|
11
|
+
Provides methods to retrieve single or multiple schedules
|
|
12
|
+
by ID, name, instrument information, or creation date.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, across_client: ApiClientWrapper):
|
|
16
|
+
"""
|
|
17
|
+
Initialize an Schedule client.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
across_client (ApiClientWrapper):
|
|
21
|
+
API client wrapper used to make requests to the Across API.
|
|
22
|
+
"""
|
|
23
|
+
self.across_client = across_client
|
|
24
|
+
|
|
25
|
+
def get(self, id: str) -> sdk.Schedule:
|
|
26
|
+
"""
|
|
27
|
+
Retrieve a single Schedule by ID.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
id (str):
|
|
31
|
+
The unique identifier of the Schedule to retrieve.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
sdk.Schedule:
|
|
35
|
+
The requested Schedule object.
|
|
36
|
+
"""
|
|
37
|
+
return sdk.ScheduleApi(self.across_client).get_schedule(schedule_id=id)
|
|
38
|
+
|
|
39
|
+
def get_many(
|
|
40
|
+
self,
|
|
41
|
+
page: int | None = None,
|
|
42
|
+
page_limit: int | None = None,
|
|
43
|
+
date_range_begin: datetime | None = None,
|
|
44
|
+
date_range_end: datetime | None = None,
|
|
45
|
+
status: sdk.ScheduleStatus | None = None,
|
|
46
|
+
external_id: str | None = None,
|
|
47
|
+
fidelity: sdk.ScheduleFidelity | None = None,
|
|
48
|
+
created_on: datetime | None = None,
|
|
49
|
+
observatory_ids: list[str | None] | None = None,
|
|
50
|
+
observatory_names: list[str | None] | None = None,
|
|
51
|
+
telescope_ids: list[str | None] | None = None,
|
|
52
|
+
telescope_names: list[str | None] | None = None,
|
|
53
|
+
name: str | None = None,
|
|
54
|
+
include_observations: bool | None = None,
|
|
55
|
+
) -> sdk.PageSchedule:
|
|
56
|
+
"""
|
|
57
|
+
Retrieve all unique schedules filtered by optional criteria.
|
|
58
|
+
- unique is defined as the most-recently submitted schedule per
|
|
59
|
+
telescope in a specified date-range
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
page (int | None, optional):
|
|
63
|
+
Page number for paginated results.
|
|
64
|
+
page_limit (int | None, optional):
|
|
65
|
+
Maximum number of results to return per page.
|
|
66
|
+
date_range_begin (datetime | None, optional):
|
|
67
|
+
Filter for schedules starting on or after this date.
|
|
68
|
+
date_range_end (datetime | None, optional):
|
|
69
|
+
Filter for schedules ending on or before this date.
|
|
70
|
+
status (sdk.ScheduleStatus | None, optional):
|
|
71
|
+
Filter by schedule status.
|
|
72
|
+
external_id (str | None, optional):
|
|
73
|
+
Filter by external identifier.
|
|
74
|
+
fidelity (sdk.ScheduleFidelity | None, optional):
|
|
75
|
+
Filter by schedule fidelity level.
|
|
76
|
+
created_on (datetime | None, optional):
|
|
77
|
+
Filter by creation timestamp.
|
|
78
|
+
observatory_ids (list[str | None] | None, optional):
|
|
79
|
+
Filter by one or more observatory IDs.
|
|
80
|
+
observatory_names (list[UUID | None] | None, optional):
|
|
81
|
+
Filter by one or more observatory names.
|
|
82
|
+
telescope_ids (list[str | None] | None, optional):
|
|
83
|
+
Filter by one or more telescope IDs.
|
|
84
|
+
telescope_names (list[str | None] | None, optional):
|
|
85
|
+
Filter by one or more telescope names.
|
|
86
|
+
name (str | None, optional):
|
|
87
|
+
Filter by schedule name.
|
|
88
|
+
include_observations (bool | None, optional):
|
|
89
|
+
Include observations in returned schedules
|
|
90
|
+
(defaults to False)
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
sdk.PageSchedule:
|
|
94
|
+
A paginated collection of schedules matching the given filters.
|
|
95
|
+
"""
|
|
96
|
+
return sdk.ScheduleApi(self.across_client).get_schedules(
|
|
97
|
+
page=page,
|
|
98
|
+
page_limit=page_limit,
|
|
99
|
+
date_range_begin=date_range_begin,
|
|
100
|
+
date_range_end=date_range_end,
|
|
101
|
+
status=status,
|
|
102
|
+
external_id=external_id,
|
|
103
|
+
fidelity=fidelity,
|
|
104
|
+
created_on=created_on,
|
|
105
|
+
observatory_ids=observatory_ids,
|
|
106
|
+
observatory_names=observatory_names,
|
|
107
|
+
telescope_ids=telescope_ids,
|
|
108
|
+
telescope_names=telescope_names,
|
|
109
|
+
name=name,
|
|
110
|
+
include_observations=include_observations,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
def get_history(
|
|
114
|
+
self,
|
|
115
|
+
page: int | None = None,
|
|
116
|
+
page_limit: int | None = None,
|
|
117
|
+
date_range_begin: datetime | None = None,
|
|
118
|
+
date_range_end: datetime | None = None,
|
|
119
|
+
status: sdk.ScheduleStatus | None = None,
|
|
120
|
+
external_id: str | None = None,
|
|
121
|
+
fidelity: sdk.ScheduleFidelity | None = None,
|
|
122
|
+
created_on: datetime | None = None,
|
|
123
|
+
observatory_ids: list[str | None] | None = None,
|
|
124
|
+
observatory_names: list[str | None] | None = None,
|
|
125
|
+
telescope_ids: list[str | None] | None = None,
|
|
126
|
+
telescope_names: list[str | None] | None = None,
|
|
127
|
+
name: str | None = None,
|
|
128
|
+
include_observations: bool | None = None,
|
|
129
|
+
) -> sdk.PageSchedule:
|
|
130
|
+
"""
|
|
131
|
+
Retrieve all schedules filtered by optional criteria.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
page (int | None, optional):
|
|
135
|
+
Page number for paginated results.
|
|
136
|
+
page_limit (int | None, optional):
|
|
137
|
+
Maximum number of results to return per page.
|
|
138
|
+
date_range_begin (datetime | None, optional):
|
|
139
|
+
Filter for schedules starting on or after this date.
|
|
140
|
+
date_range_end (datetime | None, optional):
|
|
141
|
+
Filter for schedules ending on or before this date.
|
|
142
|
+
status (sdk.ScheduleStatus | None, optional):
|
|
143
|
+
Filter by schedule status.
|
|
144
|
+
external_id (str | None, optional):
|
|
145
|
+
Filter by external identifier.
|
|
146
|
+
fidelity (sdk.ScheduleFidelity | None, optional):
|
|
147
|
+
Filter by schedule fidelity level.
|
|
148
|
+
created_on (datetime | None, optional):
|
|
149
|
+
Filter by creation timestamp.
|
|
150
|
+
observatory_ids (list[str | None] | None, optional):
|
|
151
|
+
Filter by one or more observatory IDs.
|
|
152
|
+
observatory_names (list[str | None] | None, optional):
|
|
153
|
+
Filter by one or more observatory names.
|
|
154
|
+
telescope_ids (list[str | None] | None, optional):
|
|
155
|
+
Filter by one or more telescope IDs.
|
|
156
|
+
telescope_names (list[str | None] | None, optional):
|
|
157
|
+
Filter by one or more telescope names.
|
|
158
|
+
name (str | None, optional):
|
|
159
|
+
Filter by schedule name.
|
|
160
|
+
include_observations (bool | None, optional):
|
|
161
|
+
Include observations in returned schedules
|
|
162
|
+
(defaults to False)
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
sdk.PageSchedule:
|
|
166
|
+
A paginated collection of schedules matching the given filters.
|
|
167
|
+
"""
|
|
168
|
+
return sdk.ScheduleApi(self.across_client).get_schedules_history(
|
|
169
|
+
page=page,
|
|
170
|
+
page_limit=page_limit,
|
|
171
|
+
date_range_begin=date_range_begin,
|
|
172
|
+
date_range_end=date_range_end,
|
|
173
|
+
status=status,
|
|
174
|
+
external_id=external_id,
|
|
175
|
+
fidelity=fidelity,
|
|
176
|
+
created_on=created_on,
|
|
177
|
+
observatory_ids=observatory_ids,
|
|
178
|
+
observatory_names=observatory_names,
|
|
179
|
+
telescope_ids=telescope_ids,
|
|
180
|
+
telescope_names=telescope_names,
|
|
181
|
+
name=name,
|
|
182
|
+
include_observations=include_observations,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
def post(self, schedule: sdk.ScheduleCreate) -> str:
|
|
186
|
+
"""
|
|
187
|
+
Creates a schedule in the across api.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
schedule (sdk.ScheduleCreate):
|
|
191
|
+
a ScheduleCreate object with the following arguments:
|
|
192
|
+
telescope_id: StrictStr,
|
|
193
|
+
name: StrictStr,
|
|
194
|
+
date_range: DateRange,
|
|
195
|
+
status: ScheduleStatus,
|
|
196
|
+
external_id: StrictStr | None,
|
|
197
|
+
fidelity: ScheduleFidelity | None,
|
|
198
|
+
observations: List[ObservationCreate]
|
|
199
|
+
Returns:
|
|
200
|
+
schedule_id (str | uuid)
|
|
201
|
+
model id for the newly created schedule
|
|
202
|
+
"""
|
|
203
|
+
return sdk.ScheduleApi(self.across_client).create_schedule(schedule_create=schedule)
|
|
204
|
+
|
|
205
|
+
def post_many(self, schedules: sdk.ScheduleCreateMany) -> list[str]:
|
|
206
|
+
"""
|
|
207
|
+
Creates many schedules in the across api.
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
schedules (sdk.ScheduleCreateMany):
|
|
211
|
+
a ScheduleCreateMany object with the following arguments:
|
|
212
|
+
schedules: list[sdk.ScheduleCreate]
|
|
213
|
+
Returns:
|
|
214
|
+
list[str]
|
|
215
|
+
model ids for the newly created schedules
|
|
216
|
+
"""
|
|
217
|
+
return sdk.ScheduleApi(self.across_client).create_many_schedules(schedule_create_many=schedules)
|