Skip to content

Commit 51bf80a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c5d0f2f commit 51bf80a

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

asv_bench/benchmarks/Argofloat_benchmark.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import numpy as np
66

7-
from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, ScipyParticle, StatusCode, Variable
7+
from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, StatusCode, Variable
88

9-
def ArgoVerticalMovement(particle, fieldset, time):
9+
10+
def ArgoVerticalMovement(particle, fieldset, time):
1011
driftdepth = 1000 # maximum depth in m
1112
maxdepth = 2000 # maximum depth in m
1213
vertical_speed = 0.10 # sink and rise speed in m/s
@@ -52,6 +53,7 @@ def ArgoVerticalMovement(particle, fieldset, time):
5253
if particle.state == StatusCode.Evaluate:
5354
particle.cycle_age += particle.dt # update cycle_age
5455

56+
5557
class ArgoFloatJIT:
5658
def setup(self):
5759
xdim = ydim = zdim = 2
@@ -86,19 +88,10 @@ def setup(self):
8688
]
8789
)
8890

89-
self.pset=ParticleSet(
90-
fieldset=fieldset,
91-
pclass=ArgoParticle,
92-
lon=[0],
93-
lat=[0],
94-
depth=[0]
95-
)
91+
self.pset = ParticleSet(fieldset=fieldset, pclass=ArgoParticle, lon=[0], lat=[0], depth=[0])
9692

9793
# combine Argo vertical movement kernel with built-in Advection kernel
9894
self.kernels = [ArgoVerticalMovement, AdvectionRK4]
99-
95+
10096
def time_run_single_timestep(self):
10197
self.pset.execute(AdvectionRK4, runtime=timedelta(seconds=1 * 30), dt=timedelta(seconds=30))
102-
103-
104-

0 commit comments

Comments
 (0)