Skip to content

Commit 7d65f4b

Browse files
committed
update changelog, remove deprecated code for v3.2
1 parent 5ff7666 commit 7d65f4b

34 files changed

+125
-1220
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
55

6+
## [3.2.0] - 2025-04-25
7+
68
### Added
79
- A new page to the docs labeled "Conventions" has been added.
810
- The methods `Telescope.__add__` and `Telescope.__iadd__` have been added to allow
@@ -97,6 +99,24 @@ selection (if input to `polarizations` keyword was unordered).
9799
- The `x_orientation` attribute on `Telescope` and `UVBeam`.
98100
- The options `"e"` and `"n"` for elements of `feed_array` in `Telescope` and `UVBeam`.
99101

102+
### Removed
103+
- The `future_array_shapes` attribute on `UVBase` objects.
104+
- The `use_future_array_shapes` keyword in various class methods.
105+
- The `use_future_array_shapes` method on `UVBase` objects.
106+
- Support for accessing the telescope-related metadata through their old attribute
107+
names on `UVData`, `UVCal` and `UVFlag` rather than via their attributes on the
108+
attached `Telescope` object (e.g. `UVData.telescope_name` -> `UVData.telescope.name`
109+
and `UVData.antenna_positions` -> `UVData.telescope.antenna_positions`).
110+
- Support for passing telescope-related metadata as separate parameters to `UVData.new` and
111+
`UVCal.new` rather than `Telescope` objects.
112+
- The `UVData.get_ENU_antpos` method in favor of `UVData.telescope.get_enu_antpos`.
113+
- The `Telescope.telescope_location` and `Telescope.telescope_name` attributes
114+
in favor of `Telescope.location` and `Telescope.name`.
115+
- The `get_telescope` function in favor of the `known_telescope_location` function
116+
and the `Telescope.from_known_telescopes` classmethod.
117+
- The KNOWN_TELESCOPE dict in favor of the `known_telescope_location` function
118+
and the `Telescope.from_known_telescopes` classmethod.
119+
100120
## [3.1.3] - 2025-01-13
101121

102122
### Added

docs/make_telescope.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from astropy.time import Time
1212

1313
from pyuvdata import Telescope
14-
from pyuvdata.telescopes import _KNOWN_TELESCOPES
14+
from pyuvdata.telescopes import KNOWN_TELESCOPES
1515

1616

1717
def write_telescope_rst(write_file=None):
@@ -86,8 +86,8 @@ def write_telescope_rst(write_file=None):
8686
"We also provide a convenience function to get known telescope locations.\n\n"
8787
)
8888

89-
known_tel_use = copy.deepcopy(_KNOWN_TELESCOPES)
90-
for tel, tel_dict in _KNOWN_TELESCOPES.items():
89+
known_tel_use = copy.deepcopy(KNOWN_TELESCOPES)
90+
for tel, tel_dict in KNOWN_TELESCOPES.items():
9191
if "location" in tel_dict:
9292
known_tel_use[tel]["location"] = (
9393
tel_dict["location"].to_geodetic().__repr__()

src/pyuvdata/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def branch_scheme(version): # pragma: nocover
5151
from .analytic_beam import AiryBeam, GaussianBeam, ShortDipoleBeam, UniformBeam # noqa
5252
from .beam_interface import BeamInterface # noqa
5353
from .telescopes import Telescope # noqa
54-
from .telescopes import get_telescope # noqa # NB: get_telescopes is deprecated
5554
from .uvbeam import UVBeam # noqa
5655
from .uvcal import UVCal # noqa
5756
from .uvdata import FastUVH5Meta # noqa
@@ -70,7 +69,6 @@ def branch_scheme(version): # pragma: nocover
7069
"ShortDipoleBeam",
7170
"UniformBeam",
7271
"Telescope",
73-
"get_telescope",
7472
]
7573

7674

src/pyuvdata/telescopes.py

