inequality icon indicating copy to clipboard operation
inequality copied to clipboard

deprecation of _indices

Open sjsrey opened this issue 1 year ago • 6 comments

xref #67

sjsrey avatar Apr 24 '24 15:04 sjsrey

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

jGaboardi avatar Apr 24 '24 16:04 jGaboardi

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

jGaboardi avatar May 16 '24 23:05 jGaboardi

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?

martinfleis avatar May 17 '24 09:05 martinfleis

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 avatar May 17 '24 13:05 jGaboardi

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.

jGaboardi avatar May 17 '24 13:05 jGaboardi

@jGaboardi that is fixed by https://github.com/geopandas/geopandas/pull/3288

martinfleis avatar May 17 '24 13:05 martinfleis

The remaining failure is related to codecov on macos-13.

@jGaboardi any suggestions?

sjsrey avatar Aug 14 '24 22:08 sjsrey

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.2%. Comparing base (eb15ef6) to head (9a28ef2). Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main     #69     +/-   ##
=======================================
+ Coverage   98.0%   98.2%   +0.2%     
=======================================
  Files          4       4             
  Lines        301     334     +33     
=======================================
+ Hits         295     328     +33     
  Misses         6       6             
Files Coverage Δ
inequality/_indices.py 100.0% <100.0%> (ø)
inequality/gini.py 92.6% <ø> (ø)

codecov[bot] avatar Aug 14 '24 22:08 codecov[bot]

Seems that it's actually pre-commit that's complaining. Did you run ruff check inequality locally before pushing?

jGaboardi avatar Aug 14 '24 23:08 jGaboardi

pre-commit.ci run

jGaboardi avatar Aug 15 '24 00:08 jGaboardi

pre-commit.ci autofix

jGaboardi avatar Aug 15 '24 00:08 jGaboardi

The bot is having trouble auto fixing the import sorting for some reason. Running ruff check inequality --fix locally should resolve the issue.

jGaboardi avatar Aug 15 '24 00:08 jGaboardi

pre-commit.ci autofix

jGaboardi avatar Aug 15 '24 14:08 jGaboardi