Skip to content

Commit

Permalink
Fix up a couple of tests that were failing
Browse files Browse the repository at this point in the history
  • Loading branch information
wcarthur committed Nov 12, 2020
1 parent 1ead7bd commit 1916233
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions PlotInterface/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def addGraticule(self, axes, mapobj):
draw_labels=True)
gl.xformatter = LONGITUDE_FORMATTER
gl.yformatter = LATITUDE_FORMATTER
gl.xlabels_top = False
gl.ylabels_right = False
gl.top_labels = False
gl.right_labels = False

def addCoastline(self, mapobj):
"""
Expand Down
6 changes: 5 additions & 1 deletion tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def setUp(self):
self.addCleanup(Utilities.config.reset)

self.tmpdir = tempfile.TemporaryDirectory()
self.addCleanup(self.tmpdir.cleanup)
#self.addCleanup(self.tmpdir.cleanup)

self.configFile = os.path.join(
Utilities.pathLocator.getRootDirectory(),
Expand All @@ -48,6 +48,7 @@ def setUp(self):
config = Utilities.config.ConfigParser()
config.read(self.configFile)
config['Output']['Path'] = self.tmpdir.name
config['WindfieldInterface']['PlotOutput'] = 'True'

@decimate(100)
def test_scenario(self):
Expand All @@ -71,5 +72,8 @@ def test_scenario(self):
self.assertGreater(white.sum() / pixels, 0.2) # substantial space
self.assertGreater(color.sum() / pixels, 0.05) # significant color

from time import sleep
sleep(1)

if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion wind/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __call__(self, time, gust, Ux, Uy, P, lon, lat):
t = len(self.time)

if not t:
self.time.units = "days since " + time.strftime()
self.time.units = "days since " + time.strftime("%Y-%m-%d %H:%M")

# convert window extent to slice indices
origin = np.rint(self.affine * (lon[0], lat[0])).astype(int)
Expand Down

0 comments on commit 1916233

Please sign in to comment.