Skip to content

Commit

Permalink
Merge 2a1b0b4 into 1d0dce9
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-dlp committed Oct 20, 2018
2 parents 1d0dce9 + 2a1b0b4 commit f1a848c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
22 changes: 14 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@ env:

matrix:
include:
- env: export PYTHON=3.5; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
- env: export PYTHON=3.5; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
os: osx
language: generic
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='True'; MINIMAL_ENV='False'
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='True'
# All tests run for the latest supported Python version in Linux
- env: export PYTHON=3.7; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
- env: export PYTHON=3.7; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='True'
# Only standard test for older supported versions of Python in Linux
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
- env: export PYTHON=3.5; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
# Only standard test for latest supported versions of Python in OSx
# Testing older supported versions create important overheads (~3x slower
# testing) without adding much as if it works for older version in Linux it
# should also works for OSx, unless there is some issue with external
# packages, but that's not a HyperSpy issue.
- env: export PYTHON=3.7; FAIL_ON_EXTERNAL_DEPRECATION='False'; MINIMAL_ENV='False'
os: osx
language: generic
allow_failures:
- env: export PYTHON=3.6; FAIL_ON_EXTERNAL_DEPRECATION='True'; MINIMAL_ENV='False'
# Only test for the latest supported version as chances are that it'll
# contain the most up-to-date external libraries.
- env: export PYTHON=3.7; FAIL_ON_EXTERNAL_DEPRECATION='True'; MINIMAL_ENV='False'

before_install:
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then
Expand Down
13 changes: 13 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ environment:
CONDA_PY: "36"
DEPS: "numpy scipy matplotlib=2.2.3 ipython h5py sympy scikit-learn dill setuptools natsort scikit-image cython ipyparallel dask numexpr sparse numba"

- PYTHON: "C:\\Miniconda37"
PYTHON_VERSION: "3.7.x"
PYTHON_MAJOR: 3
PYTHON_ARCH: "32"
CONDA_PY: "37"
DEPS: "numpy scipy matplotlib=2.2.3 ipython h5py sympy scikit-learn dill setuptools natsort scikit-image cython ipyparallel dask numexpr sparse numba"

- PYTHON: "C:\\Miniconda37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_MAJOR: 3
PYTHON_ARCH: "64"
CONDA_PY: "37"
DEPS: "numpy scipy matplotlib=2.2.3 ipython h5py sympy scikit-learn dill setuptools natsort scikit-image cython ipyparallel dask numexpr sparse numba"


init:
Expand Down
2 changes: 1 addition & 1 deletion hyperspy/Release.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# When running setup.py the ".dev" string will be replaced (if possible)
# by the output of "git describe" if git is available or the git
# hash if .git is present.
version = "1.4.1.dev"
version = "1.4.1"
description = "Multidimensional data analysis toolbox"
license = 'GPL v3'

Expand Down
2 changes: 1 addition & 1 deletion hyperspy/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def add_np(doctest_namespace):
def setup_module(mod):
if pytest.config.getoption("--pdb"):
import dask
dask.set_options(get=dask.async.get_sync)
dask.set_options(get=dask.local.get_sync)


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion hyperspy/io_plugins/bruker.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def __init__(self, spectrum):
dec_det_l_str = codecs.decode(det_l_str.encode('ascii'), 'base64')
mini_xml = ET.fromstring(unzip_block(dec_det_l_str))
self.detector_metadata['DetLayers'] = {} # Overwrite with dict
for i in mini_xml.getchildren():
for i in list(mini_xml):
self.detector_metadata['DetLayers'][i.tag] = dict(i.attrib)

# map stuff from esma xml branch:
Expand Down
11 changes: 10 additions & 1 deletion hyperspy/misc/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with HyperSpy. If not, see <http://www.gnu.org/licenses/>.

import os
import sys
from contextlib import contextmanager
import warnings
import re
Expand All @@ -34,6 +35,14 @@ def ignore_warning(message="", category=None):
warnings.filterwarnings('ignore', message)
yield

# In Python 3.7, the private re._pattern_type is removed.
# Python 3.5+ have typing.re.Pattern
# Solution adapted from Pandas
if sys.version_info >= (3, 5):
import typing
Pattern = typing.re.Pattern
else:
Pattern = type(re.compile(''))

# TODO: Remove _all_warnings when moved to Python > 3.4,
# ref http://bugs.python.org/issue4180
Expand Down Expand Up @@ -148,7 +157,7 @@ def assert_warns(message=None, category=None):
If you use the "|" operator in a pattern, you can catch one of several warnings.
Finally, you can use "|\A\Z" in a pattern to signify it as optional.
"""
if isinstance(message, (str, re._pattern_type)):
if isinstance(message, (str, Pattern)):
message = [message]
elif message is None:
message = tuple()
Expand Down

0 comments on commit f1a848c

Please sign in to comment.