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

[enhancement] Removal/Rework of get_code(), time_complexities(), and modules.py #44

Closed
IanDoarn opened this issue Aug 21, 2017 · 1 comment

Comments

@IanDoarn
Copy link
Contributor

IanDoarn commented Aug 21, 2017

  • I've noticed that every directory/package has a modules.py file, is this truly necessary now that the documentation and README both state using help() to view the modules? I feel these can be outright removed, and the supported algorithms for each section can be simply listed on the README or we can point the user to the Documentation

  • I've also noticed that every file and every class has this get_code() method and most files have time_complexities() method. Are these truly necessary? Since python is open source, any user can simply open the file up and view the code.

  • time_complexities() seems somewhat unnecessary. Instead of storing the time complexity information in a method, why not store it in the file's docstrings or the methods docstrings?
    Example:

from pygorithm.sorting import bubble_sort
help(bubble_sort)

Help on module pygorithm.sorting.bubble_sort in pygorithm.sorting:

"""
NAME
    pygorithm.sorting.bubble_sort

DESCRIPTION
    Author: OMKAR PATHAK
    Contributors: Mohamed Kiouaz
    Created On: 31st July 2017
    
    Time Complexities:
     - Best O(n)
     - Average O(n*(n-1)/4)
     - Worst O(n^2)
"""

OR

from pygorithm.sorting import bubble_sort
help(bubble_sort.sort)
"""
Help on function sort in module pygorithm.sorting.bubble_sort:
sort(_list)
    Bubble Sorting algorithm
    
    Time Complexities:
     - Best O(n)
     - Average O(n*(n-1)/4)
     - Worst O(n^2)
    :param _list: list of values to sort
    :return: sorted values
"""
@IanDoarn IanDoarn changed the title Removal/Rework of get_code() and time_complexities() [enhancement] Removal/Rework of get_code() and time_complexities() Aug 21, 2017
@IanDoarn IanDoarn changed the title [enhancement] Removal/Rework of get_code() and time_complexities() [enhancement] Removal/Rework of get_code(), time_complexities(), and modules.py Aug 21, 2017
@OmkarPathak
Copy link
Owner

I think time_complexities() is necessary as some of the users may need it to display them right in the Python interpreter. Docstrings seems great idea to place time complexities but many users especially who are beginners dont know much about docstrings. Hence it would nice to keep time_complexities(). Removing modules.py would be a great idea though!

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

2 participants