Skip to content

Commit

Permalink
Merge 0d00406 into effaf45
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Jul 19, 2021
2 parents effaf45 + 0d00406 commit 3db8310
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions holoviews/core/util.py
Expand Up @@ -2099,13 +2099,13 @@ def cftime_to_timestamp(date, time_unit='us'):
time_unit since 1970-01-01 00:00:00
"""
import cftime
utime = cftime.utime('microseconds since 1970-01-01 00:00:00')
if time_unit == 'us':
tscale = 1
else:
tscale = (np.timedelta64(1, 'us')/np.timedelta64(1, time_unit))
return utime.date2num(date)*tscale

return cftime.date2num(date,'microseconds since 1970-01-01 00:00:00',
calendar='standard')*tscale

def search_indices(values, source):
"""
Expand Down
19 changes: 11 additions & 8 deletions holoviews/tests/plotting/plotly/test_scatterplot.py
Expand Up @@ -43,16 +43,16 @@ def test_scatter_colors(self):
(0, 1, 'red'), (1, 2, 'green'), (2, 3, 'blue')
], vdims=['y', 'color']).options(color='color')
state = self._get_plot_state(scatter)
self.assertEqual(state['data'][0]['marker']['color'],
np.array(['red', 'green', 'blue']))
self.assertEqual(np.array_equal(state['data'][0]['marker']['color'],
np.array(['red', 'green', 'blue'])), True)

def test_scatter_markers(self):
scatter = Scatter([
(0, 1, 'square'), (1, 2, 'circle'), (2, 3, 'triangle-up')
], vdims=['y', 'marker']).options(marker='marker')
state = self._get_plot_state(scatter)
self.assertEqual(state['data'][0]['marker']['symbol'],
np.array(['square', 'circle', 'triangle-up']))
self.assertEqual(np.array_equal(state['data'][0]['marker']['symbol'],
np.array(['square', 'circle', 'triangle-up'])), True)

def test_scatter_selectedpoints(self):
scatter = Scatter([
Expand Down Expand Up @@ -112,16 +112,19 @@ def test_scatter_colors(self):
(0, 1, 'red'), (1, 2, 'green'), (2, 3, 'blue')
], vdims=['y', 'color']).options(color='color')
state = self._get_plot_state(scatter)
self.assertEqual(state['data'][1]['marker']['color'],
np.array(['red', 'green', 'blue']))
self.assertEqual(np.array_equal(state['data'][1]['marker']['color'],
np.array(['red', 'green', 'blue'])), True)


def test_scatter_markers(self):
scatter = Tiles('') * Scatter([
(0, 1, 'square'), (1, 2, 'circle'), (2, 3, 'triangle-up')
], vdims=['y', 'marker']).options(marker='marker')
state = self._get_plot_state(scatter)
self.assertEqual(state['data'][1]['marker']['symbol'],
np.array(['square', 'circle', 'triangle-up']))
self.assertEqual(
np.array_equal(
state['data'][1]['marker']['symbol'],
np.array(['square', 'circle', 'triangle-up'])), True)

def test_scatter_selectedpoints(self):
scatter = Tiles('') * Scatter([
Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -51,7 +51,6 @@
if sys.version_info.major > 2:
extras_require["examples"].extend(
[
"spatialpandas",
"pyarrow",
"ibis-framework >=1.3",
] # spatialpandas incompatibility
Expand Down

0 comments on commit 3db8310

Please sign in to comment.