Skip to content

Commit

Permalink
Use flake8 for coding standards checking
Browse files Browse the repository at this point in the history
Remove the pep8 test as it is no longer needed.
  • Loading branch information
ajdawson committed Dec 21, 2017
1 parent 30e7934 commit 1a86c64
Show file tree
Hide file tree
Showing 19 changed files with 74 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: python

env:
global:
- PACKAGES_STANDARD="setuptools pytest pep8 numpy pyspharm"
- PACKAGES_STANDARD="setuptools pytest numpy pyspharm"
matrix:
- NAME="Python 2.7 (standard)"
PYTHON_VERSION=2.7
Expand Down
4 changes: 2 additions & 2 deletions examples/cdms/rws_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import cartopy.crs as ccrs
import cdms2
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np

from windspharm.cdms import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the cdms2 module
# from CDAT. The components are in separate files.
Expand Down
4 changes: 2 additions & 2 deletions examples/cdms/sfvp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
import cartopy.crs as ccrs
import cdms2
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np

from windspharm.cdms import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the cdms2 module
# from CDAT. The components are in separate files.
Expand Down
4 changes: 2 additions & 2 deletions examples/iris/rws_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import iris.plot as iplt
from iris.coord_categorisation import add_month
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np

from windspharm.iris import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the iris module.
# The components are in separate files. We catch warnings here because the
Expand Down
4 changes: 2 additions & 2 deletions examples/iris/sfvp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
import iris.plot as iplt
from iris.coord_categorisation import add_month
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np

from windspharm.iris import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the iris module.
# The components are in separate files. We catch warnings here because the
Expand Down
4 changes: 2 additions & 2 deletions examples/standard/rws_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
from cartopy.util import add_cyclic_point
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
from netCDF4 import Dataset
import numpy as np

from windspharm.standard import VectorWind
from windspharm.tools import prep_data, recover_data, order_latdim
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the cdms2 module
# from CDAT. The components are defined on pressure levels and are in separate
Expand Down
4 changes: 2 additions & 2 deletions examples/standard/sfvp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
from cartopy.util import add_cyclic_point
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
from netCDF4 import Dataset
import numpy as np

from windspharm.standard import VectorWind
from windspharm.tools import prep_data, recover_data, order_latdim
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the netCDF4
# module. The components are defined on pressure levels and are in separate
Expand Down
4 changes: 2 additions & 2 deletions examples/xarray/rws_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"""
import cartopy.crs as ccrs
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr

from windspharm.xarray import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the xarray module.
# The components are in separate files.
Expand Down
4 changes: 2 additions & 2 deletions examples/xarray/sfvp_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"""
import cartopy.crs as ccrs
import matplotlib as mpl
mpl.rcParams['mathtext.default'] = 'regular'
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr

from windspharm.xarray import VectorWind
from windspharm.examples import example_data_path

mpl.rcParams['mathtext.default'] = 'regular'


# Read zonal and meridional wind components from file using the xarray module.
# The components are in separate files.
Expand Down
2 changes: 0 additions & 2 deletions lib/windspharm/cdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# THE SOFTWARE.
from __future__ import absolute_import

import numpy as np
import cdms2

from . import standard
Expand Down Expand Up @@ -771,7 +770,6 @@ def truncate(self, field, truncation=None):
field = field(latitude=(90, -90))
# Record the shape and axes in the API order.
ishape = field.shape
axes = field.getAxisList()
# Extract the data from the field in the correct shape for the API.
fielddata = to3d(field.asma())
# Apply the truncation.
Expand Down
3 changes: 0 additions & 3 deletions lib/windspharm/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
# THE SOFTWARE.
from __future__ import absolute_import

import numpy as np
from iris.cube import Cube
from iris.util import reverse
from spharm import gaussian_lats_wts

from . import standard
from ._common import get_apiorder, inspect_gridtype, to3d
Expand Down Expand Up @@ -744,7 +742,6 @@ def truncate(self, field, truncation=None):
field = field.copy()
field.transpose(apiorder)
ishape = field.shape
coords = field.dim_coords
fielddata = to3d(field.data)
fieldtrunc = self._api.truncate(fielddata, truncation=truncation)
field.data = fieldtrunc.reshape(ishape)
Expand Down
9 changes: 0 additions & 9 deletions lib/windspharm/tests/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
import os

import numpy as np
try:
import cdms2
except ImportError:
pass
try:
from iris.cube import Cube
from iris.coords import DimCoord
except ImportError:
pass
from spharm import gaussian_lats_wts


Expand Down
37 changes: 0 additions & 37 deletions lib/windspharm/tests/test_coding_standards.py

This file was deleted.

Loading

0 comments on commit 1a86c64

Please sign in to comment.