Skip to content

Commit 50a8f19

Browse files
Merge pull request #1067 from OceanParcels/reducing_pytest_warnings
Reducing number of pytest warnings
2 parents 6a6e3c6 + 33a6e66 commit 50a8f19

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

parcels/examples/example_peninsula.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def peninsula_fieldset(xdim, ydim, mesh='flat', grid_type='A'):
4747

4848
# Generate the original test setup on A-grid in m
4949
domainsizeX, domainsizeY = (1.e5, 5.e4)
50-
La = np.linspace(0, domainsizeX, xdim, dtype=np.float32)
51-
Wa = np.linspace(0, domainsizeY, ydim, dtype=np.float32)
50+
La = np.linspace(1e3, domainsizeX, xdim, dtype=np.float32)
51+
Wa = np.linspace(1e3, domainsizeY, ydim, dtype=np.float32)
5252

5353
u0 = 1
5454
x0 = domainsizeX / 2

parcels/particleset/baseparticleset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,6 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
488488
p.dt = dt
489489
self.add(pset_new)
490490
next_prelease += self.repeatdt * np.sign(dt)
491-
if abs(time-next_output) < tol:
492-
if output_file:
493-
output_file.write(self, time)
494491
if abs(time - next_output) < tol or dt == 0:
495492
for fld in self.fieldset.get_fields():
496493
if hasattr(fld, 'to_write') and fld.to_write:
@@ -499,6 +496,9 @@ def execute(self, pyfunc=AdvectionRK4, pyfunc_inter=None, endtime=None, runtime=
499496
fldfilename = str(output_file.name).replace('.nc', '_%.4d' % fld.to_write)
500497
fld.write(fldfilename)
501498
fld.to_write += 1
499+
if abs(time - next_output) < tol:
500+
if output_file:
501+
output_file.write(self, time)
502502
next_output += outputdt * np.sign(dt)
503503
if abs(time-next_movie) < tol:
504504
self.show(field=movie_background_field, show_time=time, animation=True)

tests/test_kernel_language.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def test_EOSseawaterproperties_kernels(pset_mode, mode):
438438
'temperature': 40,
439439
'potemperature': 36.89073},
440440
dimensions={'lat': 0, 'lon': 0, 'depth': 0})
441-
fieldset.add_constant('refpressure', np.float(0))
441+
fieldset.add_constant('refpressure', float(0))
442442

443443
class PoTempParticle(ptype[mode]):
444444
potemp = Variable('potemp', dtype=np.float32)

0 commit comments

Comments
 (0)