diff --git a/.travis.yml b/.travis.yml index d21302755c3..56834d22208 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: python dist: xenial -sudo: required -dist: xenial cache: pip: true directories: @@ -51,11 +49,17 @@ install: $PIP install --upgrade pip $PIP install --upgrade wheel $PIP install --upgrade setuptools + echo "Travis build stage: $TRAVIS_BUILD_STAGE_NAME" # install dependencies yt - if [[ $TRAVIS_BUILD_STAGE_NAME != "Lint" ]]; then + if [[ ${TRAVIS_BUILD_STAGE_NAME} == "lint" ]]; then + export TRAVIS_BUILD_STAGE_NAME="Lint" + fi + if [[ ${TRAVIS_BUILD_STAGE_NAME} != "Lint" ]]; then if [[ $MINIMAL == 1 ]]; then # Ensure numpy and cython are installed so dependencies that need to be built # don't error out + # The first numpy to support py3.6 is 1.12, but numpy 1.13 matches + # unyt so we'll match it here. $PIP install numpy==1.13.3 cython==0.26.1 $PIP install -r tests/test_minimal_requirements.txt else @@ -64,8 +68,8 @@ install: # pyproject.toml in cartopy. # These versions are pinned, so we will need to update/remove them when # the hack is no longer necessary. - $PIP install numpy==1.16.2 cython==0.29 - $PIP install -r tests/test_requirements.txt + $PIP install numpy==1.18.1 cython==0.29.6 + CFLAGS="$CFLAGS -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" $PIP install -r tests/test_requirements.txt fi $PIP install -e . else @@ -74,37 +78,29 @@ install: jobs: include: - - stage: lint - python: 3.7 + - stage: Lint + python: 3.6 script: flake8 yt/ - stage: tests - name: "Minimal Dependency Version Unit Tests" - python: 3.5 + name: "Python: 3.6 Minimal Dependency Unit Tests" + python: 3.6 env: MINIMAL=1 script: coverage run $(which nosetests) -c nose_unit.cfg - - stage: tests - name: "Python: 3.5 Unit Tests" - python: 3.5 - script: coverage run $(which nosetests) -c nose_unit.cfg - - stage: tests name: "Python: 3.6 Unit Tests" python: 3.6 script: coverage run $(which nosetests) -c nose_unit.cfg - stage: tests - name: "Python: 3.7 Unit Tests" - python: 3.7 + name: "Python: 3.8 Unit Tests" + python: 3.8 script: coverage run $(which nosetests) -c nose_unit.cfg - - - name: "Minimal Dependency Version Answer Tests" - python: 3.5 - env: MINIMAL=1 - script: coverage run $(which nosetests) -c nose_answer.cfg - after_failure: python tests/report_failed_answers.py -f -m --xunit-file "answer_nosetests.xml" + # This is not necessarily going to be forever -- once we merge yt-4.0 + # with master we will likely change this around to reduce the number of + # versions we test on. - stage: tests name: "Python: 3.7 Answer Tests" python: 3.7 @@ -127,6 +123,9 @@ jobs: after_success: - | - if [[ $TRAVIS_BUILD_STAGE_NAME != "Lint" ]]; then + if [[ ${TRAVIS_BUILD_STAGE_NAME} == "lint" ]]; then + export TRAVIS_BUILD_STAGE_NAME="Lint" + fi + if [[ ${TRAVIS_BUILD_STAGE_NAME} != "Lint" ]]; then codecov fi diff --git a/answer-store b/answer-store index 912076b3c05..49870bcc8f4 160000 --- a/answer-store +++ b/answer-store @@ -1 +1 @@ -Subproject commit 912076b3c0597b2352f101b9853135b0554c8e4b +Subproject commit 49870bcc8f4d32fcd6980a65239574f2cdd3b159 diff --git a/appveyor.yml b/appveyor.yml index 607f3f5e417..07e541ae378 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,7 +8,7 @@ environment: matrix: - PYTHON_VERSION: "3.6" - NUMPY_VERSION: "1.16" + - PYTHON_VERSION: "3.8" platform: -x64 @@ -30,16 +30,16 @@ install: - "python --version" # Install specified version of numpy and dependencies - - "conda install --yes -c conda-forge numpy==%NUMPY_VERSION% scipy nose setuptools ipython - Cython sympy fastcache h5py matplotlib mock pandas cartopy conda-build unyt pooch" + - "conda install --yes -c conda-forge numpy scipy nose pytest setuptools ipython + Cython sympy fastcache h5py matplotlib=3.1.3 mock pandas cartopy conda-build unyt pooch pyyaml" # install yt - - "conda develop -b ." + - "pip install -e ." # Not a .NET project build: false test_script: - - "nosetests --nologcapture -sv yt" + - "nosetests --nologcapture -sv --traverse-namespace yt" # Enable this to be able to login to the build worker. You can use the # `remmina` program in Ubuntu, use the login information that the line below diff --git a/tests/test_minimal_requirements.txt b/tests/test_minimal_requirements.txt index fc183837670..76476497dd3 100644 --- a/tests/test_minimal_requirements.txt +++ b/tests/test_minimal_requirements.txt @@ -5,4 +5,4 @@ nose==1.3.7 nose-timer==0.7.3 coverage==4.5.1 codecov==2.0.15 -unyt==2.2.2 \ No newline at end of file +unyt==2.7.1 diff --git a/tests/test_requirements.txt b/tests/test_requirements.txt index a5ca58afb75..7ee409def27 100644 --- a/tests/test_requirements.txt +++ b/tests/test_requirements.txt @@ -5,21 +5,25 @@ fastcache==1.0.2 glueviz==0.13.3 h5py==2.8.0 ipython==7.1.1 -matplotlib==3.0.1 +matplotlib==3.1.3 nose-timer==0.7.3 nose==1.3.7 pandas==0.23.4 +pytest~=5.2 requests==2.20.0 -scipy==1.1.0 -sympy==1.3 +scipy==1.3.3 +sympy==1.5 pyqt5==5.11.3 pint==0.8.1 -netCDF4==1.4.2 +netCDF4==1.5.3 libconf==1.0.1 cartopy==0.17.0 pyaml==17.10.0 -mpi4py==3.0.0 -unyt==2.2.2 +mpi4py==3.0.3 +unyt==2.7.1 pyyaml>=4.2b1 +xarray==0.12.3 +firefly_api>=0.0.2 +f90nml>=1.1.2 MiniballCpp>=0.2.1 pooch>=0.7.0 diff --git a/yt/utilities/lib/pixelization_routines.pyx b/yt/utilities/lib/pixelization_routines.pyx index aecd71f2289..147064c28e4 100644 --- a/yt/utilities/lib/pixelization_routines.pyx +++ b/yt/utilities/lib/pixelization_routines.pyx @@ -749,6 +749,7 @@ def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords, int index_offset = 0): cdef np.ndarray[np.float64_t, ndim=3] img img = np.zeros(buff_size, dtype="float64") + img[:] = np.nan # Two steps: # 1. Is image point within the mesh bounding box? # 2. Is image point within the mesh element? diff --git a/yt/visualization/color_maps.py b/yt/visualization/color_maps.py index 61598f07488..b2f99c98cb3 100644 --- a/yt/visualization/color_maps.py +++ b/yt/visualization/color_maps.py @@ -391,10 +391,10 @@ def make_colormap(ctuple_list, name=None, interpolate=True): # Interpolate the R, G, and B channels from one color to the next # Use np.round to make sure you're on a discrete index - interval = np.round(next_index)-np.round(rolling_index) + interval = int(np.round(next_index)-np.round(rolling_index)) for j in np.arange(3): cmap[int(np.rint(rolling_index)):int(np.rint(next_index)), j] = \ - np.linspace(color[j], next_color[j], interval) + np.linspace(color[j], next_color[j], num=interval) rolling_index = next_index diff --git a/yt/visualization/plot_container.py b/yt/visualization/plot_container.py index 29180eaacea..63258c74c4e 100644 --- a/yt/visualization/plot_container.py +++ b/yt/visualization/plot_container.py @@ -95,8 +95,8 @@ def get_log_minorticks(vmin, vmax): """ expA = np.floor(np.log10(vmin)) expB = np.floor(np.log10(vmax)) - cofA = np.ceil(vmin/10**expA) - cofB = np.floor(vmax/10**expB) + cofA = np.ceil(vmin/10**expA).astype("int64") + cofB = np.floor(vmax/10**expB).astype("int64") lmticks = [] while cofA*10**expA <= cofB*10**expB: if expA < expB: diff --git a/yt/visualization/tests/test_geo_projections.py b/yt/visualization/tests/test_geo_projections.py index 34fb2e79af2..f3307c310f0 100644 --- a/yt/visualization/tests/test_geo_projections.py +++ b/yt/visualization/tests/test_geo_projections.py @@ -56,7 +56,6 @@ def setUp(self): def tearDown(self): del self.ds - del self.slc def test_geo_projection_setup(self):