Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting #2450 (test job updates) to yt-4.0 #2513

Merged
merged 15 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: python
dist: xenial
sudo: required
dist: xenial
cache:
pip: true
directories:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -74,37 +78,29 @@ install:

jobs:
include:
- stage: lint
python: 3.7
- stage: Lint
python: 3.6
matthewturk marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:

matrix:
- PYTHON_VERSION: "3.6"
NUMPY_VERSION: "1.16"
- PYTHON_VERSION: "3.8"

platform:
-x64
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_minimal_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
unyt==2.7.1
16 changes: 10 additions & 6 deletions tests/test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions yt/utilities/lib/pixelization_routines.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions yt/visualization/color_maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions yt/visualization/plot_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion yt/visualization/tests/test_geo_projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def setUp(self):

def tearDown(self):
del self.ds
del self.slc

def test_geo_projection_setup(self):

Expand Down