Skip to content

Commit 049bb13

Browse files
committed
fixed indentation
1 parent b99dfd0 commit 049bb13

File tree

9 files changed

+113
-113
lines changed

9 files changed

+113
-113
lines changed

pyspod/postprocessing.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ def plot_3D_modes_slice_at_frequency(modes, freq_required, freq, vars_idx=[0], m
882882
real_ax.set_aspect('equal')
883883
imag_ax.set_aspect('equal')
884884
if len(title) > 1:
885-
fig.suptitle(title + \
885+
fig.suptitle(title + \
886886
', mode: {}, variable ID: {}'.format(mode_id, var_id))
887887
else:
888-
fig.suptitle('mode: {}, variable ID: {}'.format(mode_id, var_id))
888+
fig.suptitle('mode: {}, variable ID: {}'.format(mode_id, var_id))
889889
real_ax.set_title('Real part')
890890
imag_ax.set_title('Imaginary part')
891891
else:
@@ -991,7 +991,7 @@ def plot_mode_tracers(modes, freq_required, freq, coords_list, x=None, vars_idx=
991991
# use the data dimensions
992992
if not coords_list:
993993
print('You must provide coords to `plot_mode_tracers` '
994-
'in the form list(tuple(), tuple(), ...)')
994+
'in the form list(tuple(), tuple(), ...)')
995995

996996
# check the coord_list is indeed list
997997
if not isinstance(coords_list, list):
@@ -1176,7 +1176,7 @@ def plot_data_tracers(X, coords_list, x=None, time_limits=[0,10],
11761176
# check coord_list has correct shape and type
11771177
if not coords_list:
11781178
print('You must provide coords to `plot_mode_tracers` '
1179-
'in the form list(tuple(), tuple(), ...)')
1179+
'in the form list(tuple(), tuple(), ...)')
11801180
if not isinstance(coords_list, list):
11811181
raise TypeError('`coords` must be a list')
11821182
# get idx variables
@@ -1237,7 +1237,7 @@ def plot_data_tracers(X, coords_list, x=None, time_limits=[0,10],
12371237
def generate_2D_data_video(X, time_limits=[0,10], vars_idx=None, sampling=1,
12381238
x1=None, x2=None, coastlines='', figsize=(12,8), path='CWD', filename='data_video.mp4'):
12391239
"""
1240-
Make movie of 2D data.
1240+
Make movie of 2D data.
12411241
12421242
:param numpy.ndarray X: 2D data to be plotted. \
12431243
First dimension must be time. Last dimension must be variable.
@@ -1308,7 +1308,7 @@ def generate_2D_data_video(X, time_limits=[0,10], vars_idx=None, sampling=1,
13081308
vmin=-0.9*vmean,
13091309
vmax= 0.9*vmean),
13101310
plt.scatter(coast['coastlon'],
1311-
coast['coastlat'],
1311+
coast['coastlat'],
13121312
marker='.', c='k', s=1)]
13131313
for state in time_range
13141314
]

pyspod/spod_low_ram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def fit(self):
122122
if n_modes_save == 0:
123123
raise ValueError('Memory required for storing at least one mode '
124124
'is equal or larger than available storage memory in your system ...\n'
125-
'... aborting computation...')
125+
'... aborting computation...')
126126

127127
# load FFT blocks from hard drive and save modes on hard drive (for large data)
128128
for iFreq in tqdm(range(0,self._n_freq),desc='computing frequencies'):

pyspod/spod_streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class SPOD_streaming(SPOD_base):
2929
the `SPOD_base` class.
3030
"""
3131
def __init__(self, X, params, data_handler, variables):
32-
"""Constructor of SPOD_streaming."""
33-
super().__init__(X, params, data_handler, variables)
32+
"""Constructor of SPOD_streaming."""
33+
super().__init__(X, params, data_handler, variables)
3434

3535
def fit(self):
3636
"""

pyspod/weights.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def geo_weights_trapz_2D(lat, lon, R, n_vars):
99
'''
1010
2D integration weights for geospatial
11-
data via trapezoidal rule
11+
data via trapezoidal rule
1212
'''
1313
n_lat = len(lat)
1414
n_lon = len(lon)
@@ -40,7 +40,7 @@ def geo_weights_trapz_2D(lat, lon, R, n_vars):
4040
def geo_weights_trapz_3D(lat, lon, R, z, n_vars):
4141
'''
4242
3D integration weights for geospatial
43-
data via trapezoidal rule
43+
data via trapezoidal rule
4444
'''
4545
n_lat = len(lat)
4646
n_lon = len(lon)
@@ -101,7 +101,7 @@ def geo_weights_trapz_3D(lat, lon, R, z, n_vars):
101101

102102

103103
def apply_normalization(X, weights, method='variance'):
104-
'''Normalization of weights if required.'''
104+
'''Normalization of weights if required.'''
105105

106106
# variable-wise normalization by variance via weight matrix
107107
if method.lower() == 'variance':

setup.py

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,36 @@
1313
VERSION = "0.3"
1414
KEYWORDS='spectral-proper-orthogonal-decomposition spod'
1515
REQUIRED = [
16-
"numpy",
17-
"scipy",
18-
"matplotlib",
19-
"xarray",
20-
"netcdf4",
21-
"h5py",
22-
"psutil",
23-
"tqdm",
24-
"Sphinx",
25-
"sphinx_rtd_theme",
26-
"ecmwf_api_client",
27-
"cdsapi",
28-
"pyFFTW",
16+
"numpy",
17+
"scipy",
18+
"matplotlib",
19+
"xarray",
20+
"netcdf4",
21+
"h5py",
22+
"psutil",
23+
"tqdm",
24+
"Sphinx",
25+
"sphinx_rtd_theme",
26+
"ecmwf_api_client",
27+
"cdsapi",
28+
"pyFFTW",
2929
"future",
30-
"ffmpeg",
31-
"pytest",
30+
"ffmpeg",
31+
"pytest",
3232
]
3333
EXTRAS = {
34-
'docs': ['Sphinx==3.2.1', 'sphinx_rtd_theme'],
34+
'docs': ['Sphinx==3.2.1', 'sphinx_rtd_theme'],
3535
}
3636
DESCR = (
37-
"PySPOD is a Python package that implements the Spectral Proper Orthogonal"
38-
" Decomposition (SPOD). SPOD is used to extract perfectly coherent spatio-temporal"
39-
" patterns in complex datasets. Original work on this technique dates back"
40-
" to (Lumley 1970), with recent development brought forward by (Towne et al. 2017),"
41-
" (Schmidt et al. 2018), (Schmidt et al. 2019).\n"
42-
"\n"
43-
"PySPOD comes with a set of tutorials spanning weather and climate, seismic and "
44-
" fluidmechanics applicaitons, and it can be used for both canonical problems "
45-
" as well as large datasets. \n"
37+
"PySPOD is a Python package that implements the Spectral Proper Orthogonal"
38+
" Decomposition (SPOD). SPOD is used to extract perfectly coherent spatio-temporal"
39+
" patterns in complex datasets. Original work on this technique dates back"
40+
" to (Lumley 1970), with recent development brought forward by (Towne et al. 2017),"
41+
" (Schmidt et al. 2018), (Schmidt et al. 2019).\n"
42+
"\n"
43+
"PySPOD comes with a set of tutorials spanning weather and climate, seismic and "
44+
" fluidmechanics applicaitons, and it can be used for both canonical problems "
45+
" as well as large datasets. \n"
4646
)
4747
CWD = os.path.abspath(os.path.dirname(__file__))
4848

@@ -51,78 +51,78 @@
5151
# COMMANDS
5252
class UploadCommand(Command):
5353

54-
description = 'Build and publish the package.'
55-
user_options = []
54+
description = 'Build and publish the package.'
55+
user_options = []
5656

57-
@staticmethod
58-
def status(s):
59-
"""Prints things in bold."""
60-
print('\033[1m{0}\033[0m'.format(s))
57+
@staticmethod
58+
def status(s):
59+
"""Prints things in bold."""
60+
print('\033[1m{0}\033[0m'.format(s))
6161

62-
def initialize_options(self):
63-
pass
62+
def initialize_options(self):
63+
pass
6464

65-
def finalize_options(self):
66-
pass
65+
def finalize_options(self):
66+
pass
6767

68-
def run(self):
69-
try:
70-
self.status('Removing previous builds...')
71-
rmtree(os.path.join(CWD, 'dist'))
72-
except OSError:
73-
pass
68+
def run(self):
69+
try:
70+
self.status('Removing previous builds...')
71+
rmtree(os.path.join(CWD, 'dist'))
72+
except OSError:
73+
pass
7474

75-
self.status('Building Source and Wheel (universal) distribution...')
76-
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
75+
self.status('Building Source and Wheel (universal) distribution...')
76+
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
7777

78-
self.status('Uploading the package to PyPI via Twine...')
79-
os.system('twine upload dist/*')
78+
self.status('Uploading the package to PyPI via Twine...')
79+
os.system('twine upload dist/*')
8080

81-
self.status('Pushing git tags...')
82-
os.system('git tag v{0}'.format(VERSION))
83-
os.system('git push --tags')
84-
sys.exit()
81+
self.status('Pushing git tags...')
82+
os.system('git tag v{0}'.format(VERSION))
83+
os.system('git push --tags')
84+
sys.exit()
8585

8686

8787

8888
# SETUP
8989
setup(
90-
name=NAME,
91-
version=VERSION,
92-
description="Python Spectral Proper Orthogonal Decomposition",
93-
long_description=DESCR,
94-
author=AUTHOR,
95-
author_email=EMAIL,
90+
name=NAME,
91+
version=VERSION,
92+
description="Python Spectral Proper Orthogonal Decomposition",
93+
long_description=DESCR,
94+
author=AUTHOR,
95+
author_email=EMAIL,
9696
classifiers=[
97-
'License :: OSI Approved :: MIT License',
98-
'Programming Language :: Python :: 3',
99-
'Programming Language :: Python :: 3.6',
100-
'Programming Language :: Python :: 3.7',
101-
'Programming Language :: Python :: 3.8',
102-
'Intended Audience :: Science/Research',
103-
'Topic :: Scientific/Engineering :: Mathematics'
97+
'License :: OSI Approved :: MIT License',
98+
'Programming Language :: Python :: 3',
99+
'Programming Language :: Python :: 3.6',
100+
'Programming Language :: Python :: 3.7',
101+
'Programming Language :: Python :: 3.8',
102+
'Intended Audience :: Science/Research',
103+
'Topic :: Scientific/Engineering :: Mathematics'
104104
],
105105
keywords=KEYWORDS,
106106
url=URL,
107107
license='MIT',
108108
# packages=[NAME],
109-
packages=find_packages(),
110-
package_data={'': [
111-
'plotting_support/coast.mat',
112-
'plotting_support/coast_centred.mat'
113-
]},
114-
data_files=[
115-
('pyspod',['pyspod/plotting_support/coast.mat']),
116-
('pyspod',['pyspod/plotting_support/coast_centred.mat'])],
117-
# package_dir={NAME: NAME},
118-
# package_data={NAME: [
119-
# 'pyspod/plotting_support/*.mat',
120-
# ]},
121-
install_requires=REQUIRED,
122-
extras_require=EXTRAS,
109+
packages=find_packages(),
110+
package_data={'': [
111+
'plotting_support/coast.mat',
112+
'plotting_support/coast_centred.mat'
113+
]},
114+
data_files=[
115+
('pyspod',['pyspod/plotting_support/coast.mat']),
116+
('pyspod',['pyspod/plotting_support/coast_centred.mat'])],
117+
# package_dir={NAME: NAME},
118+
# package_data={NAME: [
119+
# 'pyspod/plotting_support/*.mat',
120+
# ]},
121+
install_requires=REQUIRED,
122+
extras_require=EXTRAS,
123123
include_package_data=True,
124124
zip_safe=False,
125125

126-
cmdclass={
127-
'upload': UploadCommand,
128-
},)
126+
cmdclass={
127+
'upload': UploadCommand,
128+
},)

tests/test_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def test_basic_spod_streaming():
166166

167167
# clean up results
168168
try:
169-
shutil.rmtree(os.path.join(CWD,'results'))
169+
shutil.rmtree(os.path.join(CWD,'results'))
170170
except OSError as e:
171-
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
171+
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
172172

173173

174174

tests/test_basic_file.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ def test_basic_file_spod_streaming():
218218
# (np.max(np.abs(modes_at_freq)) > 0.029917334301665384 -tol))
219219

220220
try:
221-
shutil.rmtree(os.path.join(CWD,'results'))
221+
shutil.rmtree(os.path.join(CWD,'results'))
222222
except OSError as e:
223-
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
223+
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
224224
try:
225-
os.remove(os.path.join(CWD,'data.nc'))
225+
os.remove(os.path.join(CWD,'data.nc'))
226226
except OSError as e:
227-
print("Error: %s : %s" % (os.path.join(CWD,'data.nc'), e.strerror))
227+
print("Error: %s : %s" % (os.path.join(CWD,'data.nc'), e.strerror))
228228

229229

230230

tests/test_earthquakes.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ def test_spod_low_storage_savefft():
258258

259259
# clean up results
260260
try:
261-
shutil.rmtree(os.path.join(CWD,'results'))
261+
shutil.rmtree(os.path.join(CWD,'results'))
262262
except OSError as e:
263-
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
263+
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
264264

265265

266266

@@ -316,9 +316,9 @@ def test_spod_low_ram_savefft():
316316

317317
# clean up results
318318
try:
319-
shutil.rmtree(os.path.join(CWD,'results'))
319+
shutil.rmtree(os.path.join(CWD,'results'))
320320
except OSError as e:
321-
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
321+
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
322322

323323

324324

@@ -379,13 +379,13 @@ def test_postprocessing():
379379

380380
# clean up results
381381
try:
382-
shutil.rmtree(os.path.join(CWD,'results'))
382+
shutil.rmtree(os.path.join(CWD,'results'))
383383
except OSError as e:
384-
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
384+
print("Error: %s : %s" % (os.path.join(CWD,'results'), e.strerror))
385385
try:
386-
shutil.rmtree(os.path.join(CFD,'__pycache__'))
386+
shutil.rmtree(os.path.join(CFD,'__pycache__'))
387387
except OSError as e:
388-
print("Error: %s : %s" % (os.path.join(CFD,'__pycache__'), e.strerror))
388+
print("Error: %s : %s" % (os.path.join(CFD,'__pycache__'), e.strerror))
389389

390390

391391

0 commit comments

Comments
 (0)