NEXT icon indicating copy to clipboard operation
NEXT copied to clipboard

Remove unused OOP wrappers for algorithms

Open daniel3735928559 opened this issue 8 years ago • 3 comments

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).

daniel3735928559 avatar Sep 13 '16 16:09 daniel3735928559

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 .

kgjamieson avatar Sep 13 '16 16:09 kgjamieson

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.

daniel3735928559 avatar Sep 13 '16 18:09 daniel3735928559

This is addressed by #163

stsievert avatar Jan 15 '17 19:01 stsievert