* updating DIRECTORY.md
* Fix mypy errors in erosion_operation.py
* Rename functions to use snake case
* updating DIRECTORY.md
* updating DIRECTORY.md
* Replace raw file string with pathlib Path
* Fix function name in erosion_operation.py doctest
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* feat(maths): add function to perform calculation
- Add single function to calculate sum of two positive numbers
using bitwise operator
* docs: add wikipedia url as explanation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
* Update sum_of_two_positive_numbers_bitwise.py
---------
Co-authored-by: Okza Pradhana <okzapradhana@azko-macbook.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
* Create coulomb_law.py
* Update coulomb_law.py
* Update coulomb_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update and rename coulomb_law.py to coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update coulombs_law.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update xgboost_regressor.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* Replaced loops in jacobi_iteration_method function with vector operations. That gives a reduction in the time for calculating the algorithm.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Delete main.py
* Update jacobi_iteration_method.py
Changed a line that was too long.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Changed the type of the returned list as required.
* Update jacobi_iteration_method.py
Replaced init_val with new_val.
* Update jacobi_iteration_method.py
Fixed bug: init_val: list[int] to list[float].
Since the numbers are fractional: init_val = [0.5, -0.5, -0.5].
* Update jacobi_iteration_method.py
Changed comments, made variable names more understandable.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
left the old algorithm commented out, as it clearly shows what is being done.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update jacobi_iteration_method.py
Edits upon request.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* added addAtPosition to simple linked list
* added addAtPosition to simple linked list
* modified the add function to take an optional position command
* fixed type safety errors:
* fixed type safety errors:
* fixed type safety errors:
* fixed type safety errors:
* fixed size error
* fixed size error
* added doctest and updates the else after checking if posiiton argument less than 0 or not
* added doctest and updates the else after checking if posiiton argument less than 0 or not
* fixed the contributing.md mistake
* added doctest for out of bounds position value, both negative and positive
* Added Scaled Exponential Linear Unit Activation Function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update scaled_exponential_linear_unit.py
* Update scaled_exponential_linear_unit.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create haralick_descriptors
* Working on creating Unit Testing for Haralick Descriptors module
* Type hinting for Haralick descriptors
* Fixed docstrings, unit testing and formatting choices
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fixed line size formatting
* Added final doctests
* Changed main callable
* Updated requirements.txt
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update computer_vision/haralick_descriptors.py
No! What if the Kernel is empty?
Example:
>>> kernel = np.zeros((1))
>>> kernel or np.ones((3, 3))
array([[1., 1., 1.],
[1., 1., 1.],
[1., 1., 1.]])
Co-authored-by: Christian Clauss <cclauss@me.com>
* Undone wrong commit
* Update haralick_descriptors.py
* Apply suggestions from code review
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix ruff errors in haralick_descriptors.py
* Add type hint to haralick_descriptors.py to fix ruff error
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Update haralick_descriptors.py
* Try to fix mypy errors in haralick_descriptors.py
* Update haralick_descriptors.py
* Fix type hint in haralick_descriptors.py
---------
Co-authored-by: Rafael Zimmer <rzimmerdev@monmo.localdomain>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Style sigmoid function in harmony with pep guideness
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Updated postfix_evaluation.py to support Unary operators and floating point numbers Fixes#8754 and #8724
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Updated postfix_evaluation.py to support Unary operators and floating point numbers. Fixes#8754 and formatted code to pass ruff and black test.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724 and made sure it passes doctest
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Fixed return type hinting required by pre commit for evaluate function
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Changed line 186 to return only top of stack instead of calling the get_number function as it was converting float values to int, resulting in data loss. Fixes#8754 and #8724
Signed-off-by: Arijit De <arijitde2050@gmail.com>
* Made the requested changes
Also changed the code to make the evaluate function first convert all the numbers and then process the valid expression.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator.
* Fixes#8754, #8724 Updated the parse_token function of postfix_evaluation.py
ostfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator and invalid expression.
* Fixes#8754, #8724 Updated postfix_evaluation.py
postfix_evaluation.py now supports Unary operators and floating point numbers.
Also merged evaluate_postfix_notations.py and postfix_evaluation.py into postfix_evaluation.py which fixes#8724. Added a doctest example with unary operator and invalid expression.
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
* Update postfix_evaluation.py
---------
Signed-off-by: Arijit De <arijitde2050@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* use np.dot
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* further improvements using array slicing
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Update arc_length.py
Wrote the output of testcase
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update arc_length.py
Added the requested changes
* Update arc_length.py
followed the change request
* Update arc_length.py
followed suggestions
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Octal to Binary Convert
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* mention return type
* code scratch
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* mentioned return type
* remove comment
* added documention and some test cases
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* add another test case
* fixes documention
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Documention and test cases added
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* documention problem solved
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* error in exit 1
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
---------
Co-authored-by: BamaCharanChhandogi <b.c.chhandogi@gmailcom>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* Move and reimplement convert_number_to_words.py
- Move convert_number_to_words.py from web_programming/ to conversions/
- Reimplement the algorithm from scratch because the logic was very
opaque and too heavily nested
- Add support for the Western numbering system (both short and long)
because the original implementation only supported the Indian
numbering system
- Add extensive doctests and error handling
* updating DIRECTORY.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add doctests to continued_fraction.py for 0 and neg nums
* Fix continued_fraction.py to work for negative nums
Fix continued_fraction.py to work for negative nums by replacing int() call with floor()
* Move comment in doctest
* updating DIRECTORY.md
* fix(get-top-billionaires): Handle timestamp before epoch
* updating DIRECTORY.md
* revert(pyproject): Re-implement ignore lru_cache
* fix(age): Update age to current year
* fix(doctest): Make years since dynamic
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* changes to accommodate special case
* changed n_slack calculation method
* fix precommit typehints
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* n_art_vars inputs
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: docstrings and typehints
* fix: doctest issues when running code
* additional check and doctests
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix ruff
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix whitespace
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* rsa key doctest
* move doctest to module docstring
* all tests to doctest
* moved is_right to property
* is right test
* fixed rsa doctest import
* Test error when deleting non-existing element
* fixing ruff EM102
* convert property 'is_right' to one-liner
Also use 'is' instead of '=='
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* child instead of children
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* remove type hint
* Update data_structures/binary_tree/binary_search_tree.py
---------
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
* fix: typo
#8770
* refactor: delete unnecessary continue
* add test grids
* fix: add \_\_eq\_\_ in Node class
#8770
* fix: delete unnecessary code
- node in self.open_nodes is always better node
#8770
* fix: docstring
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix: docstring max length
* refactor: get the successors using a list comprehension
* Apply suggestions from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>