From b6a4358926177178c13c5006a636ceff1f165662 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Sat, 27 Nov 2021 22:19:43 -0600 Subject: [PATCH] MNT #590 ApsCycleComputedRO --- CHANGES.rst | 5 ++++ apstools/_devices/__init__.py | 2 -- apstools/_devices/aps_cycle.py | 33 ----------------------- apstools/_devices/tests/test_aps_cycle.py | 13 --------- apstools/devices.py | 1 - 5 files changed, 5 insertions(+), 49 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index a3f3e3dbd..230b97d15 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -39,6 +39,11 @@ Maintenance Now testing with Python versions 3.7 - 3.10. +Deprecations +--------------- + +* Devices + * ``ApsCycleComputedRO`` 1.5.4 ****** diff --git a/apstools/_devices/__init__.py b/apstools/_devices/__init__.py index 42a0a8de7..8b105457c 100644 --- a/apstools/_devices/__init__.py +++ b/apstools/_devices/__init__.py @@ -6,7 +6,6 @@ AD_prime_plugin AD_prime_plugin2 ApsBssUserInfoDevice - ApsCycleComputedRO ApsCycleDM ApsMachineParametersDevice ApsPssShutter @@ -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 diff --git a/apstools/_devices/aps_cycle.py b/apstools/_devices/aps_cycle.py index 6c2144e09..528a337ca 100644 --- a/apstools/_devices/aps_cycle.py +++ b/apstools/_devices/aps_cycle.py @@ -4,7 +4,6 @@ .. autosummary:: - ~ApsCycleComputedRO ~ApsCycleDM """ @@ -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 diff --git a/apstools/_devices/tests/test_aps_cycle.py b/apstools/_devices/tests/test_aps_cycle.py index 20f40f96c..bc3c683fe 100644 --- a/apstools/_devices/tests/test_aps_cycle.py +++ b/apstools/_devices/tests/test_aps_cycle.py @@ -6,7 +6,6 @@ import pytest import socket -from .. import ApsCycleComputedRO from .. import ApsCycleDM from .. import aps_cycle @@ -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 diff --git a/apstools/devices.py b/apstools/devices.py index 9b736f0e4..80cd00ee6 100644 --- a/apstools/devices.py +++ b/apstools/devices.py @@ -7,7 +7,6 @@ .. autosummary:: - ~apstools._devices.aps_cycle.ApsCycleComputedRO ~apstools._devices.aps_cycle.ApsCycleDM ~apstools._devices.aps_machine.ApsMachineParametersDevice ~apstools._devices.shutters.ApsPssShutter