Skip to content

Remove unused OOP wrappers for algorithms #134

Open

Description

@daniel3735928559

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

Activity

  1. added this to the v1.1 milestone on Sep 13, 2016
  2. kgjamieson commented on Sep 13, 2016

    @kgjamieson
    Contributor

    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 notifications@github.com 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
    #134, or mute the thread
    https://github.com/notifications/unsubscribe-auth/ACHgB7kjisoO6ZUyIAcx8RHnkTIscdA0ks5qpsk_gaJpZM4J72Z5
    .

  3. daniel3735928559 commented on Sep 13, 2016

    @daniel3735928559
    ContributorAuthor

    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.

  4. stsievert commented on Jan 15, 2017

    @stsievert
    Member

    This is addressed by #163

  5. reopened this on Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions