FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

eHST queries and data using TAP and minor fixes in ESA modules by jespinosaar · Pull Request #2597 · astropy/astroquery · GitHub

eHST queries and data using TAP and minor fixes in ESA modules - #2597

Merged
bsipocz merged 14 commits into
astropy:mainfrom
esdc-esac-esa-int:ESA_eHST-tap_https_url
Nov 26, 2022
Merged

eHST queries and data using TAP and minor fixes in ESA modules#2597
bsipocz merged 14 commits into
astropy:mainfrom
esdc-esac-esa-int:ESA_eHST-tap_https_url

Conversation

Copy link
Copy Markdown
Contributor

Hi all,

This pull requests is covering the following issues:

  • After migrating eHST Science Archive to a new interface, our backend is mainly based on TAP. We have modified the data download to use the data distribution embedded in our TAP.
  • eHST documentation has been updated.
  • Added a new method in TapUtils to specify a client ID, useful for statistics.
  • Issue Rename query_xyz_tap and query() methods to query_tap #2363: method query_hst_tap has been updated to query_tap and deprecation warning is in place.
  • Issue ESA JWST remote test failues #2590: remote tests failing in eJWST have been fixed.
  • Remote tests failing in ISO documentation have also been fixed.

Thanks a lot!

cc @esdc-esac-esa-int

codecov Bot commented Nov 23, 2022
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #2597 (d5221e5) into main (ef8be74) will increase coverage by 0.00%.
The diff coverage is 79.79%.

@@           Coverage Diff           @@
##             main    #2597   +/-   ##
=======================================
  Coverage   64.20%   64.21%           
=======================================
  Files         130      130           
  Lines       16850    16885   +35     
