NEXT
NEXT copied to clipboard
Remove unused OOP wrappers for algorithms
Many of the algorithms are wrapped in classes when they could simply be modules. For example, rather than having a directory structure of
algs/RandomSamplingLinearLeastSquares/__init__.py
algs/RandomSamplingLinearLeastSquares/RandomSamplingLinearLeastSquares.py
with RandomSamplingLinearLeastSquares.py
defining a class, just have
algs/RandomSamplingLinearLeastSquares.py
containing the functions defined by the algorithm, wrapped in a class (or possibly not, as needed).
Some algorithms require helper utility files, e.g. PoolBasedTriplets. That's why we threw them in a folder instead of keeping them in one file that could get very messy
On Tue, Sep 13, 2016 at 9:03 AM, D [email protected] wrote:
Many of the algorithms are wrapped in classes when they could simply be modules. For example, rather than having a directory structure of
algs/RandomSamplingLinearLeastSquares/init.py algs/RandomSamplingLinearLeastSquares/RandomSamplingLinearLeastSquares.py
with RandomSamplingLinearLeastSquares.py defining a class, just have
algs/RandomSamplingLinearLeastSquares.py
containing the functions defined by the algorithm, wrapped in a class (or possibly not, as needed).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nextml/NEXT/issues/134, or mute the thread https://github.com/notifications/unsubscribe-auth/ACHgB7kjisoO6ZUyIAcx8RHnkTIscdA0ks5qpsk_gaJpZM4J72Z5 .
Yeah--those are instances where the extra folder structure is used. As far as I understand, Python does not distinguish between the existing structure and the one suggested above, so if we simplify everything to use the suggested one when possible, leaving open the option "you can create a whole folder with redundantly named files and an empty __init__.py
file if you want extra separate utils/whatever" but avoiding this mess when we don't want utils or anything.
This is addressed by #163