Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactoring #1

Open
screx opened this issue May 20, 2021 · 0 comments
Open

Code refactoring #1

screx opened this issue May 20, 2021 · 0 comments

Comments

@screx
Copy link

screx commented May 20, 2021

Refactoring the code will allow users to easily use, read, and contribute to the
codebase more effectively!

rewrite parts of code to become more readable, modular, and usability if possible while
keeping functionality the exact same. i.e. public method function signatures remain the exact
same but their internals are modified to reflect our goals

These are just some suggestions I have after looking through the code, feel free to add others or discuss ideas for this

Ideas:

  • clean up comments

  • removal of unused bits of code

  • move default options in the function header

    • currently options are being passed in and compared to default options in the
      function body
    • factory-like methods
    • e.g. evaluate(...) based on options[“method”] should call a new
      function that returns the same ADT
    • move default parameters to function header
    • can be used with functions that use a specific set of parameters that
      are always included.
    • use of **kwargs instead of default passing in options
    • https://stackoverflow.com/questions/1769403/what-is-the-purpose-and
    • use-of-kwargs
  • verbosity passed in the options of each method instead of set as a class attribute

    • perhaps setting the objects default attribute to change this and if say the
      objects verbosity is set to false you can pass the verbose argument to set it to
      true for ONLY that method
  • rewrite input verification

    • currently being done by also keeping dict of parameter set along with
      anonymous functions that perform input verification
    • use getter/setter functions?
      • set an attribute and verify the type and value o/w throw an error or something
      • get the attribute value after its set
  • use of static methods or new classes

    • from what I’ve seen a lot of the methods do not actually use any of the
      classes attributes other than num_params/param_list/symbolics_boolean
    • consider using some sort of design pattern to help with this
  • better testing suite

    • currently tests/ is full of stubbed tests!
  • examples/

    • unify all steps into 1 larger jupyter notebook OR create readme’s that describe
      the logical order of reading the jupyter notebooks and what the examples are
      accomplishing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant