From e28f541b8c2a1d3cafa1298802a4765e8ec18112 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 23 Oct 2024 19:39:16 +0100 Subject: [PATCH] CRAN tweaks (#48) * CRAN tweaks --- .Rbuildignore | 1 + scripts/package.sh | 6 +++--- src/NDArrayUtils.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index a28cdbf..687d843 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,6 +9,7 @@ ^\.pytest_cache ^humanleague.cpython setup.cfg +codecov.yml pyproject.toml dist/ build/ diff --git a/scripts/package.sh b/scripts/package.sh index eccbcc9..7d0336c 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -7,10 +7,10 @@ echo $version # package # no binary dist as C++ -python3 setup.py sdist +python -m build . --sdist # upload -# twine upload -u __token__ -p $TEST_PYPI_API_TOKEN --repository-url https://test.pypi.org/legacy/ dist/humanleague-$version.tar.gz -twine upload -u __token__ -p $PYPI_API_TOKEN --repository-url https://upload.pypi.org/legacy/ dist/humanleague-$version.tar.gz +# twine upload -u __token__ -p $TEST_PYPI_API_TOKEN --repository testpypi dist/humanleague-$version.tar.gz +twine upload -u __token__ -p $PYPI_API_TOKEN dist/humanleague-$version.tar.gz # NB on testPyPI, deps need to been installed from main repo. Use this: # pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple humanleague diff --git a/src/NDArrayUtils.h b/src/NDArrayUtils.h index a8bd96c..7995c21 100644 --- a/src/NDArrayUtils.h +++ b/src/NDArrayUtils.h @@ -239,7 +239,7 @@ inline bool allclose(const std::vector& a, const std::vector& b, return false; } for (size_t i = 0; i < a.size() ; ++i) { - if (abs(a[i] - b[i]) > abstol) { + if (fabs(a[i] - b[i]) > abstol) { return false; } }