great-tables icon indicating copy to clipboard operation
great-tables copied to clipboard

epic: Remove numpy as a dependency

Open machow opened this issue 4 months ago • 2 comments

Currently, we use numpy in two places:

  • No dependency: _tbl_data.py: this is where we've consolidated all our DataFrame library specific code. It's handled using databackend, so we don't need to depend on these libraries to do isinstance checks on them, etc...
  • Dependency: _utils_nanoplots.py, _data_color/base.py. This uses numpy in two ways.
    • Detecting np.integer. This could be moved to _tbl_data.py
    • Performing calculations. Functions like np.linspace(), and np.mean() should be re-implemented internally. We don't use too many numpy functions, so it hopefully isn't too nuts to do.

Note that for replacing numpy in performing calculations, we should be careful to ensure tests are in place / added where needed. We have good coverage, but I'm not sure it covers every numpy path.

machow avatar Apr 17 '24 13:04 machow