* Added morphological operations, fixes: #5197
* Added dilation tests and type hints
* Added erosion tests and type hints
* fixes: TheAlgorithms#5197
* fixes: TheAlgorithms#5197
* Update erosion_operation.py
* made suggested changes in dilation
* made suggested changes in erosion
* made suggested changes in dilation
* removed extra spaces in the tests
* removed extra spaces in the tests
* improved readability of the existing method by reformatting, adding documentations with doctests.
* improved readability of the existing method by reformatting, adding documentations with doctests.
* fixed typo in test
* added doctest to parse dictionary method
* added doctest to parse dictionary method
* Changed return type, removed print() from method and implemented doctests as suggested
* Fixed doctest error, removed print() from method, created new script as suggested
* Update get_imdbtop.py
* Fix typo discovered by codespell
* return ()
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added new script to open the google image tab with a search query.
* Added new script to open the google image tab with a search query.
* Added new script to open the google image tab with a search query with doctests.
* Fixed doctest error, removed print() from method, changed return type
* Update web_programming/show_image_tab_from_google_query.py
using iterators instead of lists
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update web_programming/show_image_tab_from_google_query.py
Improve readability by removing one-time used variable
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update web_programming/show_image_tab_from_google_query.py
Decreasing complication through standard practices.
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update web_programming/show_image_tab_from_google_query.py
Exception Handling
Co-authored-by: Christian Clauss <cclauss@me.com>
* changed complete method to download images from google search query
* Update download_images_from_google_query.py
* Delete show_image_tab_from_google_query.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* matching algorithm for min vertex cover problem
* fixed hint on row 37
* changed variable names
* provided doctest for get_edges function
* Removed dict.keys() iteration
* Update matching_min_vertex_cover.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* added complete graph generator function
* added doctest, type hints, wikipedia explanation
* added return type hint for function complete_graph
* added descriptive name for the parameter: n
* random graph generator with doctest and type hints
* added Greedy min vertex algorithm
* pre-commit hook(s) made changes
* Delete complete_graph_generator.py
* Delete random_graph_generator.py
* fixed doctest
* updated commit following highligths
* fixed following pre-commit highlights
* modified variables names
* Add Proth number to maths
* Add test for 0 and more informative output
* Fixing test failure issue - unused variable
* Update proth_number.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Magnitude and Angle
Core function to find Magnitude and Angle of two Given Vector
* Magnitude and Angle with Doctest
added Doctest to the functions
* Update linear_algebra/src/lib.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update linear_algebra/src/lib.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Changes done
and Magnitude and Angle Issues
* black
* Modified Euler's Method
Adding Modified Euler's method, which was the further change to a Euler method and known for better accuracy to the given value
* Modified Euler's Method (changed the typing of function)
Modified function is used for better accuracy
* Link added
Added link to an explanation as per Contributions Guidelines
* Resolving Pre-Commit error
* Pre-Commit Error Resolved
* Pre-Commit Error import statement Change
* Removed Import Math
* import math built issue
* adding space pre-commit error
* statement sorter for doc
Co-authored-by: Christian Clauss <cclauss@me.com>
* Magnitude and Angle
Core function to find Magnitude and Angle of two Given Vector
* Magnitude and Angle with Doctest
added Doctest to the functions
* Update linear_algebra/src/lib.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Update linear_algebra/src/lib.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Changes done
and Magnitude and Angle Issues
* black
Co-authored-by: Christian Clauss <cclauss@me.com>
* [mypy] fix type annotations for problem003/sol1 and problem003/sol3
* [mypy] fix type annotations for project euler problem007/sol2
* [mypy] fix type annotations for project euler problem008/sol2
* [mypy] fix type annotations for project euler problem009/sol1
* [mypy] fix type annotations for project euler problem014/sol1
* [mypy] fix type annotations for project euler problem 025/sol2
* [mypy] fix type annotations for project euler problem026/sol1.py
* [mypy] fix type annotations for project euler problem037/sol1
* [mypy] fix type annotations for project euler problem044/sol1
* [mypy] fix type annotations for project euler problem046/sol1
* [mypy] fix type annotations for project euler problem051/sol1
* [mypy] fix type annotations for project euler problem074/sol2
* [mypy] fix type annotations for project euler problem080/sol1
* [mypy] fix type annotations for project euler problem099/sol1
* [mypy] fix type annotations for project euler problem101/sol1
* [mypy] fix type annotations for project euler problem188/sol1
* [mypy] fix type annotations for project euler problem191/sol1
* [mypy] fix type annotations for project euler problem207/sol1
* [mypy] fix type annotations for project euler problem551/sol1
* Algorithm Optimized
* Update divide_and_conquer/inversions.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update divide_and_conquer/inversions.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update divide_and_conquer/inversions.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* added carrier concentrations algorithm
* Add more references
Added more references to the carrier concentrations file
* Update electronics/carrier_concentration.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update electronics/carrier_concentration.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
Conjunctive adverbs should be followed by a comma.
For more details, kindly refer:
https://www.aje.com/arc/editing-tip-commas-conjunctive-adverbs/
Separate out the labels into two rows
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
* Added Julia sets drawing
* Forgot the .py extension
* Update julia_sets.py
Added online sources for comparison.
Added more examples of fractal Julia sets.
Added all type hints.
Only show one picture
Silented RuntuleWarning's (there's no way of avoiding them and they're not an issue per se)
* Added doctest example for "show_results"
* Filtering Nan's and infinites
* added 1 missing type hint
* in iterate_function, convert to dtype=complex64
* RuntimeWarning (fine) filtering
* Type hint, test for ignore_warnings function, typo in header
* Update julia_sets.py
Type of expected output value for iterate function int array -> complex array (throws an error on test)
* Update julia_sets.py
- More accurate type for tests cases in eval_quadratic_polynomial and iterate_function
- added more characters for variables c & z in eval_quadratic_polynomial and eval_exponential to silent bot warnings
* Function def formatting
Blocked by black
* Update julia_sets.py
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* added more doctests for eval_exponential
* Update fractals/julia_sets.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Update and rename check_valid_ip_address.py to is_ip_v4_address_valid.py
New test cases that the algorithm must detect:
* [ ] an octet much bigger than 255
* [ ] an octet is negative
* [ ] number of octets is less than 4
* [ ] number of octets is greater than 4
* [ ] an octet is a letter
* updating DIRECTORY.md
* Add two more tests to is_ip_v4_address_valid.py
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* mypy --install-types --non-interactive .
@dhruvmanila Is this useful/needed given that we do not pin our dependencies?
https://mypy-lang.blogspot.com/2021/06/mypy-0910-released.html
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* added gamma_function
* Add files via upload
* Resolved issue with str.format
And also changed output to math notation
* Update gamma_function.py
* Rename physics/gamma_function.py to maths/gamma_recursive.py
* Fixes: #4709 Fixed issues for pre-commit test
* Fixes: #4709 solved issues with doctests
And comments
* Fixes: #4709 Added failed tests to doctest
* Align with Python's Standard Library math.gamma()
Replicate the exceptions of https://docs.python.org/3/library/math.html#math.gamma
* Update gamma_recursive.py
* Update gamma_recursive.py
* Update gamma_recursive.py
* Update gamma_recursive.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Added Dutch national flag sort Algorithm
* Changed file name to dnf_sort.py
* Added descriptive name and type hint
Added descriptive name and type hint for parameter with doctest for the function dnf_sort.
* Added test cases
* Added doctest cases
* Update sorts/dnf_sort.py
* Added doctest for dutch_national_flag_sort sorts/dnf_sort.py
* Update sorts/dnf_sort.py
* Added doctest for the function
dutch_national_flag_sort
* update file as per black code formatter
* Update dnf_sort.py
* Update and rename dnf_sort.py to dutch_national_flag_sort.py
Co-authored-by: Christian Clauss <cclauss@me.com>
* Approve functions used as default argumenets
* The default value for **seed** is the result of a function call
The default value for **seed** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `LinearCongruentialGenerator.__init__()` will only be called once per instance and it ensures that each instance will generate a unique sequence of numbers.
* The default value for **backend** is the result of a function call
The default value for **backend** is the result of a function call which is not normally recommended and causes flake8-bugbear to raise a B008 error. However, in this case, it is accptable because `Aer.get_backend()` is called when the function is definition and that same backend is then reused for function calls.
* Update linear_congruential_generator.py
* Update ripple_adder_classic.py
* Update ripple_adder_classic.py
* Update ripple_adder_classic.py
* Update ripple_adder_classic.py
* Update ripple_adder_classic.py