-
-
Notifications
You must be signed in to change notification settings - Fork 423
ESA Euclid EUCLIDSWRQ-215 get_datalinks_metadata #3438
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
base: main
Are you sure you want to change the base?
Changes from all commits
9bbea59
91ea007
e11f753
fa21e76
671956f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1418,7 +1418,7 @@ def get_spectrum(self, *, source_id, schema='sedm', retrieval_type="ALL", output | |
|
||
return files | ||
|
||
def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', verbose=False): | ||
def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', options=None, verbose=False): | ||
"""Gets datalinks associated to the provided identifiers | ||
TAP+ only | ||
|
||
|
@@ -1428,6 +1428,8 @@ def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', verbose=False): | |
list of identifiers | ||
linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID | ||
By default, all the identifiers are considered as source_id | ||
options : str, optional, default None | ||
To let customize the server behaviour | ||
verbose : bool, optional, default 'False' | ||
flag to display information about the process | ||
|
||
|
@@ -1437,7 +1439,31 @@ def get_datalinks(self, ids, *, linking_parameter='SOURCE_ID', verbose=False): | |
|
||
""" | ||
|
||
return self.__eucliddata.get_datalinks(ids=ids, linking_parameter=linking_parameter, verbose=verbose) | ||
return self.__eucliddata.get_datalinks(ids=ids, | ||
linking_parameter=linking_parameter, | ||
options=options, | ||
verbose=verbose) | ||
|
||
def get_datalinks_metadata(self, ids, *, linking_parameter='SOURCE_ID', verbose=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why have this as a separate method rather than just documenting the one needs to have use |
||
"""Gets datalinks associated to the provided identifiers, including additional metadata (the datalabs_path) | ||
TAP+ only | ||
|
||
Parameters | ||
---------- | ||
ids : str, int, list of str or list of int, mandatory | ||
List of identifiers | ||
linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID | ||
By default, all the identifiers are considered as source_id | ||
verbose : bool, optional, default 'False' | ||
Flag to display information about the process | ||
|
||
Returns | ||
------- | ||
A table object | ||
|
||
""" | ||
|
||
return self.get_datalinks(ids=ids, linking_parameter=linking_parameter, options='METADATA', verbose=verbose) | ||
|
||
def get_scientific_product_list(self, *, observation_id=None, tile_index=None, category=None, group=None, | ||
product_type=None, dataset_release='REGREPROC1_R2', verbose=False): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1247,20 +1247,22 @@ def is_valid_user(self, *, user_id=None, verbose=False): | |
print(f"USER response = {user}") | ||
return user.startswith(f"{user_id}:") and user.count("\\n") == 0 | ||
|
||
def get_datalinks(self, ids, *, linking_parameter=None, verbose=False): | ||
def get_datalinks(self, ids, *, linking_parameter=None, options=None, verbose=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to be mentioned in the changelog |
||
"""Gets datalinks associated to the provided identifiers | ||
|
||
Parameters | ||
---------- | ||
ids : str list, mandatory | ||
list of identifiers | ||
List of identifiers | ||
linking_parameter : str, optional, default SOURCE_ID, valid values: SOURCE_ID, TRANSIT_ID, IMAGE_ID | ||
By default, all the identifiers are considered as source_id | ||
SOURCE_ID: the identifiers are considered as source_id | ||
TRANSIT_ID: the identifiers are considered as transit_id | ||
IMAGE_ID: the identifiers are considered as sif_observation_id | ||
options : str, optional, default None | ||
If present, an extra parameter OPTIONS will be added to the call, to be interpreted by the TAP service | ||
verbose : bool, optional, default 'False' | ||
flag to display information about the process | ||
Flag to display information about the process | ||
|
||
Returns | ||
------- | ||
|
@@ -1282,15 +1284,17 @@ def get_datalinks(self, ids, *, linking_parameter=None, verbose=False): | |
if linking_parameter is not None: | ||
ids_arg = f'{ids_arg}&LINKING_PARAMETER={linking_parameter}' | ||
|
||
if options is not None: | ||
ids_arg = f'{ids_arg}&OPTIONS={options}' | ||
|
||
if verbose: | ||
print(f"Datalink request: {ids_arg}") | ||
connHandler = self.__getconnhandler() | ||
response = connHandler.execute_datalinkpost(subcontext="links", | ||
data=ids_arg, | ||
verbose=verbose) | ||
print(f"Datalink request: ID={ids_arg}") | ||
|
||
conn_handler = self.__getconnhandler() | ||
response = conn_handler.execute_datalinkpost(subcontext="links", data=ids_arg, verbose=verbose) | ||
if verbose: | ||
print(response.status, response.reason) | ||
connHandler.check_launch_response_status(response, verbose, 200) | ||
conn_handler.check_launch_response_status(response, verbose, 200) | ||
if verbose: | ||
print("Done.") | ||
results = utils.read_http_response(response, "votable", use_names_over_ids=self.use_names_over_ids) | ||
|
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.
options
feels very generic; could we be more specific naming this?Also, I would find it useful to mention what valid values could be for this, from the example below 'METADATA' is one, but how could the user know what else works?
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 addition, adding a new kwarg is an API change, thus will need to be mentioned in the changelog