From 5ac5dc4a714310569ffc3c43ecac0ad4e79dd427 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Wed, 1 Nov 2023 10:14:26 +0000 Subject: [PATCH] Fix pandas FutureWarning (#138) * Fix pandas FutureWarning * Remove py3.8 support since brainglobe-utils is a hard dependency --------- Co-authored-by: willGraham01 <1willgraham@gmail.com> --- .github/workflows/test_and_deploy.yml | 4 ++-- brainreg_segment/regions/analysis.py | 4 ++-- pyproject.toml | 20 ++++++++------------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 972fd84..f29eba1 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -22,12 +22,12 @@ jobs: matrix: # Run across a mixture of Python versions and operating systems include: + - os: ubuntu-latest + python-version: "3.11" - os: macos-latest python-version: "3.10" - os: windows-latest python-version: "3.9" - - os: ubuntu-latest - python-version: "3.8" steps: - name: Cache atlases diff --git a/brainreg_segment/regions/analysis.py b/brainreg_segment/regions/analysis.py index a99ece4..35a098d 100644 --- a/brainreg_segment/regions/analysis.py +++ b/brainreg_segment/regions/analysis.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd from brainglobe_utils.general.list import unique_elements_lists -from brainglobe_utils.pandas.misc import initialise_df +from brainglobe_utils.pandas.misc import initialise_df, safe_pandas_concat from napari.qt.threading import thread_worker from skimage.measure import regionprops_table @@ -248,7 +248,7 @@ def add_structure_volume_to_df( } df_to_append = pd.DataFrame(data_to_append) - df = pd.concat([df, df_to_append], ignore_index=True) + df = safe_pandas_concat(df, df_to_append) return df diff --git a/pyproject.toml b/pyproject.toml index 6778525..2198290 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "brainreg-segment" description = "Manual segmentation of 3D brain structures in a common anatomical space" readme = "README.md" authors = [ - {name = "Adam Tyson, Horst Obenhaus", email = "code@adamltyson.com"}, + { name = "Adam Tyson, Horst Obenhaus", email = "code@adamltyson.com" }, ] classifiers = [ "Development Status :: 4 - Beta", @@ -17,12 +17,12 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", ] -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = [ "brainglobe-napari-io >= 0.3.0", "dask >= 2.15.0", "imio", - "brainglobe-utils", + "brainglobe-utils >= 0.2.7", "napari-plugin-engine >= 0.1.4", "napari>=0.4.5", "numpy", @@ -30,7 +30,7 @@ dependencies = [ "scikit-image", "tables", ] -license = {text = "BSD-3-Clause"} +license = { text = "BSD-3-Clause" } dynamic = ["version"] [project.urls] @@ -49,7 +49,7 @@ dev = [ "coverage", "pytest-cov", "pytest-qt", - "napari-time-slicer" # to test non ndarray-types + "napari-time-slicer", # to test non ndarray-types ] [project.entry-points."napari.manifest"] @@ -62,11 +62,7 @@ brainreg-segment = "brainreg_segment.segment:main" brainreg-segment = "brainreg_segment.plugins" [build-system] -requires = [ - "setuptools>=45", - "wheel", - "setuptools_scm[toml]>=6.2", -] +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" [tool.setuptools] @@ -94,7 +90,7 @@ filterwarnings = [ # Warning comes from vispy - fixed in vispy 0.12.0. napari 0.5.0 will bump # vispy to 0.5.0, so this filter should be removed when napari 0.5.0 # is released - "ignore:distutils Version classes are deprecated:DeprecationWarning" + "ignore:distutils Version classes are deprecated:DeprecationWarning", ] [tool.black] @@ -104,6 +100,6 @@ line-length = 79 [tool.ruff] line-length = 79 -exclude = ["__init__.py","build",".eggs"] +exclude = ["__init__.py", "build", ".eggs"] select = ["I", "E", "F"] fix = true