From 00487e71ecc6a17defe0d636cfa3caf6527e153b Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Fri, 8 Sep 2023 16:53:09 -0400 Subject: [PATCH 1/9] numpy.infty --> numpy.inf in one test (#600) --- tests/test_potential.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_potential.py b/tests/test_potential.py index 58965c237..c21a11f50 100644 --- a/tests/test_potential.py +++ b/tests/test_potential.py @@ -6026,7 +6026,7 @@ def pot(R, z, amp=1.0, a=0.75): * special.jv(0, k * a) * numpy.exp(-k * numpy.fabs(z)), 0.0, - numpy.infty, + numpy.inf, )[0] ) From 0d1319e2f0e0dcb0779765417c35aa8e4459951d Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Fri, 8 Sep 2023 22:32:21 -0400 Subject: [PATCH 2/9] Add Python 3.12 wheels (#601) --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f807415a9..f08670fe4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -35,7 +35,7 @@ jobs: - [macos-latest, macosx, x86_64] - [macos-latest, macosx, arm64] - [windows-2019, win, amd64] - python: ["cp38", "cp39", "cp310", "cp311"] + python: ["cp38", "cp39", "cp310", "cp311", "cp312"] steps: - uses: actions/checkout@v3 - name: Install GSL (Windows / Mac OS x86_64) From 116d550f5a891f470949da15497554f680efeec4 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Sun, 10 Sep 2023 20:47:14 -0400 Subject: [PATCH 3/9] No more universal homebrew installs --- doc/source/installation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/installation.rst b/doc/source/installation.rst index 969670de1..305cd7e45 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -147,7 +147,7 @@ If you are reading this, either the simple installation instructions at the top To compile ``galpy`` from source, you will first need to install the GSL. The easiest way to do this is using `Homebrew `__ as:: - brew install gsl --universal + brew install gsl Alternatively, you can use ``conda`` to install the GSL and use ``conda`` to manage your Python environment. Install the GSL in your preferred environment @@ -444,7 +444,7 @@ The easiest way to install this is using its Anaconda build:: If you do not want to go that route, on a Mac, the next easiest way to install the GSL is using `Homebrew `_ as:: - brew install gsl --universal + brew install gsl You should be able to check your version using (on Mac/Linux):: From 533eef031c7d7596ffe1ea1dc7d7375bf384543a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Sep 2023 23:28:57 -0400 Subject: [PATCH 4/9] Bump actions/checkout from 3 to 4 (#604) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/build_pyodide_wheels.yml | 2 +- .github/workflows/build_windows.yml | 2 +- .github/workflows/wheels.yml | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 629c4afaf..9ad01a412 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -195,7 +195,7 @@ jobs: env: PYTHON_COVREPORTS_VERSION: "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/build_pyodide_wheels.yml b/.github/workflows/build_pyodide_wheels.yml index 6548be1eb..7410219c3 100644 --- a/.github/workflows/build_pyodide_wheels.yml +++ b/.github/workflows/build_pyodide_wheels.yml @@ -35,7 +35,7 @@ jobs: name: Build pyodide/wasm wheels runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: 3.10.2 diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 13c28cbda..6403fb516 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -161,7 +161,7 @@ jobs: REQUIRES_NUMBA: false REQUIRES_JAX: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f08670fe4..21953aad5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -37,7 +37,7 @@ jobs: - [windows-2019, win, amd64] python: ["cp38", "cp39", "cp310", "cp311", "cp312"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install GSL (Windows / Mac OS x86_64) uses: mamba-org/setup-micromamba@v1 if: matrix.buildplat[1] == 'win' || ( matrix.buildplat[1] == 'macosx' && matrix.buildplat[2] == 'x86_64' ) @@ -108,7 +108,7 @@ jobs: runs-on: ubuntu-latest steps: # check-out this repository - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Setup python - name: Set up Python uses: actions/setup-python@v4 @@ -132,7 +132,7 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'created' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | mkdir tmp_wheelhouse mkdir wheelhouse @@ -152,7 +152,7 @@ jobs: runs-on: ubuntu-latest if: github.event_name != 'release' && github.event_name != 'pull_request' && github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | mkdir tmp_wheelhouse mkdir wheelhouse From b2e30cf1de09c7c72ccfeeada2d4efa7580eaa3e Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Mon, 25 Sep 2023 11:03:38 -0400 Subject: [PATCH 5/9] Adjust tolerance for spiral arms tests for numpy 1.26 --- tests/test_SpiralArmsPotential.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_SpiralArmsPotential.py b/tests/test_SpiralArmsPotential.py index 39c1e4330..20777f418 100644 --- a/tests/test_SpiralArmsPotential.py +++ b/tests/test_SpiralArmsPotential.py @@ -3,8 +3,8 @@ _NUMPY_VERSION = parse_version(numpy.__version__) _NUMPY_1_23 = (_NUMPY_VERSION > parse_version("1.22")) * ( - _NUMPY_VERSION < parse_version("1.26") -) # For testing 1.23/1.24/1.25 precision issues + _NUMPY_VERSION < parse_version("1.27") +) # For testing 1.23/1.24/1.25/1.26 precision issues import unittest from numpy.testing import assert_allclose From 5827b91816db337daf886593d0c4c4aa5f62c8aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:07:18 -0400 Subject: [PATCH 6/9] Bump pypa/cibuildwheel from 2.15 to 2.16 (#605) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 21953aad5..7e10d3e73 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -88,7 +88,7 @@ jobs: rsync -azv gsl/lib/ /usr/local/lib/ echo "REPAIR_LIBRARY_PATH=/usr/local/lib/" >> $GITHUB_ENV # https://github.com/pypa/cibuildwheel/issues/816#issuecomment-916197079 - name: Build wheels - uses: pypa/cibuildwheel@v2.15 + uses: pypa/cibuildwheel@v2.16 env: CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}_${{ matrix.buildplat[2] }} CIBW_BUILD_VERBOSITY: 1 From ac7de0f04f040b281b9e5b9ac11075f131841bfa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:49:31 +0000 Subject: [PATCH 7/9] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.10.1 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.14.0) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bf1bad66..1588ca9e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: check-executables-have-shebangs - id: check-yaml - repo: https://github.com/asottile/pyupgrade - rev: v3.10.1 + rev: v3.14.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -30,12 +30,12 @@ repos: - id: isort name: isort (python) - repo: https://github.com/codespell-project/codespell - rev: "v2.2.5" + rev: "v2.2.6" hooks: - id: codespell args: ["-L", "thisE,thise,mye,tE,te,hist,ro,sav,ccompiler,aas", "-x","doc/source/_static/try-galpy.js"] - repo: https://github.com/psf/black - rev: 23.7.0 + rev: 23.9.1 hooks: - id: black From 67b9e16805929bb1c7e941daf63b90162cf7d971 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Tue, 3 Oct 2023 09:46:50 -0400 Subject: [PATCH 8/9] Fix typos --- doc/source/basic_df.rst | 4 ++-- galpy/actionAngle/actionAngleAdiabaticGrid.py | 2 +- galpy/actionAngle/actionAngleStaeckelGrid.py | 2 +- galpy/df/quasiisothermaldf.py | 2 +- galpy/df/sphericaldf.py | 4 ++-- galpy/orbit/Orbits.py | 6 +++--- galpy/orbit/integrateFullOrbit.py | 2 +- galpy/orbit/integratePlanarOrbit.py | 2 +- galpy/orbit/orbit_c_ext/integrateFullOrbit.c | 2 +- galpy/orbit/orbit_c_ext/integratePlanarOrbit.c | 4 ++-- galpy/potential/SnapshotRZPotential.py | 2 +- galpy/potential/potential_c_ext/NonInertialFrameForce.c | 2 +- galpy/util/bovy_rk.c | 2 +- tests/test_coords.py | 8 ++++---- tests/test_evolveddiskdf.py | 4 ++-- tests/test_potential.py | 4 ++-- tests/test_qdf.py | 6 +++--- tests/test_sphericaldf.py | 8 ++++---- 18 files changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/source/basic_df.rst b/doc/source/basic_df.rst index 586b40a04..3b4222080 100644 --- a/doc/source/basic_df.rst +++ b/doc/source/basic_df.rst @@ -430,7 +430,7 @@ The warm response is slightly smaller in amplitude although the numerical uncertainty in ``mvrwarm`` is large, because the grid is not sufficiently fine. -We can then re-use this grid in calculations of other moments of +We can then reuse this grid in calculations of other moments of the DF, e.g., >>> print(edfcold.meanvT(0.9,phi=22.5,deg=True,t=0.,grid=gridcold)) @@ -468,7 +468,7 @@ A_{\mathrm{axi}}+0.05/(2\sqrt{2})` where :math:`A_{\mathrm{axi}} = >>> print(oortacold-(0.5/0.9+0.05/2./sqrt(2.))) # 0.0022613349141670236 -These grids can then be re-used for the other Oort functions, for +These grids can then be reused for the other Oort functions, for example, >>> print(edfcold.oortB(0.9,phi=22.5,deg=True,t=0.,grid=gridcold,derivphiGrid=gridphicold,derivRGrid=gridrcold)) diff --git a/galpy/actionAngle/actionAngleAdiabaticGrid.py b/galpy/actionAngle/actionAngleAdiabaticGrid.py index 6ffd8752a..0e97d5219 100644 --- a/galpy/actionAngle/actionAngleAdiabaticGrid.py +++ b/galpy/actionAngle/actionAngleAdiabaticGrid.py @@ -56,7 +56,7 @@ def __init__( nEz=, nEr=, nLz, nR= grid size - numcores= number of cpus to use to parallellize + numcores= number of cpus to use to parallelize c= if True, use C to calculate actions diff --git a/galpy/actionAngle/actionAngleStaeckelGrid.py b/galpy/actionAngle/actionAngleStaeckelGrid.py index 84268eb0c..67ed145e0 100644 --- a/galpy/actionAngle/actionAngleStaeckelGrid.py +++ b/galpy/actionAngle/actionAngleStaeckelGrid.py @@ -55,7 +55,7 @@ def __init__( interpecc= (False) if True, also interpolate the approximate eccentricity, zmax, rperi, and rapo - numcores= number of cpus to use to parallellize + numcores= number of cpus to use to parallelize ro= distance from vantage point to GC (kpc; can be Quantity) diff --git a/galpy/df/quasiisothermaldf.py b/galpy/df/quasiisothermaldf.py index 3d3bde05c..1a72318c7 100644 --- a/galpy/df/quasiisothermaldf.py +++ b/galpy/df/quasiisothermaldf.py @@ -2075,7 +2075,7 @@ def meanlz(self, R, z, nsigma=None, mc=True, nmc=10000, **kwargs): PURPOSE: - calculate the mean angular momemtum by marginalizing over velocity + calculate the mean angular momentum by marginalizing over velocity INPUT: diff --git a/galpy/df/sphericaldf.py b/galpy/df/sphericaldf.py index 7ed327dd4..25a09239c 100644 --- a/galpy/df/sphericaldf.py +++ b/galpy/df/sphericaldf.py @@ -77,7 +77,7 @@ def __init__(self, pot=None, denspot=None, rmax=None, scale=None, ro=None, vo=No ) phys = conversion.get_physical(pot, include_set=True) # if pot has physical units, transfer them (if already on, we know - # they are compaible) + # they are compatible) if phys["roSet"] and phys["voSet"]: self.turn_physical_on(ro=phys["ro"], vo=phys["vo"]) if pot is None: # pragma: no cover @@ -731,7 +731,7 @@ def _call_internal(self, *args): INPUT: - E,L,Lz - The energy, angular momemtum magnitude, and its z component (only E is used) + E,L,Lz - The energy, angular momentum magnitude, and its z component (only E is used) OUTPUT: diff --git a/galpy/orbit/Orbits.py b/galpy/orbit/Orbits.py index 879ff3d98..d2f041d6b 100644 --- a/galpy/orbit/Orbits.py +++ b/galpy/orbit/Orbits.py @@ -2705,7 +2705,7 @@ def _setupaA(self, pot=None, type="staeckel", **kwargs): return None def _setup_EccZmaxRperiRap(self, pot=None, **kwargs): - """Internal function to compute e,zmax,rperi,rap and cache it for re-use""" + """Internal function to compute e,zmax,rperi,rap and cache it for reuse""" self._setupaA(pot=pot, **kwargs) if hasattr(self, "_aA_ecc"): return None @@ -2738,7 +2738,7 @@ def _setup_EccZmaxRperiRap(self, pot=None, **kwargs): return None def _setup_actionsFreqsAngles(self, pot=None, **kwargs): - """Internal function to compute the actions, frequencies, and angles and cache them for re-use""" + """Internal function to compute the actions, frequencies, and angles and cache them for reuse""" self._setupaA(pot=pot, **kwargs) if hasattr(self, "_aA_jr"): return None @@ -2777,7 +2777,7 @@ def _setup_actionsFreqsAngles(self, pot=None, **kwargs): return None def _setup_actions(self, pot=None, **kwargs): - """Internal function to compute the actions and cache them for re-use (used for methods that don't support frequencies and angles)""" + """Internal function to compute the actions and cache them for reuse (used for methods that don't support frequencies and angles)""" self._setupaA(pot=pot, **kwargs) # Caching effectively checked in _setup_actionsFreqsAngles, because always called first # if hasattr(self, "_aA_jr"): diff --git a/galpy/orbit/integrateFullOrbit.py b/galpy/orbit/integrateFullOrbit.py index 3d8948b63..18eb40329 100644 --- a/galpy/orbit/integrateFullOrbit.py +++ b/galpy/orbit/integrateFullOrbit.py @@ -1142,7 +1142,7 @@ def _rectForce(x, pot, t=0.0, vx=None): x - current position t - current time pot - (list of) Potential instance(s) - vx = (None) if set, use this [vx,vy,vz] when evalulating dissipative forces + vx = (None) if set, use this [vx,vy,vz] when evaluating dissipative forces OUTPUT: force HISTORY: diff --git a/galpy/orbit/integratePlanarOrbit.py b/galpy/orbit/integratePlanarOrbit.py index 5407b96ff..e8fbf38a1 100644 --- a/galpy/orbit/integratePlanarOrbit.py +++ b/galpy/orbit/integratePlanarOrbit.py @@ -1590,7 +1590,7 @@ def _planarRectForce(x, pot, t=0.0, vx=None): x - current position t - current time pot - (list of) Potential instance(s) - vx = (None) if set, use this [vx,vy] when evalulating dissipative forces + vx = (None) if set, use this [vx,vy] when evaluating dissipative forces OUTPUT: force HISTORY: diff --git a/galpy/orbit/orbit_c_ext/integrateFullOrbit.c b/galpy/orbit/orbit_c_ext/integrateFullOrbit.c index 0dc3ce19a..328e1b0e5 100644 --- a/galpy/orbit/orbit_c_ext/integrateFullOrbit.c +++ b/galpy/orbit/orbit_c_ext/integrateFullOrbit.c @@ -932,7 +932,7 @@ void evalRectDeriv(double t, double *q, double *a, void evalSOSDeriv(double psi, double *q, double *a, int nargs, struct potentialArg * potentialArgs){ - // q= (x,y,vx,vy,A,t,psi); to save operations, we re-use a first for the + // q= (x,y,vx,vy,A,t,psi); to save operations, we reuse a first for the // rectForce then for the actual RHS // Note also that we keep track of psi in q+6, not in psi! This is // such that we can avoid having to convert psi to psi+psi0 diff --git a/galpy/orbit/orbit_c_ext/integratePlanarOrbit.c b/galpy/orbit/orbit_c_ext/integratePlanarOrbit.c index 558ec26e0..f22ee9c11 100644 --- a/galpy/orbit/orbit_c_ext/integratePlanarOrbit.c +++ b/galpy/orbit/orbit_c_ext/integratePlanarOrbit.c @@ -876,7 +876,7 @@ void evalPlanarRectDeriv(double t, double *q, double *a, void evalPlanarSOSDerivx(double psi, double *q, double *a, int nargs, struct potentialArg * potentialArgs){ - // q= (y,vy,A,t,psi); to save operations, we re-use a first for the + // q= (y,vy,A,t,psi); to save operations, we reuse a first for the // rectForce then for the actual RHS // Note also that we keep track of psi in q+4, not in psi! This is // such that we can avoid having to convert psi to psi+psi0 @@ -910,7 +910,7 @@ void evalPlanarSOSDerivx(double psi, double *q, double *a, void evalPlanarSOSDerivy(double psi, double *q, double *a, int nargs, struct potentialArg * potentialArgs){ - // q= (x,vx,A,t,psi); to save operations, we re-use a first for the + // q= (x,vx,A,t,psi); to save operations, we reuse a first for the // rectForce then for the actual RHS // Note also that we keep track of psi in q+4, not in psi! This is // such that we can avoid having to convert psi to psi+psi0 diff --git a/galpy/potential/SnapshotRZPotential.py b/galpy/potential/SnapshotRZPotential.py index cb30030c8..191b70f7f 100644 --- a/galpy/potential/SnapshotRZPotential.py +++ b/galpy/potential/SnapshotRZPotential.py @@ -489,7 +489,7 @@ def _setup_potential(self, R, z, use_pkdgrav=False, dr=0.0001): ) # do the same for the mixed radial-vertical component - if self._interpepifreq and self._interpverticalfreq: # re-use this + if self._interpepifreq and self._interpverticalfreq: # reuse this Rzgrad = numpy.zeros(len(points_new)) for i, racc in enumerate( rgrad_acc.reshape((len(rgrad_acc) // 2, 2, 3)) diff --git a/galpy/potential/potential_c_ext/NonInertialFrameForce.c b/galpy/potential/potential_c_ext/NonInertialFrameForce.c index e877b811e..172eb5544 100644 --- a/galpy/potential/potential_c_ext/NonInertialFrameForce.c +++ b/galpy/potential/potential_c_ext/NonInertialFrameForce.c @@ -114,7 +114,7 @@ void NonInertialFrameForcexyzforces_xyz(double R,double z,double phi,double t, v0x= (*(*(potentialArgs->tfuncs+6)))(t); v0y= (*(*(potentialArgs->tfuncs+7)))(t); v0z= (*(*(potentialArgs->tfuncs+8)))(t); - // Re-use variable + // Reuse variable Omegatimesvecx= Omegax * x0x + Omegay * x0y + Omegaz * x0z; *Fx+= 2. * ( Omegaz * v0y - Omegay * v0z ) + Omega2 * x0x - Omegax * Omegatimesvecx; *Fy+= -2. * ( Omegaz * v0x - Omegax * v0z ) + Omega2 * x0y - Omegay * Omegatimesvecx; diff --git a/galpy/util/bovy_rk.c b/galpy/util/bovy_rk.c index 29fddff5f..afff01218 100644 --- a/galpy/util/bovy_rk.c +++ b/galpy/util/bovy_rk.c @@ -313,7 +313,7 @@ void bovy_rk6_onestep(void (*func)(double t, double *q, double *a, //calculate k6 func(tn+dt/2.,ynk,a,nargs,potentialArgs); for (ii=0; ii < dim; ii++) *(yn1+ii) -= 32.* dt * *(a+ii) / 120.; - for (ii=0; ii < dim; ii++) *(k5+ii)= dt * *(a+ii); //re-use k5 for k6 + for (ii=0; ii < dim; ii++) *(k5+ii)= dt * *(a+ii); //reuse k5 for k6 for (ii=0; ii < dim; ii++) *(ynk+ii)= *(yn+ii) + ( 9. * *(k1+ii) - 36. * *(k2+ii) +63.* *(k3+ii) diff --git a/tests/test_coords.py b/tests/test_coords.py index 11aa1239c..b2693e249 100644 --- a/tests/test_coords.py +++ b/tests/test_coords.py @@ -3073,8 +3073,8 @@ def test_radec_to_custom_pal5(): ) xieta = coords.radec_to_custom(_RAPAL5, _DECPAL5, T=_TPAL5, degree=False) - def checkrng(x, xpct, dom, shft): - return numpy.fabs(((numpy.fabs(x - xpct) + shft) % dom) - shft) + def checkrng(x, xpct, dom, shift): + return numpy.fabs(((numpy.fabs(x - xpct) + shift) % dom) - shift) # 0 < xieta[0] < 2 * pi assert ( @@ -3231,8 +3231,8 @@ def test_custom_to_radec_pal5(): # FIXME COMPARE TO DOCUMENT ) xieta = coords.custom_to_radec(_RAPAL5, _DECPAL5, T=_TPAL5.T, degree=False) - def checkrng(x, xpct, dom, shft): - return numpy.fabs(((numpy.fabs(x - xpct) + shft) % dom) - shft) + def checkrng(x, xpct, dom, shift): + return numpy.fabs(((numpy.fabs(x - xpct) + shift) % dom) - shift) # 0 < xieta[0] < 2 * pi assert ( diff --git a/tests/test_evolveddiskdf.py b/tests/test_evolveddiskdf.py index 55392452e..8c55aabb4 100644 --- a/tests/test_evolveddiskdf.py +++ b/tests/test_evolveddiskdf.py @@ -1311,7 +1311,7 @@ def test_plot_grid(): gridpoints=_GRIDPOINTS, ) grid.plot() - # w/ list of tiems + # w/ list of times mvr, grid = edf.meanvR( 0.9, t=[0.0, -2.5, -5.0, -7.5, -10.0], @@ -1342,7 +1342,7 @@ def test_plot_hierarchgrid(): gridpoints=_GRIDPOINTS, ) grid.plot() - # w/ list of tiems + # w/ list of times mvr, grid = edf.meanvR( 0.9, t=[0.0, -2.5, -5.0, -7.5, -10.0], diff --git a/tests/test_potential.py b/tests/test_potential.py index c21a11f50..b56c05021 100644 --- a/tests/test_potential.py +++ b/tests/test_potential.py @@ -7284,13 +7284,13 @@ def test_TimeDependentAmplitudeWrapperPotential_inputerrors(): match="A= input to TimeDependentAmplitudeWrapperPotential should be a function", ): tp = TimeDependentAmplitudeWrapperPotential(pot=lp) - # TypeError when suppplying a function with no argument + # TypeError when supplying a function with no argument with pytest.raises( TypeError, match="A= input to TimeDependentAmplitudeWrapperPotential should be a function that can be called with a single parameter", ): tp = TimeDependentAmplitudeWrapperPotential(pot=lp, A=lambda: 1.0) - # TypeError when suppplying a function with more than 1 argument + # TypeError when supplying a function with more than 1 argument with pytest.raises( TypeError, match="A= input to TimeDependentAmplitudeWrapperPotential should be a function that can be called with a single parameter", diff --git a/tests/test_qdf.py b/tests/test_qdf.py index 22ec4a325..63733e2fd 100644 --- a/tests/test_qdf.py +++ b/tests/test_qdf.py @@ -1460,7 +1460,7 @@ def test_vmomentdensity_diffinoutputs(): ) < 0.05 ), "vmomentsurfmass w/ wrong glqeval input does not work" - # Test that we can re-use jr, etc. + # Test that we can reuse jr, etc. surfmass, jr, lz, jz = qdf.vmomentdensity( R, z, 0.0, 0.0, 0.0, gl=True, _return_actions=True ) @@ -1472,7 +1472,7 @@ def test_vmomentdensity_diffinoutputs(): ) ) < 0.01 - ), "surfacemass calculated from re-used actions does not agree with that before" + ), "surfacemass calculated from reused actions does not agree with that before" surfmass, jr, lz, jz, rg, kappa, nu, Omega = qdf.vmomentdensity( R, z, 0.0, 0.0, 0.0, gl=True, _return_actions=True, _return_freqs=True ) @@ -1498,7 +1498,7 @@ def test_vmomentdensity_diffinoutputs(): ) ) < 0.01 - ), "surfacemass calculated from re-used actions does not agree with that before" + ), "surfacemass calculated from reused actions does not agree with that before" # Some tests of mc=True surfmass, vrs, vts, vzs = qdf.vmomentdensity( R, z, 0.0, 0.0, 0.0, mc=True, gl=False, _rawgausssamples=True, _returnmc=True diff --git a/tests/test_sphericaldf.py b/tests/test_sphericaldf.py index bf1f1fafb..de50d1067 100644 --- a/tests/test_sphericaldf.py +++ b/tests/test_sphericaldf.py @@ -1669,7 +1669,7 @@ def test_king_beta_directint(): ############################### OSIPKOV-MERRITT DF ############################ # For the following tests, we use a DehnenCoreSphericalPotential -osipkovmerritt_dfs_selfconsist = None # re-use in other tests +osipkovmerritt_dfs_selfconsist = None # reuse in other tests def test_osipkovmerritt_selfconsist_dehnencore_dens_spherically_symmetric(): @@ -1831,7 +1831,7 @@ def test_osipkovmerritt_selfconsist_dehnencore_Qoutofbounds(): # For the following tests, we use a DehnenCoreSphericalPotential embedded in # an NFW halo -osipkovmerritt_dfs_dehnencore_in_nfw = None # re-use in other tests +osipkovmerritt_dfs_dehnencore_in_nfw = None # reuse in other tests def test_osipkovmerritt_dehnencore_in_nfw_dens_spherically_symmetric(): @@ -2028,7 +2028,7 @@ def test_constantbetadf_against_hernquist(): # For the following tests, we use a DehnenCoreSphericalPotential -constantbeta_dfs_selfconsist = None # re-use in other tests +constantbeta_dfs_selfconsist = None # reuse in other tests @pytest.fixture(scope="module") @@ -2268,7 +2268,7 @@ def test_constantbeta_selfconsist_dehnencore_rmin_inbounds( # For the following tests, we use a DehnenCoreSphericalPotential embedded in # an NFW halo -constantbeta_dfs_dehnencore_in_nfw = None # re-use in other tests +constantbeta_dfs_dehnencore_in_nfw = None # reuse in other tests def test_constantbeta_dehnencore_in_nfw_dens_spherically_symmetric(): From 2c776138491ae7871f9a583c382ac0e4266a2476 Mon Sep 17 00:00:00 2001 From: Jo Bovy Date: Thu, 5 Oct 2023 14:00:16 -0400 Subject: [PATCH 9/9] No longer necessary to ignore xdrlib deprecation with latest version of pynbody --- .github/workflows/build.yml | 3 +-- .github/workflows/build_windows.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ad01a412..58bd13695 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -292,9 +292,8 @@ jobs: pip install pytest-cov # Turn astropy deprecation warnings into errors as well if astropy if $REQUIRES_ASTROPY; then export PYTEST_ADDOPTS="-W error::astropy.utils.exceptions.AstropyDeprecationWarning"; else export PYTEST_ADDOPTS=""; fi - export XDRLIB_DEPRECATION="-W ignore:\"'xdrlib' is deprecated and slated for removal in Python 3.13\":DeprecationWarning" # eval necessary for -k 'not ...' in TEST_FILES - eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS $XDRLIB_DEPRECATION -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0 --cov-report=term --cov-report=xml" + eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0 --cov-report=term --cov-report=xml" - name: Generate code coverage if: ${{ matrix.python-version == env.PYTHON_COVREPORTS_VERSION && matrix.os == 'ubuntu-latest' }} run: | diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 6403fb516..42838a9b9 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -240,6 +240,5 @@ jobs: pip install pytest-cov # Turn astropy deprecation warnings into errors as well if astropy if $REQUIRES_ASTROPY; then export PYTEST_ADDOPTS="-W error::astropy.utils.exceptions.AstropyDeprecationWarning"; else export PYTEST_ADDOPTS=""; fi - export XDRLIB_DEPRECATION="-W ignore:\"'xdrlib' is deprecated and slated for removal in Python 3.13\":DeprecationWarning" # eval necessary for -k 'not ...' in TEST_FILES - eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS $XDRLIB_DEPRECATION -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0" + eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0"