Skip to content

Commit

Permalink
Fix pandas FutureWarning (#138)
Browse files Browse the repository at this point in the history
* Fix pandas FutureWarning

* Remove py3.8 support since brainglobe-utils is a hard dependency

---------

Co-authored-by: willGraham01 <[email protected]>
  • Loading branch information
adamltyson and willGraham01 authored Nov 1, 2023
1 parent aba3f48 commit 5ac5dc4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions brainreg_segment/regions/analysis.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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


Expand Down
20 changes: 8 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"},
{ name = "Adam Tyson, Horst Obenhaus", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -17,20 +17,20 @@ 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",
"pandas",
"scikit-image",
"tables",
]
license = {text = "BSD-3-Clause"}
license = { text = "BSD-3-Clause" }
dynamic = ["version"]

[project.urls]
Expand All @@ -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"]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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

0 comments on commit 5ac5dc4

Please sign in to comment.