|
17 | 17 |
|
18 | 18 | # LOCAL |
19 | 19 | from astropy import config as _config |
20 | | -from astropy.utils.compat import NUMPY_LT_1_20, NUMPY_LT_1_22 |
| 20 | +from astropy.utils.compat import NUMPY_LT_1_22 |
21 | 21 | from astropy.utils.data_info import ParentDtypeInfo |
22 | 22 | from astropy.utils.exceptions import AstropyDeprecationWarning, AstropyWarning |
23 | 23 | from astropy.utils.misc import isiterable |
@@ -1838,34 +1838,19 @@ def _wrap_function(self, function, *args, unit=None, out=None, **kwargs): |
1838 | 1838 | def trace(self, offset=0, axis1=0, axis2=1, dtype=None, out=None): |
1839 | 1839 | return self._wrap_function(np.trace, offset, axis1, axis2, dtype, |
1840 | 1840 | out=out) |
1841 | | - if NUMPY_LT_1_20: |
1842 | | - def var(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False): |
1843 | | - return self._wrap_function(np.var, axis, dtype, |
1844 | | - out=out, ddof=ddof, keepdims=keepdims, |
1845 | | - unit=self.unit**2) |
1846 | | - else: |
1847 | | - def var(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True): |
1848 | | - return self._wrap_function(np.var, axis, dtype, |
1849 | | - out=out, ddof=ddof, keepdims=keepdims, where=where, |
1850 | | - unit=self.unit**2) |
1851 | | - |
1852 | | - if NUMPY_LT_1_20: |
1853 | | - def std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False): |
1854 | | - return self._wrap_function(np.std, axis, dtype, out=out, ddof=ddof, |
1855 | | - keepdims=keepdims) |
1856 | | - else: |
1857 | | - def std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True): |
1858 | | - return self._wrap_function(np.std, axis, dtype, out=out, ddof=ddof, |
1859 | | - keepdims=keepdims, where=where) |
1860 | | - |
1861 | | - if NUMPY_LT_1_20: |
1862 | | - def mean(self, axis=None, dtype=None, out=None, keepdims=False): |
1863 | | - return self._wrap_function(np.mean, axis, dtype, out=out, |
1864 | | - keepdims=keepdims) |
1865 | | - else: |
1866 | | - def mean(self, axis=None, dtype=None, out=None, keepdims=False, *, where=True): |
1867 | | - return self._wrap_function(np.mean, axis, dtype, out=out, |
1868 | | - keepdims=keepdims, where=where) |
| 1841 | + |
| 1842 | + def var(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True): |
| 1843 | + return self._wrap_function(np.var, axis, dtype, |
| 1844 | + out=out, ddof=ddof, keepdims=keepdims, where=where, |
| 1845 | + unit=self.unit**2) |
| 1846 | + |
| 1847 | + def std(self, axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True): |
| 1848 | + return self._wrap_function(np.std, axis, dtype, out=out, ddof=ddof, |
| 1849 | + keepdims=keepdims, where=where) |
| 1850 | + |
| 1851 | + def mean(self, axis=None, dtype=None, out=None, keepdims=False, *, where=True): |
| 1852 | + return self._wrap_function(np.mean, axis, dtype, out=out, |
| 1853 | + keepdims=keepdims, where=where) |
1869 | 1854 |
|
1870 | 1855 | def round(self, decimals=0, out=None): |
1871 | 1856 | return self._wrap_function(np.round, decimals, out=out) |
|
0 commit comments