Skip to content

Feature: improve branch coverage#6036

Closed
Dajamante wants to merge 54 commits into
TheAlgorithms:masterfrom
DD2480-Team:master
Closed

Feature: improve branch coverage#6036
Dajamante wants to merge 54 commits into
TheAlgorithms:masterfrom
DD2480-Team:master

Conversation

@Dajamante
Copy link
Copy Markdown

Describe your change:

closes #6020
Please see issue:

  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

ztick and others added 30 commits February 21, 2022 22:18
feat: issue #2 improves code coverage for insert_repair() from 88% to…
feat: issue #4 reduces CCN of insert_repair() by 65%
feat: issue #8 adds coverage htmls to showcase improvement
fix: added docstring test for from_sequence
fix: removed code from main to doctest
fix: added unit tests for is_palindrome.py
Increase test coverage of data_structures/binary_tree/red_black_tree.py to 92%
Also wrap the function, so the function can be triggered by parameters instead of input().
Now, if using the command "coverage run -m closest_pair_of_points", we get coverage of 100%.
Meanwhile, if using the command "coverage run -m pytest --doctest-modules closest_pair_of_points.py", we get coverage of 95%.
fix: issue #10 adjust documentation according to contribution guidelines
Adds the last (imo) reasonable test
@poyea poyea requested review from cclauss, dhruvmanila, onlinejudge95 and poyea and removed request for dhruvmanila March 16, 2022 15:37
@ghost ghost added the tests are failing Do not merge until tests pass label Mar 16, 2022
rotations necessary to maintain balance, and then returns the
new root to this subtree (likely self).
This is guaranteed to run in O(log(n)) time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +162 to +168


>>> epq2 = ElementPriorityQueue()
>>> q = [[epq2.enqueue(11)] for _ in range(101)]
Traceback (most recent call last):
...
priority_queue_using_list.OverFlowError: Maximum queue size is 100
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAILED data_structures/queue/priority_queue_using_list.py::data_structures.queue.priority_queue_using_list.ElementPriorityQueue

Comment on lines +85 to +95
>>> fpq = FixedPriorityQueue()
>>> fpq.enqueue(3, 10)
Traceback (most recent call last):
...
ValueError: Valid priorities are 0, 1, and 2
>>> fpq = FixedPriorityQueue()
>>> q = [fpq.enqueue(0,5) for _ in range(101)]
Traceback (most recent call last):
...
OverflowError: Maximum queue size is 100

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAILED data_structures/queue/priority_queue_using_list.py::data_structures.queue.priority_queue_using_list.FixedPriorityQueue

@poyea
Copy link
Copy Markdown
Member

poyea commented Mar 17, 2022

Please fix the build checks.

@stale
Copy link
Copy Markdown

stale Bot commented Apr 16, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale Used to mark an issue or pull request stale. label Apr 16, 2022
import re
from random import random

__all__ = ("re",)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this??

@stale stale Bot removed the stale Used to mark an issue or pull request stale. label Apr 16, 2022
Comment on lines +17 to +21
>>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2
2
>>> hashTable = DoubleHash(5)
>>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1
1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2
2
>>> hashTable = DoubleHash(5)
>>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1
1
>>> hashTable._hash_function_2(1, 4) # next_prime_gt = 3, return 3 - (4 % 3) = 2
2
>>> hashTable = DoubleHash(5)
>>> hashTable._hash_function_2(3, 8) # next_prime(3) = 3, return 3 - (8 % 3) = 1
1

@ghost ghost removed the awaiting reviews This PR is ready to be reviewed label Apr 16, 2022
@cclauss
Copy link
Copy Markdown
Member

cclauss commented Apr 16, 2022

All checks fail?

@SnowdenSa
Copy link
Copy Markdown

Nice work.

@stale
Copy link
Copy Markdown

stale Bot commented Jun 13, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale Used to mark an issue or pull request stale. label Jun 13, 2022
@poyea
Copy link
Copy Markdown
Member

poyea commented Jun 13, 2022

Let's fix the tests? - this would be great to have

@stale stale Bot removed the stale Used to mark an issue or pull request stale. label Jun 13, 2022
@Dajamante
Copy link
Copy Markdown
Author

I agree! I will not have time unfortunately :(. But there are two tests that are failing according to the report.
================ 2 failed, 1117 passed, 108 warnings in 32.80s =================

@poyea
Copy link
Copy Markdown
Member

poyea commented Jun 22, 2022

Yes, but maintainers do not have the edit permission, so if you could please fix those 2 issues

@stale
Copy link
Copy Markdown

stale Bot commented Jul 31, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the stale Used to mark an issue or pull request stale. label Jul 31, 2022
@stale stale Bot removed the stale Used to mark an issue or pull request stale. label Sep 14, 2022
@cclauss
Copy link
Copy Markdown
Member

cclauss commented Oct 1, 2022

In preparation for that denial-of-service attack that is Hacktoberfest, I am closing all pull requests that have failing tests.

@cclauss cclauss closed this Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files help wanted tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: improve branch coverage

8 participants