Skip to content

Commit

Permalink
Merge branch 'main' into local_test
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim authored Dec 5, 2024
2 parents 77d6477 + bf5e26d commit c810cf8
Show file tree
Hide file tree
Showing 31 changed files with 70 additions and 111 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: ".github/workflows" # Location of package manifests
schedule:
interval: "monthly"
groups:
actions:
patterns:
- "*"

4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v4
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
Expand Down
11 changes: 10 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
0.10 (unreleased)
0.11 (unreleased)
-----------------

0.10.1 (2024-08-13)
-------------------

- Compatibility with numpy 2.0. [#587]

0.10 (2024-04-04)
-----------------

- Fix compatibility with astropy v6.0.

0.9.1 (2023-09-20)
------------------
Expand Down
29 changes: 13 additions & 16 deletions astroplan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@
* Docs: https://astroplan.readthedocs.io/
"""

# Affiliated packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import *
# ----------------------------------------------------------------------------
try:
from .version import version as __version__
except ImportError:
__version__ = ''

# For egg_info test builds to pass, put package imports here.
if not _ASTROPY_SETUP_:
from .utils import *
from .observer import *
from .target import *
from .exceptions import *
from .moon import *
from .constraints import *
from .scheduling import *
from .periodic import *
from .utils import *
from .observer import *
from .target import *
from .exceptions import *
from .moon import *
from .constraints import *
from .scheduling import *
from .periodic import *

download_IERS_A()
download_IERS_A()
25 changes: 0 additions & 25 deletions astroplan/_astropy_init.py

This file was deleted.

5 changes: 1 addition & 4 deletions astroplan/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
an observer.
"""

from __future__ import (absolute_import, division, print_function,
unicode_literals)

# Standard library
from abc import ABCMeta, abstractmethod
import datetime
Expand Down Expand Up @@ -240,7 +237,7 @@ def __call__(self, observer, targets, times=None,
WHAT HAPPENS WHEN BOTH TIMES AND TIME_RANGE ARE SET?
time_range : `~astropy.time.Time` (length = 2)
Lower and upper bounds on time sequence.
time_grid_resolution : `~astropy.units.quantity`
time_grid_resolution : `~astropy.units.Quantity`
Time-grid spacing
grid_times_targets : bool
if True, grids the constraint result with targets along the first
Expand Down
2 changes: 0 additions & 2 deletions astroplan/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from astropy.utils.exceptions import AstropyWarning

Expand Down
3 changes: 0 additions & 3 deletions astroplan/moon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
This version of the `moon` module calculates lunar phase angle for a geocentric
"""

from __future__ import (absolute_import, division, print_function,
unicode_literals)

# Third-party
import numpy as np
from astropy.coordinates import get_sun, get_body
Expand Down
5 changes: 1 addition & 4 deletions astroplan/observer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from six import string_types

# Standard library
import sys
Expand Down Expand Up @@ -216,7 +213,7 @@ def __init__(self, location=None, timezone='UTC', name=None, latitude=None,
# Accept various timezone inputs, default to UTC
if isinstance(timezone, datetime.tzinfo):
self.timezone = timezone
elif isinstance(timezone, string_types):
elif isinstance(timezone, str):
self.timezone = pytz.timezone(timezone)
else:
raise TypeError('timezone keyword should be a string, or an '
Expand Down
2 changes: 0 additions & 2 deletions astroplan/periodic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import astropy.units as u
from astropy.time import Time
Expand Down
2 changes: 0 additions & 2 deletions astroplan/plots/finder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import numpy as np

Expand Down
3 changes: 0 additions & 3 deletions astroplan/plots/mplstyles.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import copy

from astropy.visualization import astropy_mpl_style
Expand Down
2 changes: 0 additions & 2 deletions astroplan/plots/tests/test_sky.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import pytest

try:
Expand Down
2 changes: 0 additions & 2 deletions astroplan/plots/time_dependent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import copy
import numpy as np
import operator
Expand Down
17 changes: 7 additions & 10 deletions astroplan/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
Tools for scheduling observations.
"""

from __future__ import (absolute_import, division, print_function,
unicode_literals)

import copy
from abc import ABCMeta, abstractmethod

Expand All @@ -24,7 +21,7 @@
'Transitioner', 'Scorer']


class ObservingBlock(object):
class ObservingBlock:
"""
An observation to be scheduled, consisting of a target and associated
constraints on observations.
Expand Down Expand Up @@ -98,7 +95,7 @@ def from_exposures(cls, target, priority, time_per_exposure,
return ob


class Scorer(object):
class Scorer:
"""
Returns scores and score arrays from the evaluation of constraints on
observing blocks
Expand Down Expand Up @@ -166,7 +163,7 @@ def from_start_end(cls, blocks, observer, start_time, end_time,
return sc


class TransitionBlock(object):
class TransitionBlock:
"""
Parameterizes the "dead time", e.g. between observations, while the
telescope is slewing, instrument is reconfiguring, etc.
Expand Down Expand Up @@ -224,7 +221,7 @@ def from_duration(cls, duration):
return tb


class Schedule(object):
class Schedule:
"""
An object that represents a schedule, consisting of a list of
`~astroplan.scheduling.Slot` objects.
Expand Down Expand Up @@ -423,7 +420,7 @@ def change_slot_block(self, slot_index, new_block=None):
return slot_index - 1


class Slot(object):
class Slot:
"""
A time slot consisting of a start and end time
"""
Expand Down Expand Up @@ -481,7 +478,7 @@ def split_slot(self, early_time, later_time):
return [new_slot]


class Scheduler(object):
class Scheduler:
"""
Schedule a set of `~astroplan.scheduling.ObservingBlock` objects
"""
Expand Down Expand Up @@ -948,7 +945,7 @@ def attempt_insert_block(self, b, new_start_time, start_time_idx):
return True


class Transitioner(object):
class Transitioner:
"""
A class that defines how to compute transition times from one block to
another.
Expand Down
2 changes: 0 additions & 2 deletions astroplan/target.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

# Standard library
from abc import ABCMeta
Expand Down
8 changes: 6 additions & 2 deletions astroplan/tests/test_constraints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import datetime as dt

import numpy as np
Expand Down Expand Up @@ -183,6 +181,8 @@ 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
# astropy.coordinates.errors.NonRotationTransformationWarning
@pytest.mark.filterwarnings("ignore")
def test_sun_separation():
time = Time('2003-04-05 06:07:08')
apo = Observer.at_site("APO")
Expand All @@ -208,6 +208,8 @@ def test_sun_separation():


@pytest.mark.remote_data
# astropy.coordinates.errors.NonRotationTransformationWarning
@pytest.mark.filterwarnings("ignore")
def test_moon_separation():
time = Time('2003-04-05 06:07:08')
apo = Observer.at_site("APO")
Expand Down Expand Up @@ -439,6 +441,8 @@ def test_rescale_minmax():

@pytest.mark.remote_data
@pytest.mark.parametrize('constraint', constraint_tests)
# astropy.coordinates.errors.NonRotationTransformationWarning
@pytest.mark.filterwarnings("ignore")
def test_regression_shapes(constraint):
times = Time(["2015-08-28 03:30", "2015-09-05 10:30", "2015-09-15 18:35"])
targets = get_skycoord([FixedTarget(SkyCoord(350.7*u.deg, 18.4*u.deg)),
Expand Down
3 changes: 0 additions & 3 deletions astroplan/tests/test_moon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from ..observer import Observer
from astropy.time import Time
from astropy.coordinates import EarthLocation
Expand Down
2 changes: 0 additions & 2 deletions astroplan/tests/test_observer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

# Standard library
import datetime
Expand Down
3 changes: 0 additions & 3 deletions astroplan/tests/test_periodic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import numpy as np
from astropy.time import Time
import astropy.units as u
Expand Down
2 changes: 0 additions & 2 deletions astroplan/tests/test_scheduling.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import numpy as np
from astropy.time import Time
Expand Down
2 changes: 0 additions & 2 deletions astroplan/tests/test_target.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import pytest

Expand Down
3 changes: 0 additions & 3 deletions astroplan/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import numpy as np
import pytest

Expand Down
4 changes: 1 addition & 3 deletions astroplan/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)

# Standard library
import warnings
Expand Down Expand Up @@ -85,7 +83,7 @@ def time_grid_from_range(time_range, time_resolution=0.5*u.hour):
time_range : `~astropy.time.Time` (length = 2)
Lower and upper bounds on time sequence.
time_resolution : `~astropy.units.quantity` (optional)
time_resolution : `~astropy.units.Quantity` (optional)
Time-grid spacing
Returns
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@
# continue
# dtype, target = line.split(None, 1)
# target = target.strip()
# nitpick_ignore.append((dtype, six.u(target)))
# nitpick_ignore.append((dtype, str(target)))
2 changes: 1 addition & 1 deletion docs/faq/iers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ astropy's IERS machinery:
import numpy as np
import astropy.units as u
from astropy.time import Time
from six.moves.urllib.error import HTTPError
from urllib.error import HTTPError

# Download and cache the IERS Bulletins A and B using astropy's machinery
# (reminder: astroplan has its own function for this: `download_IERS_A`)
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Requirements
============

**astroplan** works on Linux, Mac OS X and Windows.
It requires Python 3.7+ as well as numpy, astropy, pytz, and six.
It requires Python 3.7+ as well as numpy, astropy, and pytz.
Additional features are available when you install `Matplotlib`_
and `astroquery`_.

Expand Down
Loading

0 comments on commit c810cf8

Please sign in to comment.