re-organize PowerSpace
This branch aims at making the current PowerSpace
design simpler.
The following changes have been made so far:
- the
PowerSpace
members are always fully computed upon construction of thePowerSpace
; caching has been removed. This still has performance drawbacks which I hope to address in the future. - the parameters
logarithmic
andnbin
can still be supplied to the constructor, but they are no longer part of thePowerSpace
's state. They are used to compute thebinbounds
, and forgotten afterwards. (In the current implementation it is possible to set these attributes to values which contradict the actualbinbounds
, which is inconsistent.) -
pundex
is currently not supported, but can be reintroduced if needed. - "natural" binning (which happens if neither
logarithmic
,nbin
orbinbounds
are specified to the constructor) has been improved to avoid spurious extra bins due to numerical noise. - index computation has been accelerated significantly
- the
config
property has been removed;binbounds
is now a direct property of the class.
I'm sure that a lot will have to change before this can be merged; please consider this merge request mainly as a starting point for discussion!
As a quick demonstration of the advantages of the new implementation, run the following commands in both "master" and "index_games" branch and watch CPU time and memory consumption:
a=RGSpace((10000,10000),harmonic=True)
p=PowerSpace(a,binbounds=sqrt(2.)*np.arange(10000.))
Edited by Martin Reinecke