From 6807587c6253d0519dbc81cda64b5149392c6c44 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Fri, 5 Apr 2019 18:03:29 -0700 Subject: [PATCH 1/2] fixed warning in resample_factor(): convert float to int --- gridData/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gridData/core.py b/gridData/core.py index 01276bd..b0fe12f 100644 --- a/gridData/core.py +++ b/gridData/core.py @@ -256,7 +256,7 @@ def resample_factor(self, factor): """ # new number of edges N' = (N-1)*f + 1 newlengths = [(N - 1) * float(factor) + 1 for N in self._len_edges()] - edges = [numpy.linspace(start, stop, num=N, endpoint=True) + edges = [numpy.linspace(start, stop, num=int(N), endpoint=True) for (start, stop, N) in zip(self._min_edges(), self._max_edges(), newlengths)] return self.resample(edges) From 82511d0fc76cf09fcf6775a46cf9c919113ed8e8 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Fri, 5 Apr 2019 18:05:54 -0700 Subject: [PATCH 2/2] add appveyor config for windows testing close #47 --- .appveyor.yml | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..6bdd544 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,70 @@ +# AppVeyor config for GridDataFormats +# +# config based on MDAnalysis, which was based on +# examples from SciPy & NumPy repositories, which +# themselves credit an original example by Olivier Grisel at +# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml +clone_depth: 50 +max_jobs: 100 + +cache: + - '%LOCALAPPDATA%\pip\Cache' + +image: + - Visual Studio 2015 + +environment: + global: + CONDA_CHANNELS: conda-forge + CONDA_DEPENDENCIES: pip setuptools wheel six scipy vs2015_runtime pytest pytest-cov codecov + DEBUG: "False" + MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin + OPENBLAS_64: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-5f998ef_gcc7_1_0_win64.zip + APPVEYOR_SAVE_CACHE_ON_ERROR: true + APPVEYOR_SKIP_FINALIZE_ON_EXIT: true + TEST_TIMEOUT: 1000 + PYTHON: "C:\\conda" + MINICONDA_VERSION: "latest" + + matrix: + - PYTHON_VERSION: 3.6 + PYTHON_ARCH: 64 + MSVC_VERSION: "Visual Studio 10 Win64" + +init: + - ps: Write-Host ${env:PYTHON} ${env:PYTHON_VERSION} ${env:PYTHON_ARCH} + - ps: Write-Host ${env:APPVEYOR_SCHEDULED_BUILD} + # cancel build if newer one is submitted; complicated + # details for getting this to work are credited to JuliaLang + # developers + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + raise "There are newer queued builds for this pull request, skipping build." + } + +install: + # set up a conda env + - ps: git clone -q --depth 1 git://github.com/astropy/ci-helpers.git + - ps: ci-helpers/appveyor/install-miniconda.ps1 + - ps: $env:PATH = "${env:PYTHON};${env:PYTHON}\Scripts;" + $env:PATH + # deal with missing stdint.h as previously described + # see https://github.com/swistakm/pyimgui/blob/master/.appveyor.yml + - ps: cp "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h" "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" + - ps: activate test + +build_script: + - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 + +test_script: + - cmd: C:\conda\envs\test\python.exe setup.py develop --no-deps --user 3>&1 + - cmd: C:\conda\envs\test\Scripts\pytest.exe --cov=gridData 3>&1 + - cmd: codecov + +after_build: + # cache cleanup + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete + - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete + # Show size of cache + - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"