-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
renamed and deprecated Observations and Observations class for the gemini and mast module #1885
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
from astroquery import log | ||
from astropy import units | ||
from astropy.table import Table, MaskedColumn | ||
from astropy.utils import deprecated | ||
|
||
from astroquery.gemini.urlhelper import URLHelper | ||
import numpy as np | ||
|
@@ -21,7 +22,7 @@ | |
from ..exceptions import AuthenticationWarning | ||
|
||
|
||
__all__ = ['Observations', 'ObservationsClass'] # specifies what to import | ||
__all__ = ['GeminiObservations', 'GeminiObservationsClass'] # specifies what to import | ||
|
||
|
||
__valid_instruments__ = [ | ||
|
@@ -97,7 +98,7 @@ | |
] | ||
|
||
|
||
class ObservationsClass(QueryWithLogin): | ||
class GeminiObservationsClass(QueryWithLogin): | ||
|
||
server = conf.server | ||
url_helper = URLHelper(server) | ||
|
@@ -526,4 +527,11 @@ def _gemini_json_to_table(json): | |
"release", | ||
"dec"] | ||
|
||
|
||
@deprecated(since='v0.4.3', alternative='GeminiObservationsClass') | ||
class ObservationsClass(GeminiObservationsClass): | ||
pass | ||
|
||
|
||
GeminiObservations = GeminiObservationsClass() | ||
Observations = ObservationsClass() | ||
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 line is causing the warning. I guess the brute force way is to silence the warning just for this line...? 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. Yes, the issue is that if I put a filter in |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,13 +31,13 @@ class Conf(_config.ConfigNamespace): | |
conf = Conf() | ||
|
||
from .cutouts import TesscutClass, Tesscut, ZcutClass, Zcut | ||
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. Keep this line unchanged, that will fix the docs build. |
||
from .observations import Observations, ObservationsClass, MastClass, Mast | ||
from .observations import MastObservations, MastObservationsClass, MastClass, Mast | ||
from .collections import Catalogs, CatalogsClass | ||
from .missions import MastMissions, MastMissionsClass | ||
from .core import MastQueryWithLogin | ||
from . import utils | ||
|
||
__all__ = ['Observations', 'ObservationsClass', | ||
__all__ = ['MastObservations', 'MastObservationsClass', | ||
'Catalogs', 'CatalogsClass', | ||
'MastMissions', 'MastMissionsClass', | ||
'Mast', 'MastClass', | ||
|
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.
There should be two changelog entries, one under MAST and one under Gemeni.
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.
Would it be a good idea to assign the old name of the class to the new name
e.g ObservationsClass = GeminiObservationsClass()
and display a deprecated message saying ObservationsClass is deprecated. Use GeminiObservationsClass instead
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.
You can use this PR as an example for renaming and deprecating a class: astropy/astropy#9445
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.
Nice! Thanks @bsipocz