Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Feb 21, 2025
1 parent 98f150f commit d74c36f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions holoviews/tests/core/data/test_spatialpandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from unittest import SkipTest

import numpy as np
import pandas as pd

try:
import spatialpandas
Expand All @@ -24,12 +25,14 @@
except ImportError:
dd = None

from holoviews import Dimension
from holoviews.core.data import (
DaskSpatialPandasInterface,
Dataset,
SpatialPandasInterface,
)
from holoviews.core.data.interface import DataError
from holoviews.core.data.spatialpandas import get_value_array
from holoviews.element import Path, Points, Polygons
from holoviews.element.comparison import ComparisonTestCase

Expand Down Expand Up @@ -301,3 +304,14 @@ def test_dict_dataset_add_dimension_values(self):

def test_sort_by_value(self):
raise SkipTest("Not supported")



def test_regression_get_value_array():
# See: https://github.com/holoviz/holoviews/pull/6519
df = pd.DataFrame(
{"Longitude": [0, 1, 2], "Latitude": [0, 1, 2], "Sensor": ["S1", "S2", "S1"]}
)
result = get_value_array(df, Dimension("Sensor"), False, None, None, None)

np.testing.assert_array_equal(df.Sensor, result)

0 comments on commit d74c36f

Please sign in to comment.