inequality icon indicating copy to clipboard operation
inequality copied to clipboard

Gini and Theil classes as top-level in namespace?

Open jGaboardi opened this issue 3 years ago • 4 comments

We are currently populating the top-level namespace with access to the Gini & Theil classes as inequality.gini.Gini, for example. I would like to propose adding the classes themselves to the top-level namespace, e.g.:

from .gini import Gini

This would help distinguishing between the class offering of Gini & Theil and the functional indices in _indices.

xref #31

jGaboardi avatar Nov 30 '22 02:11 jGaboardi

Probably best to start with a FutureWarning that the namespace will change, even though only slightly.

jGaboardi avatar Dec 02 '22 22:12 jGaboardi

@martinfleis Do you have any input on this since momepy is using both Gini and Theil?

jGaboardi avatar Dec 05 '22 21:12 jGaboardi

We have it as optional dependency with imports as from inequality.theil import Theil so I don't mind if I do that or from inequality import Theil

martinfleis avatar Dec 05 '22 21:12 martinfleis

If the merge with segregation will happen, I would follow whatever model is there.

martinfleis avatar Dec 05 '22 21:12 martinfleis