Skip to content

Commit

Permalink
Merge pull request ajdawson#88 from ajdawson/py3-fix-and-update
Browse files Browse the repository at this point in the history
Fixes and updates for Python 3
  • Loading branch information
ajdawson authored Jul 21, 2017
2 parents c5618e8 + 8d9e3cf commit a00c4e9
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 30 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ env:
- NAME="Python 2.7 (metadata)"
PYTHON_VERSION=2.7
PACKAGES="${PACKAGES_STANDARD} cdat-lite iris xarray"
- NAME="Python 3.3 (standard)"
PYTHON_VERSION=3.3
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.4 (standard)"
PYTHON_VERSION=3.4
PACKAGES="${PACKAGES_STANDARD}"
Expand All @@ -26,7 +23,13 @@ env:
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.5 (metadata)"
PYTHON_VERSION=3.5
PACKAGES="${PACKAGES_STANDARD} xarray"
PACKAGES="${PACKAGES_STANDARD} iris xarray"
- NAME="Python 3.6 (standard)"
PYTHON_VERSION=3.6
PACKAGES="${PACKAGES_STANDARD}"
- NAME="Python 3.6 (metadata)"
PYTHON_VERSION=3.6
PACKAGES="${PACKAGES_STANDARD} iris xarray"

install:
# Install Miniconda so we can use it to manage dependencies:
Expand All @@ -40,8 +43,7 @@ install:
- hash -r
# Setup conda to use extra channels for dependencies:
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels scitools
- conda config --add channels ajdawson
- conda config --add channels conda-forge
- conda update conda
- conda info -a
# Create a conda environment with the required python version:
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from . import standard
from . import tools
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/cdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import collections

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa
import os


Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import collections
from copy import copy
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/multivariate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from . import standard

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/multivariate/cdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import collections

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/multivariate/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import collections
from copy import copy
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/multivariate/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa
import collections
import warnings

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose.tools import assert_almost_equal, assert_true, assert_equal
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/test_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose import SkipTest
from nose.tools import raises
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/test_multivariate_error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose import SkipTest
from nose.tools import raises
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/test_multivariate_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose import SkipTest
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions lib/eofs/tests/test_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose import SkipTest
import numpy as np
Expand Down Expand Up @@ -112,7 +112,7 @@ def check_eofs_orthogonal(self, eofscaling):
eofs = self._tomasked(self.solver.eofs(neofs=self.neofs,
eofscaling=eofscaling))
eofs = eofs.compressed()
ns = eofs.shape[0] / self.neofs
ns = eofs.shape[0] // self.neofs
eofs = eofs.reshape([self.neofs, ns])
dot = np.dot(eofs, eofs.T)
residual = dot - np.diag(dot.diagonal())
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from nose import SkipTest
from nose.tools import raises
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import numpy as np
try:
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

from . import standard

Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/cdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import cdms2
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa


def covcor_dimensions(pc_dims, field_dims):
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa
from copy import copy
from functools import reduce
import warnings
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import numpy as np
import numpy.ma as ma
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/tools/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import numpy as np
try:
Expand Down
2 changes: 1 addition & 1 deletion lib/eofs/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU General Public License
# along with eofs. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import (absolute_import, division, print_function) # noqa

import collections

Expand Down

0 comments on commit a00c4e9

Please sign in to comment.