-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
get_obs_products method supports product_type parameter as string or list #2995
Merged
bsipocz
merged 11 commits into
astropy:main
from
esdc-esac-esa-int:ESA_jwst-extend_get_obs_products
Jul 16, 2024
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
95bc9fe
get_obs_products method supports product_type parameter as string or …
e0b6649
align to PEP8
4d2a204
Modify CHANGES.rst file with get_obs_products method changes
b9f52d1
Delete check_list_strings method
davidglt 21d6c21
cleaner get_obs_products method
davidglt a10a87b
clean whitespaces
davidglt 89c7d3b
remote test for product_type parameter as list
davidglt 667d254
delete "# doctest: +SKIP" from get_obs_products tests when they use t…
davidglt ec3f48b
Replace "type(product_type) is list" by isinstance(product_type, list…
davidglt c1f0855
Include offline test for product_type as a list
davidglt bb734e0
Style fixes
jespinosaar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -733,6 +733,37 @@ def test_get_obs_products(self): | |
finally: | ||
shutil.rmtree(output_file_full_path_dir) | ||
|
||
# Test product_type paramater with a list | ||
output_file_full_path_dir = os.getcwd() + os.sep + "temp_test_jwsttap_get_obs_products_1" | ||
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. I see that all these are inherited from above, so these are generic cleanup comments, not necessary to address them for merging this particular PR:
|
||
try: | ||
os.makedirs(output_file_full_path_dir, exist_ok=True) | ||
except OSError as err: | ||
print(f"Creation of the directory {output_file_full_path_dir} failed: {err.strerror}") | ||
raise err | ||
|
||
file = data_path('single_product_retrieval.tar') | ||
output_file_full_path = output_file_full_path_dir + os.sep + os.path.basename(file) | ||
shutil.copy(file, output_file_full_path) | ||
parameters['output_file'] = output_file_full_path | ||
|
||
expected_files = [] | ||
extracted_file_1 = output_file_full_path_dir + os.sep + 'single_product_retrieval_1.fits' | ||
expected_files.append(extracted_file_1) | ||
product_type_as_list = ['science', 'info'] | ||
try: | ||
files_returned = (jwst.get_obs_products( | ||
observation_id=observation_id, | ||
cal_level='ALL', | ||
product_type=product_type_as_list, | ||
output_file=output_file_full_path)) | ||
parameters['params_dict']['product_type'] = 'science,info' | ||
dummyTapHandler.check_call('load_data', parameters) | ||
self.__check_extracted_files(files_expected=expected_files, | ||
files_returned=files_returned) | ||
finally: | ||
shutil.rmtree(output_file_full_path_dir) | ||
del parameters['params_dict']['product_type'] | ||
|
||
# Test single file | ||
output_file_full_path_dir = os.getcwd() + os.sep +\ | ||
"temp_test_jwsttap_get_obs_products_2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.