Skip to content

Commit

Permalink
MNT #590 ApsCycleComputedRO
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Nov 28, 2021
1 parent e006da2 commit b6a4358
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 49 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Maintenance

Now testing with Python versions 3.7 - 3.10.

Deprecations
---------------

* Devices
* ``ApsCycleComputedRO``

1.5.4
******
Expand Down
2 changes: 0 additions & 2 deletions apstools/_devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
AD_prime_plugin
AD_prime_plugin2
ApsBssUserInfoDevice
ApsCycleComputedRO
ApsCycleDM
ApsMachineParametersDevice
ApsPssShutter
Expand Down Expand Up @@ -55,7 +54,6 @@

# other imports
from .aps_bss_user import ApsBssUserInfoDevice
from .aps_cycle import ApsCycleComputedRO
from .aps_cycle import ApsCycleDM
from .aps_machine import ApsMachineParametersDevice
from .aps_undulator import ApsUndulator
Expand Down
33 changes: 0 additions & 33 deletions apstools/_devices/aps_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.. autosummary::
~ApsCycleComputedRO
~ApsCycleDM
"""

Expand Down Expand Up @@ -141,38 +140,6 @@ def get(self):
return self._cycle_name


class ApsCycleComputedRO(SynSignalRO):
"""
DEPRECATED (1.5.4): Use newer ``ApsCycleDM`` instead.
Compute the APS cycle name based on the calendar and the usual practice.
.. index:: Ophyd Signal; ApsCycleComputedRO
Absent any facility PV that provides the name of the current operating
cycle, this can be approximated by python computation (as long as the
present scheduling pattern is maintained)
This signal is read-only.
NOTE: There is info provided by the APS proposal & ESAF systems. See
:class:`~ApsCycleDM`.
"""

def __init__(self, *args, **kwargs):
warnings.warn(
"DEPRECATED: ApsCycleComputedRO() will be removed"
" in a future release. Instead, use newer ``ApsCycleDM``.",
DeprecationWarning,
)
super().__init__(*args, **kwargs)

def get(self):
dt = datetime.datetime.now()
aps_cycle = f"{dt.year}-{int((dt.month-0.1)/4) + 1}"
return aps_cycle


# -----------------------------------------------------------------------------
# :author: Pete R. Jemian
# :email: jemian@anl.gov
Expand Down
13 changes: 0 additions & 13 deletions apstools/_devices/tests/test_aps_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
import socket

from .. import ApsCycleComputedRO
from .. import ApsCycleDM
from .. import aps_cycle

Expand All @@ -16,18 +15,6 @@ def using_APS_workstation():
return hostname.lower().endswith(".aps.anl.gov")


def test_ApsCycleComputedRO():
signal = ApsCycleComputedRO(name="signal")
assert signal.connected

cycle = signal.get() # expect 2021-3 or such
assert isinstance(cycle, str)
assert cycle != ""
assert len(cycle) == 6
assert cycle.startswith("20")
assert cycle.find("-") >= 0


def test_ApsCycleDM():
signal = ApsCycleDM(name="signal")
assert signal.connected
Expand Down
1 change: 0 additions & 1 deletion apstools/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.. autosummary::
~apstools._devices.aps_cycle.ApsCycleComputedRO
~apstools._devices.aps_cycle.ApsCycleDM
~apstools._devices.aps_machine.ApsMachineParametersDevice
~apstools._devices.shutters.ApsPssShutter
Expand Down

0 comments on commit b6a4358

Please sign in to comment.