Skip to content

Commit

Permalink
Isort reorder imports
Browse files Browse the repository at this point in the history
  • Loading branch information
altheaden committed Dec 20, 2024
1 parent 70f87d2 commit 28a723e
Show file tree
Hide file tree
Showing 44 changed files with 202 additions and 208 deletions.
6 changes: 3 additions & 3 deletions contributors/list_contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
02/23/2019
"""

import os
import subprocess
import shutil
import datetime
import os
import re
import shutil
import subprocess


def append_to_file(aline, afile):
Expand Down
8 changes: 4 additions & 4 deletions examples/setup_antarctic_basins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals

from geometric_features import GeometricFeatures
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import matplotlib.pyplot as plt

from geometric_features import GeometricFeatures

plot = True

# create a GeometricFeatures object that points to a local cache of geometric
Expand Down
8 changes: 4 additions & 4 deletions examples/setup_extended_antarctic_basins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals

from geometric_features import GeometricFeatures, FeatureCollection
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import matplotlib.pyplot as plt

from geometric_features import FeatureCollection, GeometricFeatures

plot = True

# create a GeometricFeatures object that points to a local cache of geometric
Expand Down
8 changes: 4 additions & 4 deletions examples/setup_ice_shelves.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals

from geometric_features import GeometricFeatures, FeatureCollection
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import matplotlib.pyplot as plt

from geometric_features import FeatureCollection, GeometricFeatures

plot = True

iceShelfNames = ['Abbot',
Expand Down
4 changes: 2 additions & 2 deletions examples/setup_ocean_critical_passages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from geometric_features import GeometricFeatures

Expand Down
8 changes: 4 additions & 4 deletions examples/setup_ocean_land_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals

from geometric_features import GeometricFeatures
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import matplotlib.pyplot as plt

from geometric_features import GeometricFeatures

plot = True
withCavities = False

Expand Down
9 changes: 5 additions & 4 deletions examples/setup_ocean_region_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals
from __future__ import (absolute_import, division, print_function,
unicode_literals)

import matplotlib.pyplot as plt
import copy

import matplotlib.pyplot as plt
import shapely

from geometric_features import GeometricFeatures, FeatureCollection
from geometric_features import FeatureCollection, GeometricFeatures


def build_ocean_basins(gf, plot):
Expand Down
5 changes: 2 additions & 3 deletions examples/setup_ocean_standard_transport_sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"""

# stuff to make scipts work for python 2 and python 3
from __future__ import absolute_import, division, print_function, \
unicode_literals
from __future__ import (absolute_import, division, print_function,
unicode_literals)

from geometric_features import GeometricFeatures


# create a GeometricFeatures object that points to a local cache of geometric
# data and knows which branch of geometric_feature to use to download
# missing data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env python

import shapely
import numpy
import xarray
import os
import matplotlib.pyplot as plt
import pyproj
import zipfile
import shutil
import zipfile

from geometric_features import GeometricFeatures, FeatureCollection
from geometric_features.feature_collection import _round_coords
import matplotlib.pyplot as plt
import numpy
import pyproj
import shapely
import xarray

from geometric_features import FeatureCollection, GeometricFeatures
from geometric_features.download import download_files
from geometric_features.feature_collection import _round_coords
from geometric_features.utils import write_feature_names_and_tags


Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python

import shapely
import numpy
import xarray
import os
import matplotlib.pyplot as plt
import pyproj
import gzip
import os
import shutil
import tempfile

from geometric_features import GeometricFeatures, FeatureCollection
from geometric_features.feature_collection import _round_coords
import matplotlib.pyplot as plt
import numpy
import pyproj
import shapely
import xarray

from geometric_features import FeatureCollection, GeometricFeatures
from geometric_features.download import download_files
from geometric_features.feature_collection import _round_coords
from geometric_features.utils import write_feature_names_and_tags


Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/usr/bin/env python

import shapely
import numpy
import xarray
import os
import matplotlib.pyplot as plt
import pyproj
import gzip
import os
import shutil
import tempfile

from geometric_features import GeometricFeatures, FeatureCollection
from geometric_features.feature_collection import _round_coords
import matplotlib.pyplot as plt
import numpy
import pyproj
import shapely
import xarray

from geometric_features import FeatureCollection, GeometricFeatures
from geometric_features.download import download_files
from geometric_features.feature_collection import _round_coords
from geometric_features.utils import write_feature_names_and_tags


Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
#!/usr/bin/env python

import os
import xarray

