Skip to content

Commit

Permalink
Fixing nctools.ncGetTimes - remove test skips
Browse files Browse the repository at this point in the history
  • Loading branch information
wcarthur committed Sep 7, 2018
1 parent c0e96a7 commit 7d9f303
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ branches:
- notebooks
script:
- python installer/setup.py build_ext -i
- nosetests -v --with-coverage
- nosetests -v --with-coverage --cover-package=.
after_success: coveralls
notifications:
slack:
Expand Down
2 changes: 1 addition & 1 deletion Utilities/nctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def ncGetTimes(ncobj, name='time'):
calendar = times.calendar
else:
calendar = 'standard'
#import pdb; pdb.set_trace()

dates = num2date(times[:].data, units, calendar)

return np.array(dates, dtype=datetime)
Expand Down
62 changes: 46 additions & 16 deletions matplotlibrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,53 @@
# TCRM Plotting Configuration
backend: TkAgg
lines.linewidth: 0.5
lines.markersize: 1
font.size: 12.0
text.color: black
text.antialiased: True
axes.titlesize: large
axes.labelsize: small
axes.labelcolor: black
axes.color_cycle: k, b, g, r, c, m, y

#### LINES
lines.linewidth : 0.5
lines.linestyle : -
lines.markersize : 1
lines.color : C0

#### FONTS
font.family : sans-serif
font.size : 10.0
font.style : normal


#### TEXT
text.color : black
text.antialiased : True

#### AXES
axes.titlesize : large
axes.labelsize : small
axes.labelcolor : black
axes.prop_cycle : cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf'])

#### LEGEND
legend.fancybox: True
legend.frameon: True
xtick.direction: out
ytick.direction: out
xtick.labelsize: x-small
ytick.labelsize: x-small

#### TICKS
xtick.direction : out
ytick.direction : out
xtick.labelsize : x-small
ytick.labelsize : x-small

#### CONTOURS
contour.negative_linestyle: dashed
figure.dpi: 300
figure.figsize: 16, 12

#### GRIDS
grid.color : 808080
grid.linestyle : --
grid.linewidth : 0.5
grid.alpha : 0.75

#### FIGURES
figure.dpi : 300
figure.figsize : 12, 8
figure.subplot.left: 0.0675
figure.subplot.right: 0.9125
image.cmap: Blues

#### IMAGES
image.aspect : equal
image.cmap : viridis
2 changes: 0 additions & 2 deletions tests/test_nctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,13 @@ def test_ncReadFile(self):
self.numpyAssertEqual(temp_check, temp[nrec])
ncobj.close()

#@unittest.skip("Raises value error in netCDF4 v1.4")
def test_ncGetTimes(self):
"""Test ncGetTimes returns datetime objects"""
ncobj = netCDF4.Dataset(self.ncfile)
times = nctools.ncGetTimes(ncobj)
ncobj.close()
self.assertEqual(type(times[0]), datetime)

#@unittest.skip("Raises value error in netCDF4 v1.4")
def test_ncGetTimeValues(self):
"""Test ncGetTimes returns correct time values"""
ncobj = netCDF4.Dataset(self.ncfile)
Expand Down

0 comments on commit 7d9f303

Please sign in to comment.