Skip to content

Commit

Permalink
Merge pull request #15725 from neutrinoceros/mnt/cleanup_old_python
Browse files Browse the repository at this point in the history
MNT: cleanup fiduciary comments that are unneeded since Python 3.8 was dropped
  • Loading branch information
mhvk committed Dec 12, 2023
2 parents e0d336c + 54fe898 commit c80869e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
39 changes: 17 additions & 22 deletions astropy/coordinates/tests/test_frames_with_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,18 @@ def test_api():
"kwargs",
[
POSITION_ON_SKY,
# In Python 3.9 we could write `POSITION_ON_SKY | DISTANCE`
{**POSITION_ON_SKY, **DISTANCE},
{**POSITION_ON_SKY, **PROPER_MOTION},
{**POSITION_ON_SKY, **DISTANCE, **PROPER_MOTION},
{**POSITION_ON_SKY, **RADIAL_VELOCITY},
{**POSITION_ON_SKY, **DISTANCE, **RADIAL_VELOCITY},
{**POSITION_ON_SKY, **PROPER_MOTION, **RADIAL_VELOCITY},
{**POSITION_ON_SKY, **DISTANCE, **PROPER_MOTION, **RADIAL_VELOCITY},
POSITION_ON_SKY | DISTANCE,
POSITION_ON_SKY | PROPER_MOTION,
POSITION_ON_SKY | DISTANCE | PROPER_MOTION,
POSITION_ON_SKY | RADIAL_VELOCITY,
POSITION_ON_SKY | DISTANCE | RADIAL_VELOCITY,
POSITION_ON_SKY | PROPER_MOTION | RADIAL_VELOCITY,
POSITION_ON_SKY | DISTANCE | PROPER_MOTION | RADIAL_VELOCITY,
# Now test other representation/differential types:
CARTESIAN_POSITION,
{**CARTESIAN_POSITION, **CARTESIAN_REPRESENTATION_KEYWORD_STR},
{**CARTESIAN_POSITION, **CARTESIAN_VELOCITY},
{
**CARTESIAN_POSITION,
**CARTESIAN_VELOCITY,
**CARTESIAN_DIFFERENTIAL_KEYWORD_STR,
},
CARTESIAN_POSITION | CARTESIAN_REPRESENTATION_KEYWORD_STR,
CARTESIAN_POSITION | CARTESIAN_VELOCITY,
CARTESIAN_POSITION | CARTESIAN_VELOCITY | CARTESIAN_DIFFERENTIAL_KEYWORD_STR,
],
)
def test_all_arg_options(kwargs):
Expand Down Expand Up @@ -185,12 +180,12 @@ def test_xhip_galactic(
"kwargs,expect_success",
(
(POSITION_ON_SKY, False),
({**POSITION_ON_SKY, **DISTANCE}, True),
({**POSITION_ON_SKY, **PROPER_MOTION}, False),
({**POSITION_ON_SKY, **RADIAL_VELOCITY}, False),
({**POSITION_ON_SKY, **DISTANCE, **RADIAL_VELOCITY}, False),
({**POSITION_ON_SKY, **PROPER_MOTION, **RADIAL_VELOCITY}, False),
({**POSITION_ON_SKY, **DISTANCE, **PROPER_MOTION, **RADIAL_VELOCITY}, True),
(POSITION_ON_SKY | DISTANCE, True),
(POSITION_ON_SKY | PROPER_MOTION, False),
(POSITION_ON_SKY | RADIAL_VELOCITY, False),
(POSITION_ON_SKY | DISTANCE | RADIAL_VELOCITY, False),
(POSITION_ON_SKY | PROPER_MOTION | RADIAL_VELOCITY, False),
(POSITION_ON_SKY | DISTANCE | PROPER_MOTION | RADIAL_VELOCITY, True),
),
)
def test_frame_affinetransform(kwargs, expect_success):
Expand Down Expand Up @@ -305,7 +300,7 @@ def test_shorthand_attributes():


@pytest.mark.parametrize(
"icrs_coords", [POSITION_ON_SKY, {**POSITION_ON_SKY, **PROPER_MOTION}]
"icrs_coords", [POSITION_ON_SKY, POSITION_ON_SKY | PROPER_MOTION]
)
def test_negative_distance(icrs_coords):
"""Regression test: #7408
Expand Down
8 changes: 3 additions & 5 deletions astropy/table/tests/test_pprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,9 @@ def test_output(self):
out = t.pformat_all()
assert out == exp

# Mixture (not common in practice but possible). Note, the trailing
# backslash instead of parens is needed for Python < 3.9. See:
# https://bugs.python.org/issue12782.
with t.pprint_include_names.set(["b", "c", "d"]), t.pprint_exclude_names.set(
["c"]
with (
t.pprint_include_names.set(["b", "c", "d"]),
t.pprint_exclude_names.set(["c"]),
):
out = t.pformat_all()
assert out == exp
Expand Down
3 changes: 1 addition & 2 deletions astropy/units/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,7 @@ def __class_getitem__(cls, unit_shape_dtype):
Notes
-----
With Python 3.9+ or :mod:`typing_extensions`, |Quantity| types are also
static-type compatible.
|Quantity| types are also static-type compatible.
"""
from typing import Annotated

Expand Down

0 comments on commit c80869e

Please sign in to comment.