aesara-devs / aesara

Aesara is a Python library for defining, optimizing, and efficiently evaluating mathematical expressions involving multi-dimensional arrays.
https://aesara.readthedocs.io
Other
1.18k stars 155 forks source link

The naming of the division `Op`s is inconsistent with NumPy's #1212

Open rlouf opened 1 year ago

rlouf commented 1 year ago

Numpy provides the following API to perform division element-wise:

import numpy as np

np.true_divide
np.divide   # alias to `numpy.true_divide`
np.floor_divide

While Aesara uses the following names:

import aesara.tensor as at

at.true_div
at.floor_div
at.int_div   # an alias for `floor_div`

My suggestion is thus

And while we're at it:

As an aside the documentation does not reference the API that is currently implemented, it stills references truediv, intdiv and floordiv instead of respectively true_div, int_div and floor_div.

sudarsan2k5 commented 1 year ago

should we keep treu_div and create one more true_divide instance, or should we completely replace true_div with true_divide?

rlouf commented 1 year ago

Since some code probably relies on true_div we should:

(1) Replace true_div with true_divide throughout the codebase (2) Create a true_div alias (3) Add a deprecation warning for those trying to use said alias.

rlouf commented 1 year ago

We should open issues for the remaining items.