From f4c1b76f9d2e95cc119a727704920327039e2cc5 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Mon, 11 Sep 2023 12:15:29 +0200 Subject: [PATCH 01/10] Add remote_data on all test that require network --- astroplan/constraints.py | 4 ++-- astroplan/plots/tests/test_sky.py | 1 + astroplan/target.py | 8 ++++---- astroplan/tests/test_constraints.py | 17 +++++++++++++++++ astroplan/tests/test_observer.py | 5 +++++ astroplan/tests/test_scheduling.py | 6 +++++- astroplan/tests/test_target.py | 3 +++ 7 files changed, 37 insertions(+), 7 deletions(-) diff --git a/astroplan/constraints.py b/astroplan/constraints.py index f9857fe9..d143ca34 100644 --- a/astroplan/constraints.py +++ b/astroplan/constraints.py @@ -734,7 +734,7 @@ def __init__(self, min=None, max=None): >>> from astroplan import Observer >>> from astroplan.constraints import LocalTimeConstraint >>> import datetime as dt - >>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") + >>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") # doctest: +REMOTE_DATA >>> # bound times between 23:50 and 04:08 local Hawaiian time >>> constraint = LocalTimeConstraint(min=dt.time(23,50), max=dt.time(4,8)) """ @@ -821,7 +821,7 @@ def __init__(self, min=None, max=None): >>> from astroplan import Observer >>> from astropy.time import Time - >>> subaru = Observer.at_site("Subaru") + >>> subaru = Observer.at_site("Subaru") # doctest: +REMOTE_DATA >>> t1 = Time("2016-03-28T12:00:00") >>> t2 = Time("2016-03-30T12:00:00") >>> constraint = TimeConstraint(t1,t2) diff --git a/astroplan/plots/tests/test_sky.py b/astroplan/plots/tests/test_sky.py index 7ad41bab..02ff3f23 100644 --- a/astroplan/plots/tests/test_sky.py +++ b/astroplan/plots/tests/test_sky.py @@ -24,6 +24,7 @@ def test_image_example(): return fig +@pytest.mark.remote_data @pytest.mark.skipif('not HAS_MATPLOTLIB') @pytest.mark.mpl_image_compare def test_timezone(): diff --git a/astroplan/target.py b/astroplan/target.py index 8a05dfca..0cd72589 100644 --- a/astroplan/target.py +++ b/astroplan/target.py @@ -79,13 +79,13 @@ class FixedTarget(Target): >>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> sirius_coord = SkyCoord(ra=101.28715533*u.deg, dec=16.71611586*u.deg) - >>> sirius = FixedTarget(coord=sirius_coord, name="Sirius") + >>> sirius = FixedTarget(coord=sirius_coord, name="Sirius") # doctest: +REMOTE_DATA Create an equivalent `~astroplan.FixedTarget` object for Sirius by querying for the coordinates of Sirius by name: >>> from astroplan import FixedTarget - >>> sirius = FixedTarget.from_name("Sirius") + >>> sirius = FixedTarget.from_name("Sirius") # doctest: +REMOTE_DATA """ def __init__(self, coord, name=None, **kwargs): @@ -127,7 +127,7 @@ def from_name(cls, query_name, name=None, **kwargs): Examples -------- >>> from astroplan import FixedTarget - >>> sirius = FixedTarget.from_name("Sirius") + >>> sirius = FixedTarget.from_name("Sirius") # doctest: +REMOTE_DATA >>> sirius.coord # doctest: +FLOAT_CMP @@ -149,7 +149,7 @@ def __repr__(self): >>> from astroplan import FixedTarget >>> from astropy.coordinates import SkyCoord >>> vega_coord = SkyCoord(ra='279.23473479d', dec='38.78368896d') - >>> vega = FixedTarget(coord=vega_coord, name="Vega") + >>> vega = FixedTarget(coord=vega_coord, name="Vega") # doctest: +REMOTE_DATA >>> print(vega) # doctest: +FLOAT_CMP """ diff --git a/astroplan/tests/test_constraints.py b/astroplan/tests/test_constraints.py index c0f66f39..83a2bc8c 100644 --- a/astroplan/tests/test_constraints.py +++ b/astroplan/tests/test_constraints.py @@ -35,6 +35,7 @@ dec=89.26410897*u.deg), name="Polaris") +@pytest.mark.remote_data def test_at_night_basic(): subaru = Observer.at_site("Subaru") time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day @@ -55,6 +56,7 @@ def test_at_night_basic(): len(targets)*[observer_is_night_all]) +@pytest.mark.remote_data def test_observability_table(): subaru = Observer.at_site("Subaru") # time_ranges = [Time(['2001-02-03 04:05:06', '2001-02-04 04:05:06']), # 1 day @@ -98,6 +100,7 @@ def test_observability_table(): assert 'time observable' in stab.colnames +@pytest.mark.remote_data def test_altitude_constraint(): subaru = Observer.at_site("Subaru") time = Time('2001-02-03 15:35:00') @@ -109,6 +112,7 @@ def test_altitude_constraint(): assert np.all([results != 0][0] == [False, False, True, True, False, False]) +@pytest.mark.remote_data def test_compare_altitude_constraint_and_observer(): time = Time('2001-02-03 04:05:06') time_ranges = [Time([time, time+1*u.hour]) + offset @@ -130,6 +134,7 @@ def test_compare_altitude_constraint_and_observer(): assert all(always_from_observer == always_from_constraint) +@pytest.mark.remote_data def test_compare_airmass_constraint_and_observer(): time = Time('2001-02-03 04:05:06') time_ranges = [Time([time, time+1*u.hour]) + offset @@ -151,6 +156,7 @@ def test_compare_airmass_constraint_and_observer(): assert all(always_from_observer == always_from_constraint) +@pytest.mark.remote_data def test_galactic_plane_separation(): time = Time('2003-04-05 06:07:08') apo = Observer.at_site("APO") @@ -176,6 +182,7 @@ def test_galactic_plane_separation(): # in astropy before v1.0.4, a recursion error is triggered by this test @pytest.mark.skipif('APY_LT104') +@pytest.mark.remote_data def test_sun_separation(): time = Time('2003-04-05 06:07:08') apo = Observer.at_site("APO") @@ -200,6 +207,7 @@ def test_sun_separation(): assert np.all(is_constraint_met == [False, True, True]) +@pytest.mark.remote_data def test_moon_separation(): time = Time('2003-04-05 06:07:08') apo = Observer.at_site("APO") @@ -228,6 +236,7 @@ def test_moon_separation(): assert np.all(is_constraint_met == [False, True, True]) +@pytest.mark.remote_data def test_moon_illumination(): times = Time(["2015-08-28 03:30", "2015-08-28 12:00", "2015-09-05 10:30", "2015-09-15 18:35"]) @@ -266,6 +275,7 @@ def test_moon_illumination(): assert np.all(is_constraint_met == [True, False, False, False]) +@pytest.mark.remote_data def test_local_time_constraint_utc(): time = Time('2001-02-03 04:05:06') subaru = Observer.at_site("Subaru") @@ -282,6 +292,7 @@ def test_local_time_constraint_utc(): assert is_constraint_met is np.bool_(True) +@pytest.mark.remote_data def test_local_time_constraint_hawaii_tz(): # Define timezone in Observer.timezone time = Time('2001-02-03 04:05:06') @@ -299,6 +310,7 @@ def test_local_time_constraint_hawaii_tz(): assert is_constraint_met is np.bool_(True) +@pytest.mark.remote_data def test_docs_example(): # Test the example in astroplan/docs/tutorials/constraints.rst target_table_string = """# name ra_degrees dec_degrees @@ -362,6 +374,7 @@ def compute_constraint(self, times, observer, targets): assert all(observability == [False, False, True, False, False, False]) +@pytest.mark.remote_data def test_regression_airmass_141(): subaru = Observer.at_site("Subaru") time = Time('2001-1-1 12:00') @@ -424,6 +437,7 @@ def test_rescale_minmax(): ] +@pytest.mark.remote_data @pytest.mark.parametrize('constraint', constraint_tests) def test_regression_shapes(constraint): times = Time(["2015-08-28 03:30", "2015-09-05 10:30", "2015-09-15 18:35"]) @@ -439,6 +453,7 @@ def test_regression_shapes(constraint): constraint(lapalma, targets, times) +@pytest.mark.remote_data def test_caches_shapes(): times = Time([2457884.43350526, 2457884.5029497, 2457884.57239415], format='jd') m31 = SkyCoord(10.6847929*u.deg, 41.269065*u.deg) @@ -451,6 +466,7 @@ def test_caches_shapes(): assert ac(observer, targets, times, grid_times_targets=False).shape == (3,) +@pytest.mark.remote_data def test_eclipses(): subaru = Observer.at_site("Subaru") @@ -472,6 +488,7 @@ def test_eclipses(): assert np.all(np.array([False, True, False]) == pc(subaru, None, times)) +@pytest.mark.remote_data def test_event_observable(): epoch = Time(2452826.628514, format='jd') diff --git a/astroplan/tests/test_observer.py b/astroplan/tests/test_observer.py index c52f2f2f..89e00cdf 100644 --- a/astroplan/tests/test_observer.py +++ b/astroplan/tests/test_observer.py @@ -1094,6 +1094,7 @@ def test_timezone_convenience_methods(): assert all(naive_dts == times_dt_ndarray - datetime.timedelta(hours=4)) +@pytest.mark.remote_data def test_is_night(): lco = Observer(location=EarthLocation.of_site('lco')) # Las Campanas aao = Observer(location=EarthLocation.of_site('aao')) # Sydney, Australia @@ -1224,6 +1225,7 @@ def test_hour_angle(): assert_quantity_allclose(hour_angle, lst, atol=0.001*u.deg) +@pytest.mark.remote_data def test_tonight(): obs = Observer.at_site('Subaru') obs.height = 0 * u.m @@ -1351,6 +1353,7 @@ def test_sun_set_vs_mmto_almanac(mmto_sunset): assert abs(mmto_sunset - astroplan_sunset) < 1 * u.min +@pytest.mark.remote_data def test_observer_lon_lat_el(): """Test that astropy.EarthLocation conversion to longitude, latitude, and elevation works correctly. @@ -1360,6 +1363,7 @@ def test_observer_lon_lat_el(): assert hasattr(obs, attr) +@pytest.mark.remote_data def test_hash_observer(): """Test that Observer objects are hashable.""" obs1 = Observer.at_site('Subaru') @@ -1373,6 +1377,7 @@ def test_hash_observer(): assert hash(obs3) == hash(obs4) +@pytest.mark.remote_data def test_eq_observer(): """Test that Observer objects are comparable.""" obs1 = Observer.at_site('Subaru') diff --git a/astroplan/tests/test_scheduling.py b/astroplan/tests/test_scheduling.py index 49d88627..dd41c80a 100644 --- a/astroplan/tests/test_scheduling.py +++ b/astroplan/tests/test_scheduling.py @@ -6,6 +6,7 @@ from astropy.time import Time import astropy.units as u from astropy.coordinates import SkyCoord, EarthLocation +import pytest from ..utils import time_grid_from_range from ..observer import Observer @@ -23,7 +24,7 @@ polaris = FixedTarget(coord=SkyCoord(ra=37.95456067 * u.deg, dec=89.26410897 * u.deg), name="Polaris") -apo = Observer(EarthLocation.of_site('apo'), name='APO') +apo = Observer(EarthLocation(-1463969.30185172, -5166673.34223433, 3434985.71204565, unit='m'), name='APO') targets = [vega, polaris, rigel] default_time = Time('2016-02-06 03:00:00') only_at_night = [AtNightConstraint()] @@ -207,6 +208,7 @@ def test_sequential_scheduler(): scheduler(blocks, schedule) +@pytest.mark.remote_data def test_scheduling_target_down(): lco = Observer.at_site('lco') block = [ObservingBlock(FixedTarget.from_name('polaris'), 1 * u.min, 0)] @@ -224,6 +226,7 @@ def test_scheduling_target_down(): assert len(schedule2.observing_blocks) == 0 +@pytest.mark.remote_data def test_scheduling_during_day(): block = [ObservingBlock(FixedTarget.from_name('polaris'), 1 * u.min, 0)] day = Time('2016-02-06 03:00:00') @@ -242,6 +245,7 @@ def test_scheduling_during_day(): # bring this back when MoonIlluminationConstraint is working properly +@pytest.mark.remote_data def test_scheduling_moon_up(): block = [ObservingBlock(FixedTarget.from_name('polaris'), 30 * u.min, 0)] # on february 23 the moon was up between the start/end times defined below diff --git a/astroplan/tests/test_target.py b/astroplan/tests/test_target.py index 208a0a12..74c43694 100644 --- a/astroplan/tests/test_target.py +++ b/astroplan/tests/test_target.py @@ -14,6 +14,7 @@ from ..observer import Observer +@pytest.mark.remote_data def test_FixedTarget_from_name(): """ Check that resolving target names with the `SkyCoord.from_name` constructor @@ -30,6 +31,7 @@ def test_FixedTarget_from_name(): assert polaris_from_name.coord.separation(polaris_from_SIMBAD) < 1*u.arcsec +@pytest.mark.remote_data def test_FixedTarget_ra_dec(): """ Confirm that FixedTarget.ra and FixedTarget.dec are the same as the @@ -46,6 +48,7 @@ def test_FixedTarget_ra_dec(): 'SkyCoord') +@pytest.mark.remote_data def test_get_skycoord(): m31 = SkyCoord(10.6847083*u.deg, 41.26875*u.deg) m31_with_distance = SkyCoord(10.6847083*u.deg, 41.26875*u.deg, 780*u.kpc) From abd7ce30de120299d8565ec0384439563f41d0bd Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Fri, 29 Sep 2023 09:48:59 +0200 Subject: [PATCH 02/10] Fix codestyle problem --- astroplan/tests/test_scheduling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/astroplan/tests/test_scheduling.py b/astroplan/tests/test_scheduling.py index dd41c80a..b4e24c6d 100644 --- a/astroplan/tests/test_scheduling.py +++ b/astroplan/tests/test_scheduling.py @@ -24,7 +24,8 @@ polaris = FixedTarget(coord=SkyCoord(ra=37.95456067 * u.deg, dec=89.26410897 * u.deg), name="Polaris") -apo = Observer(EarthLocation(-1463969.30185172, -5166673.34223433, 3434985.71204565, unit='m'), name='APO') +apo = Observer(EarthLocation(-1463969.30185172, -5166673.34223433, 3434985.71204565, unit='m'), + name='APO') targets = [vega, polaris, rigel] default_time = Time('2016-02-06 03:00:00') only_at_night = [AtNightConstraint()] From 1d108aeadfe4f5afe63e311e69dd88b2fb0cccd5 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Wed, 21 Aug 2024 16:05:24 +0200 Subject: [PATCH 03/10] Add a 'remote' factor to enable remote data --- tox.ini | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 5a218f55..8b4da0fa 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py{37,38,39}-test{,-alldeps,-devdeps}{,-cov} - py{37,38,39}-test-numpy{117,118,119} - py{37,38,39}-test-astropy{lts,41,42} + py{37,38,39}-test{,-alldeps,-devdeps}{,-cov}{,-remote} + py{37,38,39}-test-numpy{117,118,119}{,-remote} + py{37,38,39}-test-astropy{lts,41,42}{,-remote} build_docs linkcheck codestyle @@ -15,7 +15,9 @@ indexserver = [testenv] # Suppress display of matplotlib plots generated during docs build -setenv = MPLBACKEND=agg +setenv = + MPLBACKEND=agg + remote: PYTEST_REMOTE_DATA=any # Pass through the following environment variables which may be needed for the CI passenv = HOME, WINDIR, LC_ALL, LC_CTYPE, CC, CI, TRAVIS @@ -38,6 +40,7 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: and test coverage + remote: with remote data numpy116: with numpy 1.16.* numpy117: with numpy 1.17.* numpy118: with numpy 1.18.* @@ -72,8 +75,8 @@ extras = commands = pip freeze - !cov: pytest --pyargs astroplan {toxinidir}/docs {posargs} - cov: pytest --pyargs astroplan {toxinidir}/docs --cov astroplan --cov-config={toxinidir}/setup.cfg {posargs} + !cov: pytest --remote-data={env:PYTEST_REMOTE_DATA:none} --pyargs astroplan {toxinidir}/docs {posargs} + cov: pytest --remote-data={env:PYTEST_REMOTE_DATA:none} --pyargs astroplan {toxinidir}/docs --cov astroplan --cov-config={toxinidir}/setup.cfg {posargs} cov: coverage xml -o {toxinidir}/coverage.xml [testenv:build_docs] From 9944a3b53652146ccccf14a79f6b45a969d2ec6a Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Wed, 21 Aug 2024 16:13:00 +0200 Subject: [PATCH 04/10] Avoid conflict in py versions --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 8b4da0fa..070bc035 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py{37,38,39}-test{,-alldeps,-devdeps}{,-cov}{,-remote} - py{37,38,39}-test-numpy{117,118,119}{,-remote} - py{37,38,39}-test-astropy{lts,41,42}{,-remote} + py{310,311,312}-test{,-alldeps,-devdeps}{,-cov}{,-remote} + py{310,311,312}-test-numpy{123,124,125}{,-remote} + py{310,311,312}-test-astropy{lts,53,60}{,-remote} build_docs linkcheck codestyle From 77d64770700160c28b35ea11902343cbb48fc3a0 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Thu, 5 Dec 2024 09:54:52 +0100 Subject: [PATCH 05/10] Add REMOTE_DATA to test with several lines * Remove REMOTE_DATA in some test where it wasn't needed --- astroplan/target.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/astroplan/target.py b/astroplan/target.py index 0cd72589..4847580a 100644 --- a/astroplan/target.py +++ b/astroplan/target.py @@ -79,7 +79,7 @@ class FixedTarget(Target): >>> from astropy.coordinates import SkyCoord >>> import astropy.units as u >>> sirius_coord = SkyCoord(ra=101.28715533*u.deg, dec=16.71611586*u.deg) - >>> sirius = FixedTarget(coord=sirius_coord, name="Sirius") # doctest: +REMOTE_DATA + >>> sirius = FixedTarget(coord=sirius_coord, name="Sirius") Create an equivalent `~astroplan.FixedTarget` object for Sirius by querying for the coordinates of Sirius by name: @@ -128,7 +128,7 @@ def from_name(cls, query_name, name=None, **kwargs): -------- >>> from astroplan import FixedTarget >>> sirius = FixedTarget.from_name("Sirius") # doctest: +REMOTE_DATA - >>> sirius.coord # doctest: +FLOAT_CMP + >>> sirius.coord # doctest: +FLOAT_CMP +REMOTE_DATA """ @@ -149,7 +149,7 @@ def __repr__(self): >>> from astroplan import FixedTarget >>> from astropy.coordinates import SkyCoord >>> vega_coord = SkyCoord(ra='279.23473479d', dec='38.78368896d') - >>> vega = FixedTarget(coord=vega_coord, name="Vega") # doctest: +REMOTE_DATA + >>> vega = FixedTarget(coord=vega_coord, name="Vega") >>> print(vega) # doctest: +FLOAT_CMP """ From c104da4f34a582a4adc27351f86ac3b5b15d52a3 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:23:17 -1000 Subject: [PATCH 06/10] Remove unnecessary code from constraints doc --- astroplan/constraints.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/astroplan/constraints.py b/astroplan/constraints.py index 204488e9..8b22b976 100644 --- a/astroplan/constraints.py +++ b/astroplan/constraints.py @@ -728,12 +728,9 @@ def __init__(self, min=None, max=None): Constrain the observations to targets that are observable between 23:50 and 04:08 local time: - >>> from astroplan import Observer - >>> from astroplan.constraints import LocalTimeConstraint >>> import datetime as dt - >>> subaru = Observer.at_site("Subaru", timezone="US/Hawaii") # doctest: +REMOTE_DATA - >>> # bound times between 23:50 and 04:08 local Hawaiian time - >>> constraint = LocalTimeConstraint(min=dt.time(23,50), max=dt.time(4,8)) + >>> from astroplan.constraints import LocalTimeConstraint + >>> constraint = LocalTimeConstraint(min=dt.time(23, 50), max=dt.time(4, 8)) """ self.min = min From 020efa97afd4bca80f4da36af68ac8f48f1e512d Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:27:07 -1000 Subject: [PATCH 07/10] More constraints doc clean up --- astroplan/constraints.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/astroplan/constraints.py b/astroplan/constraints.py index 8b22b976..3de8351f 100644 --- a/astroplan/constraints.py +++ b/astroplan/constraints.py @@ -813,12 +813,11 @@ def __init__(self, min=None, max=None): Constrain the observations to targets that are observable between 2016-03-28 and 2016-03-30: - >>> from astroplan import Observer >>> from astropy.time import Time - >>> subaru = Observer.at_site("Subaru") # doctest: +REMOTE_DATA + >>> from astroplan.constraints import TimeConstraint >>> t1 = Time("2016-03-28T12:00:00") >>> t2 = Time("2016-03-30T12:00:00") - >>> constraint = TimeConstraint(t1,t2) + >>> constraint = TimeConstraint(t1, t2) """ self.min = min self.max = max @@ -904,7 +903,8 @@ def __init__(self, periodic_event, min=None, max=None): Examples -------- - To constrain observations on orbital phases between 0.4 and 0.6, + To constrain observations on orbital phases between 0.4 and 0.6: + >>> from astroplan import PeriodicEvent >>> from astropy.time import Time >>> import astropy.units as u @@ -914,6 +914,7 @@ def __init__(self, periodic_event, min=None, max=None): The minimum and maximum phase must be described on the interval [0, 1). To constrain observations on orbital phases between 0.6 and 1.2, for example, you should subtract one from the second number: + >>> constraint = PhaseConstraint(binary, min=0.6, max=0.2) """ self.periodic_event = periodic_event From 11ccc0ae0b2207c3276af00e3bdff8d009f78028 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:32:28 -1000 Subject: [PATCH 08/10] Revert changes to tox.ini --- tox.ini | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index 63c05ce4..dcff8165 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py{310,311,312}-test{,-alldeps,-devdeps}{,-cov}{,-remote} - py{310,311,312}-test-numpy{123,124,125}{,-remote} - py{310,311,312}-test-astropy{lts,53,60}{,-remote} + py{310,311,312}-test{,-alldeps,-devdeps}{,-cov} + py{310,311,312}-test-numpy{123,124,125} + py{310,311,312}-test-astropy{lts,53,60} build_docs linkcheck codestyle @@ -15,9 +15,7 @@ indexserver = [testenv] # Suppress display of matplotlib plots generated during docs build -setenv = - MPLBACKEND=agg - remote: PYTEST_REMOTE_DATA=any +setenv = MPLBACKEND=agg # Pass through the following environment variables which may be needed for the CI passenv = HOME, WINDIR, LC_ALL, LC_CTYPE, CC, CI, TRAVIS @@ -40,7 +38,6 @@ description = devdeps: with the latest developer version of key dependencies oldestdeps: with the oldest supported version of key dependencies cov: and test coverage - remote: with remote data numpy116: with numpy 1.16.* numpy117: with numpy 1.17.* numpy118: with numpy 1.18.* @@ -75,8 +72,8 @@ extras = commands = pip freeze - !cov: pytest --remote-data={env:PYTEST_REMOTE_DATA:none} --pyargs astroplan {toxinidir}/docs {posargs} - cov: pytest --remote-data={env:PYTEST_REMOTE_DATA:none} --pyargs astroplan {toxinidir}/docs --cov astroplan --cov-config={toxinidir}/setup.cfg {posargs} + !cov: pytest --pyargs astroplan {toxinidir}/docs {posargs} + cov: pytest --pyargs astroplan {toxinidir}/docs --cov astroplan --cov-config={toxinidir}/setup.cfg {posargs} cov: coverage xml -o {toxinidir}/coverage.xml [testenv:build_docs] From 6d4d05e42015d3c2365a10e31fa5caa6a0c343c0 Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:43:56 -1000 Subject: [PATCH 09/10] Update ci_tests.yml --- .github/workflows/ci_tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index fcf497ae..8e78c674 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -42,18 +42,20 @@ jobs: - name: Windows - Python 3.11 with all optional dependencies os: windows-latest - python: 3.11 + python: '3.11' toxenv: py11-test-alldeps + toxargs: -v - name: Python 3.11 with remote data, all dependencies, and coverage os: ubuntu-latest - python: 3.11 + python: '3.11' toxenv: py11-test-alldeps-cov - toxposargs: --remote-data + toxargs: -v + posargs: --remote-data=any - name: Python 3.11 with latest dev versions of key dependencies os: ubuntu-latest - python: 3.11 + python: '3.11' toxenv: py11-test-devdeps - name: Test building of Sphinx docs @@ -79,4 +81,4 @@ jobs: run: sudo apt-get -y install graphviz - name: Test with tox run: | - tox -e ${{ matrix.toxenv }} + python -m tox -e ${{ matrix.toxenv }} ${{ matrix.toxargs }} -- ${{ matrix.posargs }} From 2fa1f42543f42bc7fa3fa9b291f6275addb9177d Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Thu, 5 Dec 2024 07:49:27 -1000 Subject: [PATCH 10/10] Update tox.ini --- tox.ini | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tox.ini b/tox.ini index dcff8165..a3d93881 100644 --- a/tox.ini +++ b/tox.ini @@ -6,19 +6,16 @@ envlist = build_docs linkcheck codestyle -requires = - setuptools >= 30.3.0 - pip >= 19.3.1 -isolated_build = true -indexserver = - NIGHTLY = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple [testenv] + # Suppress display of matplotlib plots generated during docs build -setenv = MPLBACKEND=agg +setenv = + MPLBACKEND=agg + devdeps: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple https://pypi.anaconda.org/scientific-python-nightly-wheels/simple # Pass through the following environment variables which may be needed for the CI -passenv = HOME, WINDIR, LC_ALL, LC_CTYPE, CC, CI, TRAVIS +passenv = HOME,WINDIR,LC_ALL,LC_CTYPE,CC,CI # Run the tests in a temporary directory to make sure that we don't import # this package from the source tree @@ -63,7 +60,7 @@ deps = astropy42: astropy==4.2.* devdeps: numpy>=0.0.dev0 - devdeps: git+https://github.com/astropy/astropy.git#egg=astropy + devdeps: astropy>=0.0.dev0 # The following indicates which extras_require from setup.cfg will be installed extras =