Skip to content
Permalink
master

Commits on Oct 8, 2020

  1. Add default args and type hints for problem 7 (#2973)

    - Add default argument values
    - Add type hints
    - Change one letter variable names to a more descriptive one
    - Add doctest for `solution()`
    dhruvmanila committed Oct 8, 2020

Commits on Oct 7, 2020

  1. Add type hints and default args for problem 20 (#2962)

    - Improved variable names
    - Added type hints
    - Added default argument values for validate_solutions script
    dhruvmanila committed Oct 7, 2020
  2. Add default arguments for Project Euler problem 6 (#2957)

    - Add default arguments to solution function
    - Add link to Project Euler problem 6
    - Add doctest for testing `solution()`
    - Removed test_solutions.py as it is redundant
    dhruvmanila committed Oct 7, 2020

Commits on Oct 4, 2020

  1. Fix pre-commit error in GitHub action file (#2765)

    dhruvmanila committed Oct 4, 2020

Commits on Sep 30, 2020

  1. Add badges for code style and pre-commit in README.md (#2516)

    * Add badges for code style and pre-commit
    
    * Update badge style to flat-square
    
    * Update Gitpod logo style to flat-square
    dhruvmanila committed Sep 30, 2020
  2. Add GitHub action for pre-commit (#2515)

    * Add GitHub action file for pre-commit
    
    * Fix errors exposed by pre-commit hook:
    
    - Remove executable bit from files without shebang. I checked those
      file and it was not needed.
    - Fix with black
    
    * Apply suggestions from code review
    
    Co-authored-by: Christian Clauss <cclauss@me.com>
    
    Co-authored-by: Christian Clauss <cclauss@me.com>
    dhruvmanila and cclauss committed Sep 30, 2020
  3. Add pre-commit hook for TheAlgorithms/Python (#2511)

    * Add pre-commit basic config file
    
    * Add pre-commit to requirements.txt
    
    * Small tweaks and use stable for black
    
    * Fix isort section in pre-commit-config file
    
    * Fix errors and EOF only for Python files
    dhruvmanila committed Sep 30, 2020
  4. Fix all errors mentioned in pre-commit run (#2512)

    * Fix all errors mentioned in pre-commit run:
    
    - Fix end of file
    - Remove trailing whitespace
    - Fix files with black
    - Fix imports with isort
    
    * Fix errors
    dhruvmanila committed Sep 30, 2020

Commits on Sep 28, 2020

  1. Fix imports for all namespace packages (#2506)

    * Fix imports as they're namespace packages
    
    * Fix import for scripts/validate_filenames.py
    
    * Fix path in doctest
    dhruvmanila committed Sep 28, 2020
  2. Add __init__.py files in all the directories (#2503)

    dhruvmanila committed Sep 28, 2020
    1
  3. Add algorithm for testing Project Euler solutions (#2471)

    * Add file for testing Project Euler solutions
    
    * Remove the importlib import
    
    * Update project_euler/solution_test.py
    
    Co-authored-by: Christian Clauss <cclauss@me.com>
    
    * Small tweaks to project_euler/solution_test.py
    
    * Test Project Euler solutions through Travis
    
    * Improved testing for Project Euler solutions:
    
    - Renamed file so that it isn't picked up by pytest
    - Fail fast on validating solutions through Travis CI
    
    * Update validate_solutions.py
    
    * Use namedtuple for input parameters and answer
    
    - Remove logging
    - Remove unnecessary checks for PROJECT_EULER_PATH as Travis CI
      picks up the same path
    
    * Fix flake8 errors: line too long
    
    * Small tweaks to validate_solutions.py
    
    * Add all answers & back to using dictionary
    
    * Using pytest for testing Project Euler solutions
    
    - As we want to fail fast on testing solutions, we need to test using
      this script first before we use tests written by the author.
    - As pytest stops testing as soon as it receives a traceback, we need to
      use pytest-subtests to tell pytest to test all the iterations for the
      function with given parameters.
    
    * Print error messages in oneline format
    
    * Separated answers into a separate file:
    
    - Add custom print function to print all the error messages at the
      end of all the tests
    - Let Travis skip if this failed
    
    Co-authored-by: Christian Clauss <cclauss@me.com>
    dhruvmanila and cclauss committed Sep 28, 2020

Commits on Sep 27, 2020

  1. Small fix (#2498)

    dhruvmanila committed Sep 27, 2020

Commits on Sep 24, 2020

  1. Add solution() for problem 54 of Project Euler (#2472)

    * Add solution() for problem 54 of Project Euler
    
    * Add type hints for solution() function
    dhruvmanila committed Sep 24, 2020

Commits on Sep 23, 2020

  1. Config Travis CI for two jobs (#2463)

    * Testing Travis CI configuration for project Euler
    
    * Fix: Installing mypy and pytest-cov for testing
    
    * Remove unnecessary checks for project_euler job
    
    * Removing branches section
    
    * Update .travis.yml
    
    * Update .travis.yml
    
    * Update .travis.yml
    
    * Update .travis.yml
    
    Co-authored-by: Christian Clauss <cclauss@me.com>
    dhruvmanila and cclauss committed Sep 23, 2020

Commits on Sep 20, 2020

  1. Create problem_54 in project Euler (#2451)

    * Add solution and test files for project euler 54
    
    * Update sol1.py
    
    * updating DIRECTORY.md
    
    * Fix: use proper path to open files
    
    * Commit suggestions:
    
    - Use list comprehension instead of map
    - Sort imports using isort
    
    * Changes made as suggested (simplified a lot):
    
    - List and set comprehension instead of itemgetter
    - Using enumerate as it's easy to read
    - Divided into list of card values and set of card suit as set will
      remove all the duplicate values. So, no need for double indexing.
    - Add test for testing multiple calls to five_high_straight function
    
    * Add suggestions and simplified:
    
    - Split generate_random_hands function into two:
      - First will generate a random hand
      - Second, which will be called, will return a generator object
    
    Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
    dhruvmanila and github-actions committed Sep 20, 2020
You can’t perform that action at this time.