diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 65bed49..027cb52 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -25,7 +25,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11'] timeout-minutes: 10 steps: - uses: actions/checkout@v3 diff --git a/holonote/annotate/table.py b/holonote/annotate/table.py index fb7d348..c418438 100644 --- a/holonote/annotate/table.py +++ b/holonote/annotate/table.py @@ -243,7 +243,7 @@ def delete_annotation(self, index): def update_annotation_fields(self, index, **fields): for column, value in fields.items(): - self._field_df.loc[index][column] = value + self._field_df.loc[index, column] = value self._edits.append({'operation':'update', 'id':index, 'fields' : [c for c in fields.keys()], @@ -303,7 +303,7 @@ def define_points(self, dims, posx, posy=None): raise KeyError(f'Keys {mismatches} do not match any fields entries') dim2 = None if len(dims)==1 else dims[1] - value = zip(posx, pd.Series([None for el in range(len(posx))])) if len(dims)==1 else zip(posx, posy) + value = zip(posx, [None] * len(posx)) if len(dims)==1 else zip(posx, posy) additions = pd.DataFrame({"region_type":'Point', "dim1":dims[0], "dim2":dim2, diff --git a/holonote/tests/test_connectors.py b/holonote/tests/test_connectors.py index 5047488..32f1d9b 100644 --- a/holonote/tests/test_connectors.py +++ b/holonote/tests/test_connectors.py @@ -78,7 +78,7 @@ def test_add_row(self, database, request): end = pd.Timestamp('2022-06-03') description = 'A description' insertion = {"uuid": id1, 'description':description, 'start':start, 'end':end} - df = pd.DataFrame({"uuid":pd.Series([id1], dtype=object), + df = pd.DataFrame({"uuid":[database.primary_key.cast(id1)], 'description':[description], 'start':[start], 'end':[end]}).set_index("uuid") database.add_row(**insertion) pd.testing.assert_frame_equal(database.load_dataframe(), df) @@ -102,10 +102,12 @@ def test_add_three_rows_delete_one(self, database): 'start':pd.Timestamp('2026-06-01'), 'end':pd.Timestamp('2026-06-03')} - df_data = {'uuid': pd.Series([insertion1['uuid'], insertion3['uuid']], dtype=object), - 'description':[insertion1['description'], insertion3['description']], - 'start':[insertion1['start'], insertion3['start']], - 'end':[insertion1['end'], insertion3['end']]} + df_data = { + 'uuid': map(database.primary_key.cast, [insertion1['uuid'], insertion3['uuid']]), + 'description':[insertion1['description'], insertion3['description']], + 'start':[insertion1['start'], insertion3['start']], + 'end':[insertion1['end'], insertion3['end']] + } df = pd.DataFrame(df_data).set_index('uuid') database.add_row(**insertion1) database.add_row(**insertion2) diff --git a/pyproject.toml b/pyproject.toml index 65f5faf..11f79d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", ] -dependencies = ["holoviews", "pandas<2"] +dependencies = ["holoviews", "pandas"] [tool.hatch.version] source = "vcs" @@ -24,7 +24,7 @@ source = "vcs" [tool.hatch.envs.test] dependencies = ["pytest"] scripts.run = "python -m pytest holonote/tests" -matrix = [{ python = ["3.8", "3.9", "3.10"] }] +matrix = [{ python = ["3.8", "3.9", "3.10", "3.11"] }] [tool.hatch.envs.fmt] dependencies = ["pre-commit"]