Skip to content

Commit 7824ed4

Browse files
committed
Hopefully fixing all flake8 compliance problems
1 parent ed1ce9d commit 7824ed4

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

tests/test_constructors.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ def make_simple_fieldset():
1414

1515
def make_standard_simulation_settings():
1616
simulation_settings = {'startdate': datetime.strptime('2020-01-04-00:00:00', '%Y-%m-%d-%H:%M:%S'),
17-
'runtime': timedelta(days=2),
18-
'outputdt': timedelta(hours=1),
19-
'dt': timedelta(minutes=20),
20-
}
17+
'runtime': timedelta(days=2),
18+
'outputdt': timedelta(hours=1),
19+
'dt': timedelta(minutes=20),
20+
}
2121
return simulation_settings
2222

2323

2424
def make_standard_plastictype_settings():
25-
plastictype_settings = {'wind_coefficient' : 0.01, # Percentage of wind to apply to particles
26-
'plastic_diameter' : 0.01, # Plastic particle diameter (m)
27-
'plastic_density' : 1030., # Plastic particle density (kg/m^3)
28-
}
25+
plastictype_settings = {'wind_coefficient': 0.01, # Percentage of wind to apply to particles
26+
'plastic_diameter': 0.01, # Plastic particle diameter (m)
27+
'plastic_density': 1030., # Plastic particle density (kg/m^3)
28+
}
2929
return plastictype_settings
3030

3131

@@ -76,8 +76,8 @@ def test_create_particleset_from_map(initialisation_map):
7676
settings['plastictype'] = make_standard_plastictype_settings()
7777

7878
settings['release'] = {'initialisation_type': initialisation_map,
79-
'country': 'Italy',
80-
}
79+
'country': 'Italy',
80+
}
8181

8282
fieldset = make_simple_fieldset()
8383
pset = pp.constructors.create_particleset_from_map(fieldset, settings)
@@ -97,8 +97,8 @@ def test_create_particleset_from_map_concentrations(concentration_type):
9797
settings['plastictype'] = make_standard_plastictype_settings()
9898

9999
settings['release'] = {'initialisation_type': 'global_concentrations',
100-
'concentration_type': concentration_type,
101-
}
100+
'concentration_type': concentration_type,
101+
}
102102

103103
fieldset = make_simple_fieldset()
104104
pset = pp.constructors.create_particleset_from_map(fieldset, settings)

tests/test_kernels.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
def make_standard_simulation_settings():
1010
simulation_settings = {'startdate': datetime.strptime('2020-01-04-00:00:00', '%Y-%m-%d-%H:%M:%S'),
11-
'runtime': timedelta(days=2),
12-
'outputdt': timedelta(hours=1),
13-
'dt': timedelta(minutes=20),
14-
}
11+
'runtime': timedelta(days=2),
12+
'outputdt': timedelta(hours=1),
13+
'dt': timedelta(minutes=20),
14+
}
1515
return simulation_settings
1616

1717

1818
def make_standard_plastictype_settings():
19-
#Use tiny wind percentage because test data set is not large and wind speeds are quick!
20-
plastictype_settings = {'wind_coefficient' : 0.0001, # Percentage of wind to apply to particles
21-
'plastic_diameter' : 0.001, # Plastic particle diameter (m)
22-
'plastic_density' : 1030., # Plastic particle density (kg/m^3)
23-
}
19+
# Use tiny wind percentage because test data set is not large and wind speeds are quick!
20+
plastictype_settings = {'wind_coefficient': 0.0001, # Percentage of wind to apply to particles
21+
'plastic_diameter': 0.001, # Plastic particle diameter (m)
22+
'plastic_density': 1030., # Plastic particle density (kg/m^3)
23+
}
2424
return plastictype_settings
2525

2626

@@ -30,7 +30,7 @@ def make_standard_particleset(fieldset, settings):
3030
pset = pp.constructors.create_particleset_from_map(fieldset, settings)
3131

3232
# Only keep particles in the test domain
33-
keep_particles = (pset.lon >17) & (pset.lon <20) & (pset.lat < 36) & (pset.lat > 34)
33+
keep_particles = (pset.lon > 17) & (pset.lon < 20) & (pset.lat < 36) & (pset.lat > 34)
3434
pset.remove_booleanvector(~keep_particles)
3535

3636
return pset
@@ -59,7 +59,7 @@ def test_advection_only(use_3D):
5959
kernels = [parcels.application_kernels.AdvectionRK4_3D, pp.kernels.checkThroughBathymetry, pp.kernels.checkErrorThroughSurface, pp.kernels.deleteParticle]
6060
else:
6161
kernels = [parcels.application_kernels.AdvectionRK4, pp.kernels.deleteParticle]
62-
62+
6363
pset = make_standard_particleset(fieldset, settings)
6464

6565
start_lons = pset.lon.copy()
@@ -222,8 +222,8 @@ def test_mixing():
222222
pp.kernels.checkErrorThroughSurface, pp.kernels.deleteParticle]
223223

224224
kernels_mixing = [parcels.application_kernels.AdvectionRK4_3D, pp.kernels.VerticalMixing,
225-
pp.kernels.checkThroughBathymetry, pp.kernels.checkErrorThroughSurface,
226-
pp.kernels.deleteParticle]
225+
pp.kernels.checkThroughBathymetry, pp.kernels.checkErrorThroughSurface,
226+
pp.kernels.deleteParticle]
227227

228228
pset = make_standard_particleset(fieldset, settings)
229229
pset_mixing = make_standard_particleset(fieldset, settings)

0 commit comments

Comments
 (0)