Lines changed: 10 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import os
99
import warnings
10-
from collections.abc import Mapping
1110
from pathlib import Path
1211
from typing import Literal
1312

@@ -22,7 +21,7 @@
2221
from .utils.tools import _strict_raise, slicify
2322
from .uvbase import UVBase
2423

25-
__all__ = ["Telescope", "known_telescopes", "known_telescope_location", "get_telescope"]
24+
__all__ = ["Telescope", "known_telescopes", "known_telescope_location"]
2625

2726
# We use astropy sites for telescope locations. The dict below is for
2827
# telescopes not in astropy sites, or to include extra information for a telescope.
@@ -32,7 +31,7 @@
3231
# Antenna positions can be specified via a csv file with the following columns:
3332
# "name" -- antenna name, "number" -- antenna number, "x", "y", "z" -- ECEF coordinates
3433
# relative to the telescope location.
35-
_KNOWN_TELESCOPES = {
34+
KNOWN_TELESCOPES = {
3635
"PAPER": {
3736
"location": EarthLocation.from_geodetic(
3837
lat=Angle("-30d43m17.5s"), lon=Angle("21d25m41.9s"), height=1073.0 * units.m
@@ -117,7 +116,7 @@
117116

118117
# Define a (private) dictionary that tracks whether the user wants warnings
119118
# to be raised on updating known telescopes from params.
120-
_WARN_STATUS = {k.lower(): True for k in _KNOWN_TELESCOPES}
119+
_WARN_STATUS = {k.lower(): True for k in KNOWN_TELESCOPES}
121120

122121

123122
def ignore_telescope_param_update_warnings_for(tel: str):
@@ -147,45 +146,6 @@ def unignore_telescope_param_update_warnings_for(tel: str):
147146
_WARN_STATUS[tel] = True
148147

149148

150-
# Deprecation to handle accessing old keys of KNOWN_TELESCOPES
151-
class TelMapping(Mapping):
152-
def __init__(self, mapping=()):
153-
self._mapping = dict(mapping)
154-
155-
def __getitem__(self, key):
156-
warnings.warn(
157-
"Directly accessing the KNOWN_TELESCOPES dict is deprecated. If you "
158-
"need a telescope location, use the known_telescope_location function. "
159-
"For a full Telescope object use the classmethod "
160-
"Telescope.from_known_telescopes. This will become an error in version 3.2",
161-
DeprecationWarning,
162-
)
163-
if key in ["latitude", "longitude", "altitude", "center_xyz"]:
164-
if key == "latitude":
165-
return self._mapping["location"].lat.rad
166-
if key == "longitude":
167-
return self._mapping["location"].lon.rad
168-
if key == "altitude":
169-
return self._mapping["location"].height.to_value("m")
170-
if key == "center_xyz":
171-
return units.Quantity(self._mapping["location"].geocentric).to_value(
172-
"m"
173-
)
174-
175-
return self._mapping[key]
176-
177-
def __len__(self):
178-
return len(self._mapping)
179-
180-
def __iter__(self):
181-
return iter(self._mapping)
182-
183-
184-
KNOWN_TELESCOPES = TelMapping(
185-
(name, TelMapping(tel_dict)) for name, tel_dict in _KNOWN_TELESCOPES.items()
186-
)
187-
188-
189149
def known_telescopes():
190150
"""
191151
Get list of known telescopes.
@@ -196,34 +156,10 @@ def known_telescopes():
196156
List of known telescope names.
197157
"""
198158
astropy_sites = [site for site in EarthLocation.get_site_names() if site != ""]
199-
known_telescopes = list(set(astropy_sites + list(_KNOWN_TELESCOPES.keys())))
159+
known_telescopes = list(set(astropy_sites + list(KNOWN_TELESCOPES.keys())))
200160
return known_telescopes
201161

202162

203-
def get_telescope(telescope_name):
204-
"""
205-
Get Telescope object for a telescope in telescope_dict. Deprecated.
206-
207-
Parameters
208-
----------
209-
telescope_name : str
210-
Name of a telescope
211-
212-
Returns
213-
-------
214-
Telescope object
215-
The Telescope object associated with telescope_name.
216-
"""
217-
warnings.warn(
218-
"This method is deprecated and will be removed in version 3.2. If you "
219-
"just need a telescope location, use the known_telescope_location function. "
220-
"For a full Telescope object use the classmethod "
221-
"Telescope.from_known_telescopes.",
222-
DeprecationWarning,
223-
)
224-
return Telescope.from_known_telescopes(telescope_name, run_check=False)
225-
226-
227163
def known_telescope_location(name: str, return_citation: bool = False, **kwargs):
228164
"""
229165
Get the location for a known telescope.
@@ -256,9 +192,9 @@ def known_telescope_location(name: str, return_citation: bool = False, **kwargs)
256192
else:
257193
telescope_dict = {}
258194
tel_name = name.lower()
259-
for key in _KNOWN_TELESCOPES:
195+
for key in KNOWN_TELESCOPES:
260196
if key.lower() == tel_name:
261-
telescope_dict = _KNOWN_TELESCOPES[key]
197+
telescope_dict = KNOWN_TELESCOPES[key]
262198
for key in kwargs:
263199
if (key == "citation") or (key == "location"):
264200
telescope_dict[key] = kwargs[key]
@@ -499,22 +435,7 @@ def __init__(self):
499435

500436
def __getattr__(self, __name):
501437
"""Handle old names attributes."""
502-
if __name == "telescope_location":
503-
warnings.warn(
504-
"The Telescope.telescope_location attribute is deprecated, use "
505-
"Telescope.location instead (which contains an astropy "
506-
"EarthLocation object). This will become an error in version 3.2.",
507-
DeprecationWarning,
508-
)
509-
return self._location.xyz()
510-
elif __name == "telescope_name":
511-
warnings.warn(
512-
"The Telescope.telescope_name attribute is deprecated, use "
513-
"Telescope.name instead. This will become an error in version 3.2.",
514-
DeprecationWarning,
515-
)
516-
return self.name
517-
elif __name == "x_orientation":
438+
if __name == "x_orientation":
518439
warnings.warn(
519440
"The Telescope.x_orientation attribute is deprecated, and has "
520441
"been superseded by Telescope.feed_angle and Telescope.feed_array. "
@@ -529,22 +450,7 @@ def __getattr__(self, __name):
529450

530451
def __setattr__(self, __name, __value):
531452
"""Handle old names for telescope metadata."""
532-
if __name == "telescope_location":
533-
warnings.warn(
534-
"The Telescope.telescope_location attribute is deprecated, use "
535-
"Telescope.location instead (which should be set to an astropy "
536-
"EarthLocation object). This will become an error in version 3.2.",
537-
DeprecationWarning,
538-
)
539-
self._location.set_xyz(__value)
540-
elif __name == "telescope_name":
541-
warnings.warn(
542-
"The Telescope.telescope_name attribute is deprecated, use "
543-
"Telescope.name instead. This will become an error in version 3.2.",
544-
DeprecationWarning,
545-
)
546-
self.name = __value
547-
elif __name == "x_orientation":
453+
if __name == "x_orientation":
548454
warnings.warn(
549455
"The Telescope.x_orientation attribute is deprecated, and has "
550456
"been superseded by Telescope.feed_angle and Telescope.feed_array. "
@@ -837,9 +743,9 @@ def update_params_from_known_telescopes(
837743
)
838744
telescope_dict = {}
839745
tel_name = self.name.lower()
840-
for key in _KNOWN_TELESCOPES:
746+
for key in KNOWN_TELESCOPES:
841747
if key.lower() == tel_name:
842-
telescope_dict.update(_KNOWN_TELESCOPES[key])
748+
telescope_dict.update(KNOWN_TELESCOPES[key])
843749

844750
astropy_sites_list = []
845751
known_telescope_list = []

src/pyuvdata/utils/__init__.py

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from __future__ import annotations
77

8-
import warnings
9-
108
import numpy as np
119

1210
# standard angle tolerance: 1 mas in radians.
@@ -44,81 +42,3 @@
4442
from .pol import * # noqa
4543
from .times import get_lst_for_time # noqa
4644
from .uvcalibrate import uvcalibrate # noqa
47-
48-
# deprecated imports
49-
50-
51-
def _check_histories(history1, history2):
52-
"""Check if two histories are the same.
53-
54-
Deprecated. Use pyuvdata.utils.history._check_histories
55-
"""
56-
from .history import _check_histories
57-
58-
warnings.warn(
59-
"The _check_histories function has moved, please import it from "
60-
"pyuvdata.utils.history. This warnings will become an error in version 3.2",
61-
DeprecationWarning,
62-
)
63-
64-
return _check_histories(history1, history2)
65-
66-
67-
def _fits_gethduaxis(hdu, axis):
68-
"""
69-
Make axis arrays for fits files.
70-
71-
Deprecated. Use pyuvdata.utils.io.fits._gethduaxis.
72-
73-
Parameters
74-
----------
75-
hdu : astropy.io.fits HDU object
76-
The HDU to make an axis array for.
77-
axis : int
78-
The axis number of interest (1-based).
79-
80-
Returns
81-
-------
82-
ndarray of float
83-
Array of values for the specified axis.
84-
85-
"""
86-
from .io.fits import _gethduaxis
87-
88-
warnings.warn(
89-
"The _fits_gethduaxis function has moved, please import it as "
90-
"pyuvdata.utils.io.fits._gethduaxis. This warnings will become an "
91-
"error in version 3.2",
92-
DeprecationWarning,
93-
)
94-
95-
return _gethduaxis(hdu, axis)
96-
97-
98-
def _fits_indexhdus(hdulist):
99-
"""
100-
Get a dict of table names and HDU numbers from a FITS HDU list.
101-
102-
Deprecated. Use pyuvdata.utils.io.fits._indexhdus.
103-
104-
Parameters
105-
----------
106-
hdulist : list of astropy.io.fits HDU objects
107-
List of HDUs to get names for
108-
109-
Returns
110-
-------
111-
dict
112-
dictionary with table names as keys and HDU number as values.
113-
114-
"""
115-
from .io.fits import _indexhdus
116-
117-
warnings.warn(
118-
"The _fits_indexhdus function has moved, please import it as "
119-
"pyuvdata.utils.io.fits._indexhdus. This warnings will become an "
120-
"error in version 3.2",
121-
DeprecationWarning,
122-
)
123-
124-
return _indexhdus(hdulist)

src/pyuvdata/utils/pol.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"jstr2num",
2525
"jnum2str",
2626
"conj_pol",
27-
"_x_orientation_rep_dict",
2827
"x_orientation_pol_map",
2928
"parse_polstr",
3029
"parse_jpolstr",
@@ -86,23 +85,6 @@
8685
}
8786

8887

89-
def _x_orientation_rep_dict(x_orientation):
90-
"""
91-
Create replacement dict based on x_orientation.
92-
93-
Deprecated. Use x_orientation_pol_map instead.
94-
95-
"""
96-
warnings.warn(
97-
"This function (_x_orientation_rep_dict) is deprecated, use "
98-
"pyuvdata.utils.pol.x_orientation_pol_map instead."
99-
" This will become an error in version 3.2",
100-
DeprecationWarning,
101-
)
102-
103-
return x_orientation_pol_map(x_orientation)
104-
105-
10688
def x_orientation_pol_map(x_orientation: str) -> dict:
10789
"""
10890
Return map from "x" and "y" pols to "e" and "n" based on x_orientation.

0 commit comments

Comments
 (0)