=======================================
+ Hits        10819    10842   +23     
- Misses       6031     6043   +12     
Impacted Files Coverage Δ
astroquery/esa/hubble/core.py 83.63% <78.26%> (-2.84%) ⬇️
astroquery/esa/jwst/core.py 75.43% <100.00%> (ø)
astroquery/utils/tap/core.py 44.55% <100.00%> (+0.21%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

jespinosaar force-pushed the ESA_eHST-tap_https_url branch from a4581ff to 7aa111c Compare November 23, 2022 15:56

Copy link
Copy Markdown
Contributor Author

Everything seems to be working, please let me know if you have further comments. Thanks!

bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Over this looks to be almost ready to go, all remote tests pass, etc.

I've left some minor comments, and some that may point to a follow-up PR.

# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""

@author: Javier Duran

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This reminds me that we need to sort out a team page listing ESA as a significant contributor. It's not forgotten, we just haven't got to it yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Many thanks! just ping me if you need a list of users or something else.

Comment on lines +898 to +899
assert "This target name cannot be determined with this resolver: ALL" in err.value.args[0] or "Failed "
"to parse" in err.value.args[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You need parens around the linebreak otherwise you only assert on the string "Failed " (which is always True) rather than on "Failed to parse" in err.value.args[0].

Do the same for all the other similar lines below.

Suggested change
assert "This target name cannot be determined with this resolver: ALL" in err.value.args[0] or "Failed "
"to parse" in err.value.args[0]
assert "This target name cannot be determined with this resolver: ALL" in err.value.args[0] or ("Failed "
"to parse" in err.value.args[0])

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done!

flag to display information about the process
product_type : string
type of product retrieval, optional
PRODUCT, SCIENCE_PRODUCT or POSTCARD

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wonder whether we need some extra docs, or deprecation that notifies anyone using these product types that things have changed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also, could you update the download_product usage in the docs to not use e.g. SCIENCE_PRODUCT?
(I see that the example still works, but I suppose it would be nice to clean up nevertheless)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have updated the examples with the new parameters and added some deprecation messages in the code and the documentation.

return filename

def get_postcard(self, observation_id, calibration_level="RAW",
def get_postcard(self, observation_id, *, calibration_level="RAW",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for doing this.

changing kwargs to be keyword only needs to be mentioned in a new changelog entry, look for copy-paste examples.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Also, I wonder, while you're at it, could you do this for all the methods?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done!

Comment thread astroquery/esa/hubble/core.py Outdated
dump_to_file=output_file is not None)
table = job.get_results()
return table
warnings.warn(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Doing it with the deprecated decorator from astropy.utils may be a tiny bit simpler, but at this point you don't need to change this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have also included the decorator, but I left the warning.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@deprecated ensures that a deprecation warning is emitted, so the warnings raised by the decorated function itself are duplicates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done, commented below.

else:
return tables

def get_status_messages(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

you may want to mention this in the changelog or in the docs of all modules having it (get_status_messages is mentioned in the docs for the JWST module, but not for the rest)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It is mentioned now.

Comment thread astroquery/esa/hubble/core.py Outdated
table = job.get_results()
return table

def query_hst_tap(self, query, async_job=False, output_file=None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This deprecation needs to be mentioned in the changelog, preferably as a separate entry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Deprecation included in the changelog. I have also ordered the different entries in the appropriate categories.

Comment thread CHANGES.rst Outdated
a lot faster. [#2524]

- Update TAP url to avoid 301 HTTPError. [#2567]
- Update to TAP url to query data and download files, aligned with the new eHST Science Archive. [#2567][#2597]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

more changelog entries are needed for this PR to cover the various changes, see the comments below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Changelog entries added. Please let me know if you think more are required.

assert "Coordinates must be either a string or " \
"astropy.coordinates" in err.value.args[0]

def test_query_hst_tap(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

could you keep one query_hst_tap test, too to test whether the deprecation warning is issued?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Added again and being executed.


def test_download_product_errors(self):
ehst = ESAHubbleClass(self.get_dummy_tap_handler())
ehst = ESAHubbleClass(tap_handler=self.get_dummy_tap_handler(), show_messages=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we have one show_messages=True test, too (with mocking some status messages)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Test included.

bsipocz linked an issue Nov 23, 2022 that may be closed by this pull request

Copy link
Copy Markdown
Contributor Author

Thanks for your comments @bsipocz ! working on them.

Copy link
Copy Markdown
Contributor Author

I think I have answered all your comments @bsipocz , please let me know if further changes are required.

Copy link
Copy Markdown
Contributor Author

Don't know why the docs is taking so long...

Comment thread astroquery/esa/hubble/core.py Outdated
Comment on lines +590 to +592
@deprecated(since="0.4.7", message=("Use of query_hst_tap method is no longer supported. "
"Please use query_tap method instead, with the same arguments."),
alternative="query_tap")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

message does not have to be specified. The following works:

Suggested change
@deprecated(since="0.4.7", message=("Use of query_hst_tap method is no longer supported. "
"Please use query_tap method instead, with the same arguments."),
alternative="query_tap")
@deprecated(since="0.4.7", alternative="query_tap")

The resulting warning is

WARNING: AstropyDeprecationWarning: The query_hst_tap function is deprecated and may be removed in a future version.
        Use query_tap instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ok, I have removed the AstropyDeprecationWarning

Comment thread astroquery/utils/tap/core.py Outdated
@staticmethod
def __set_client_id(client_id):
if client_id:
global TAP_CLIENT_ID

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

According to Python naming conventions TAP_CLIENT_ID is supposed to be (and so far has been) a module level constant. Now it should be changed to be an instance attribute instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Modified TAP_CLIENT_ID to be an instance attribute.

Copy link
Copy Markdown
Contributor Author

Ok, new comments have been implemented, thanks @bsipocz and @eerovaher !

bsipocz force-pushed the ESA_eHST-tap_https_url branch from c839a77 to d5221e5 Compare November 26, 2022 07:52

bsipocz commented Nov 26, 2022

Copy link
Copy Markdown
Member

@jespinosaar - Thanks for the PR and the very quick review cycle!

I did a minor rebase as there were two merge/duplicated commits. Github quicklook however now wrongly shows these as my commits, you may want to add your ext.esa.int email address to your github profile so they will be properly picked up by the web interface for you (git log showing them correctly, it's just the web interface issue).

bsipocz merged commit f59362b into astropy:main Nov 26, 2022
bsipocz mentioned this pull request Nov 27, 2022
62 tasks
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESA JWST remote test failues

3 participants


Back | FazBrowse Home | New Git URL