Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation of _indices #69

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

deprecation of _indices #69

wants to merge 3 commits into from

Conversation

sjsrey
Copy link
Member

@sjsrey sjsrey commented Apr 24, 2024

xref #67

inequality/_indices.py Outdated Show resolved Hide resolved
Co-authored-by: James Gaboardi <jgaboardi@gmail.com>
@jGaboardi
Copy link
Member

Should we disable doctests for the _indices.py module to get CI green?


warnings.warn(
"The module _indices is deprecated and will be removed on 2025-01-01.",
DeprecationWarning,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeprecationWarning assumes that we cut a release, then change it to FutureWarning and make another release with that, then enforce the deprecation. Shall we rather go straight for FutureWarning?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, let's change to a FutureWarning.

inequality/_indices.py Outdated Show resolved Hide resolved
@jGaboardi
Copy link
Member

@sjsrey shall we pick this back up again to get CI green?

Co-authored-by: James Gaboardi <jgaboardi@gmail.com>
@martinfleis
Copy link
Member

Slight issue I see is that this warning is emitted by import inequality even if you're not interacting with the indices module. We may need to emit it in the functions themselves. Maybe a decorator?

@jGaboardi
Copy link
Member

Looks like have a fresh exception being thrown by bleeding edge pandas now. If it's not something to simply let ride, we can open a new ticket for it.

201     >>> import libpysal
UNEXPECTED EXCEPTION: ImportError("cannot import name 'CachedAccessor' from 'pandas.core.accessor' (/home/runner/micromamba/envs/test/lib/python3.12/site-packages/pandas/core/accessor.py)")
Traceback (most recent call last):
  File "/home/runner/micromamba/envs/test/lib/python3.12/doctest.py", line 1361, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest inequality.theil.TheilDSim[0]>", line 1, in <module>
  File "/home/runner/micromamba/envs/test/lib/python3.12/site-packages/libpysal/__init__.py", line 27, in <module>
    from . import cg, examples, io, weights
  File "/home/runner/micromamba/envs/test/lib/python3.12/site-packages/libpysal/cg/__init__.py", line 12, in <module>
    from .voronoi import *
  File "/home/runner/micromamba/envs/test/lib/python3.12/site-packages/libpysal/cg/voronoi.py", line 10, in <module>
    import geopandas as gpd
  File "/home/runner/micromamba/envs/test/lib/python3.12/site-packages/geopandas/__init__.py", line 4, in <module>
    from geopandas.geodataframe import GeoDataFrame
  File "/home/runner/micromamba/envs/test/lib/python3.12/site-packages/geopandas/geodataframe.py", line 8, in <module>
    from pandas.core.accessor import CachedAccessor
ImportError: cannot import name 'CachedAccessor' from 'pandas.core.accessor' (/home/runner/micromamba/envs/test/lib/python3.12/site-packages/pandas/core/accessor.py)
/home/runner/work/inequality/inequality/inequality/theil.py:201: UnexpectedException

@jGaboardi
Copy link
Member

Should we disable doctests for the _indices.py module to get CI green?

We still need to address these failures, either by skipping or updating.

@martinfleis
Copy link
Member

@jGaboardi that is fixed by geopandas/geopandas#3288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants