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

epic: Remove numpy as a dependency #296

Open
machow opened this issue Apr 17, 2024 · 2 comments
Open

epic: Remove numpy as a dependency #296

machow opened this issue Apr 17, 2024 · 2 comments
Labels
.epic Big features and initiatives

Comments

@machow
Copy link
Collaborator

machow commented Apr 17, 2024

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.

@jrycw
Copy link
Contributor

jrycw commented Apr 21, 2024

It seems that numpy is also utilized in some tests. Should we consider removing it from testing as well?

@machow
Copy link
Collaborator Author

machow commented Apr 22, 2024

It seems okay to keep it around in tests. Since pandas can wrap numpy, and return numpy typed objects, we might need it in tests to validate that functions do the right things for a few numpy objects (which might make it in via pandas, etc..)

@machow machow changed the title Remove numpy as a dependency epic: Remove numpy as a dependency May 23, 2024
@machow machow added the .epic Big features and initiatives label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.epic Big features and initiatives
Projects
None yet
Development

No branches or pull requests

2 participants