import matplotlib.pyplot as plt
import numpy
import pyproj
import matplotlib.pyplot as plt
from skimage import measure

import skfmm
import xarray
from scipy.interpolate import interp1d
from scipy.ndimage.filters import gaussian_filter
from shapely.geometry import Polygon, mapping
from shapely.ops import unary_union
from skimage import measure

from geometric_features import FeatureCollection, GeometricFeatures, \
read_feature_collection
from geometric_features import (FeatureCollection, GeometricFeatures,
read_feature_collection)
from geometric_features.utils import write_feature_names_and_tags

import skfmm

from scipy.ndimage.filters import gaussian_filter
from scipy.interpolate import interp1d

"""
We do not have permission to automatically download or re-distribute the
BedMachine Antarctica topography. To download the file, follow these
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from netCDF4 import Dataset
import numpy
import os

import matplotlib.pyplot as plt
from progressbar import ProgressBar, Percentage, Bar, ETA
import numpy
from netCDF4 import Dataset
from progressbar import ETA, Bar, Percentage, ProgressBar

"""
This script converts the Bedmap2 binary dataset into a NetCDF file, including
longitude and latitude fields. The Bedmap2 bindary dataset is available via
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
from netCDF4 import Dataset
import numpy
from matplotlib import pyplot
import skfmm
from matplotlib import _cntr as cntr

from matplotlib import pyplot
from mpl_toolkits.basemap import interp as basemap_interp
from netCDF4 import Dataset
from scipy.ndimage.filters import gaussian_filter
from shapely.geometry import Polygon, mapping
from shapely.ops import unary_union

from utils.feature_write_utils import write_all_features


import skfmm

from scipy.ndimage.filters import gaussian_filter

from mpl_toolkits.basemap import interp as basemap_interp

"""
This script takes as input the Bedmap2 topography data produced by the
bedmap2_to_netcdf.py script. It produces the feature file
Expand Down
4 changes: 2 additions & 2 deletions feature_creation_scripts/iceshelves/bedmap2_to_netcdf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python2

from netCDF4 import Dataset
import numpy
from netCDF4 import Dataset
from progressbar import ETA, Bar, Percentage, ProgressBar

from progressbar import ProgressBar, Percentage, Bar, ETA
"""
This script converts the Bedmap2 binary dataset into a NetCDF file, including
longitude and latitude fields. The Bedmap2 bindary dataset is available via
Expand Down
6 changes: 2 additions & 4 deletions feature_creation_scripts/iceshelves/ice_vel_to_bedmap2.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/usr/bin/env python

import matplotlib
import numpy
from netCDF4 import Dataset

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

from mpl_toolkits.basemap import interp

import scipy.ndimage.filters as filters
from mpl_toolkits.basemap import interp

inFileName = 'Bedmap2_ice_shelf_distance.nc'
inFile = Dataset(inFileName,'r')
Expand Down
8 changes: 3 additions & 5 deletions feature_creation_scripts/iceshelves/plot_streamline.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#!/usr/bin/env python

import matplotlib
import numpy
from netCDF4 import Dataset

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

from mpl_toolkits.basemap import interp

import scipy.integrate
import scipy.ndimage.morphology as morphology

from mpl_toolkits.basemap import interp
from skimage import measure


def interpVel(p,t):
np = len(p)/2
x = p[0:np]
Expand Down
1 change: 1 addition & 0 deletions feature_creation_scripts/iceshelves/polar.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy


def toPolar(points):
lons = numpy.pi*points[:,0]/180.
lats = numpy.pi*points[:,1]/180.
Expand Down
10 changes: 5 additions & 5 deletions feature_creation_scripts/iceshelves/write_basin_distances.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env python

import numpy
from netCDF4 import Dataset
import os

import matplotlib
import numpy
import scipy.misc

import skfmm
import os
from netCDF4 import Dataset

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt


def readBasinImage(name):
basinImage = scipy.misc.imread('basins/%s.png'%name)
data = 1.0 - numpy.array(basinImage[::-1,:,0],float)/255.
Expand Down
10 changes: 5 additions & 5 deletions feature_creation_scripts/iceshelves/write_basin_images.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env python

import numpy
import json
import sys

import matplotlib
import numpy
from descartes import PolygonPatch
from netCDF4 import Dataset
from shapely.geometry import shape
from descartes import PolygonPatch

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

import os.path

import matplotlib.pyplot as plt
from polar import toPolar


Expand Down
Loading

0 comments on commit 28a723e

Please sign in to comment.