Commit Graph

337 Commits

Author SHA1 Message Date
Chris O
3a9e5fa5ec
Create a Simultaneous Equation Solver Algorithm (#8773)
* Added simultaneous_linear_equation_solver.py

* Removed Augment class, replaced with recursive functions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed edge cases

* Update settings.json

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-06-02 07:14:25 +02:00
Christian Clauss
4b79d771cd
Add more ruff rules (#8767)
* Add more ruff rules

* Add more ruff rules

* pre-commit: Update ruff v0.0.269 -> v0.0.270

* Apply suggestions from code review

* Fix doctest

* Fix doctest (ignore whitespace)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-26 09:34:17 +02:00
Christian Clauss
dd3b499bfa
Rename is_palindrome.py to is_int_palindrome.py (#8768)
* Rename is_palindrome.py to is_int_palindrome.py

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-05-26 12:20:33 +05:30
Chris O
200429fc47
Dual Number Automatic Differentiation (#8760)
* Added dual_number_automatic_differentiation.py

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update maths/dual_number_automatic_differentiation.py

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-25 08:04:42 +02:00
Rohan Saraogi
cf5e34d479
Added is_palindrome.py (#8748) 2023-05-19 11:48:22 +12:00
Rohan Saraogi
3dc143f721
Added odd_sieve.py (#8740) 2023-05-17 12:08:56 +12:00
Caeden Perelli-Harris
1faf10b5c2
Correct ruff failures (#8732)
* fix: Correct ruff problems

* updating DIRECTORY.md

* fix: Fix pre-commit errors

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-05-14 22:03:13 +01:00
Margaret
6939538a41
adding the remove digit algorithm (#6708) 2023-05-11 06:55:48 +12:00
Dipankar Mitra
c1b3ea5355
The tanh activation function is added (#8689)
* tanh function been added

* tanh function been added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tanh function is added

* tanh function is added

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* tanh function added

* tanh function added

* tanh function is added

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2023-04-25 18:06:14 +02:00
JulianStiebler
11582943a5
Create maths/pi_generator.py (#8666)
* Create pi_generator.py

* Update pi_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pi_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pi_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pi_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update pi_generator.py

* Update pi_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated commentary on line 28, added math.pi comparison & math.isclose() test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed  # noqa: E501

* printf() added as recommended by cclaus

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-18 11:57:48 +02:00
Christian Clauss
521fbca61c
Replace flake8 with ruff (#8184) 2023-03-16 13:31:29 +01:00
Christian Clauss
c96241b5a5
Replace bandit, flake8, isort, and pyupgrade with ruff (#8178)
* Replace bandit, flake8, isort, and pyupgrade with ruff

* Comment on ruff rules

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-03-15 13:58:25 +01:00
Christian Clauss
64543faa98
Make some ruff fixes (#8154)
* Make some ruff fixes

* Undo manual fix

* Undo manual fix

* Updates from ruff=0.0.251
2023-03-01 17:23:33 +01:00
Christian Clauss
c909da9b08
pre-commit: Upgrade psf/black for stable style 2023 (#8110)
* pre-commit: Upgrade psf/black for stable style 2023

Updating https://github.com/psf/black ... updating 22.12.0 -> 23.1.0 for their `2023 stable style`.
* https://github.com/psf/black/blob/main/CHANGES.md#2310

> This is the first [psf/black] release of 2023, and following our stability policy, it comes with a number of improvements to our stable style…

Also, add https://github.com/tox-dev/pyproject-fmt and https://github.com/abravalheri/validate-pyproject to pre-commit.

I only modified `.pre-commit-config.yaml` and all other files were modified by pre-commit.ci and psf/black.

* [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>
2023-02-01 18:44:54 +05:30
Caeden Perelli-Harris
c00af459fe
feat: Concatenate both factorial implementations (#8099)
* feat: Concatenate both factorial implementations

* fix: Rename factorial recursive method
2023-01-26 08:12:11 +01:00
MohammadReza Balakhaniyan
1a27258bd6
gcd_of_n_numbers (#8057)
* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add maths/Gcd of N Numbers

* add maths/Gcd of N Numbers

* more pythonic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* more pythonic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* merged

* merged

* more readable

* [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>
2023-01-10 23:47:02 +01:00
Caeden Perelli-Harris
4939e8463f
Create cached fibonacci algorithm (#8084)
* feat: Add `fib_recursive_cached` func

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* doc: Show difference in time when caching algorithm

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-07 17:56:39 +01:00
Tianyi Zheng
7c1d23d448
Change prime_sieve_eratosthenes.py to return list (#8062) 2023-01-02 14:10:59 +13:00
Tianyi Zheng
b72d0681ec
Remove extra imports in gamma.py doctests (#8060)
* Refactor bottom-up function to be class method

* Add type hints

* Update convolve function namespace

* Remove depreciated np.float

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* updating DIRECTORY.md

* Renamed function for consistency

* updating DIRECTORY.md

* Remove extra imports in gamma.py doctests

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
2022-12-29 18:06:26 +01:00
Aaryan Raj
b25915adf9
Add algorithm to convert decimal number to its simplest fraction form (#8001)
* Added algorithm to convert decimal number to its simplest fraction form

* Apply suggested changes
2022-12-11 08:04:04 +01:00
Akshay Dubey
5654c6242e
algorithm: Hexagonal number (#8003)
* feat: Add hexagonal number

* [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>
2022-11-29 19:29:21 +01:00
Mark Mayo
f32d611689
clean of unnecessary checks, imports, calls (#7993) 2022-11-21 00:00:27 +13:00
Akshay Dubey
b33ea81a74
algorithm: Add juggler sequence (#7985)
* feat: Add juggler sequence

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: Remove temp variable

* refactor: Change error type for negative numbers

* refactor: Remove # doctest: +NORMALIZE_WHITESPACE

* refactor: Remove int typecasting

* test: Add unit tests for n=10 and n=25

* [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>
2022-11-18 09:18:47 +01:00
Akshay Dubey
4ce8ad9ce6
algorithm: Liouville lambda function (#7986)
* feat: Add liouville lambda function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: Refactor if-else block

* refactor: Refactor error handling for -ve numbers

* refactor: Remove # doctest: +NORMALIZE_WHITESPACE

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-15 18:28:49 +01:00
Akshay Dubey
e1be882f72
algorithm: Twin prime (#7980)
* feat: Add twin prime algorithm

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: Fix broken import statement

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-10 11:55:50 +01:00
Christian Clauss
5c92b7390e
prime_numbers.py: Tighten up the benchmarks (#7976)
* prime_numbers.py: Tighten up the benchmarks

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-11-10 15:42:14 +13:00
Akshay Dubey
076193eefa
feat: Add pronic number implementation (#7979)
* feat: Add pronic number implementation

* [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>
2022-11-10 15:39:47 +13:00
Akshay Dubey
3f9aae149d
feat: Add automorphic number implementation (#7978)
* feat: Add automorphic number implementation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: Add type checking for number

* refactor: Rename variable n to number

* test: Add doctest

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* test: Add unit  test for number=0

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-09 16:36:38 +01:00
Christian Clauss
6aaf0a2c77
maths/number_of_digits.py: Streamline benchmarks (#7913)
* maths/number_of_digits.py: Streamline benchmarks

```
num_digits(262144): 6 -- 0.2226011250168085 seconds
num_digits_fast(262144): 6 -- 0.13145116699161008 seconds
num_digits_faster(262144): 6 -- 0.09273383300751448 seconds

num_digits(1125899906842624): 16 -- 0.6056742920191027 seconds
num_digits_fast(1125899906842624): 16 -- 0.15698366600554436 seconds
num_digits_faster(1125899906842624): 16 -- 0.1027024170034565 seconds

num_digits(1267650600228229401496703205376): 31 -- 1.1957934170495719 seconds
num_digits_fast(1267650600228229401496703205376): 31 -- 0.15552304196171463 seconds
num_digits_faster(1267650600228229401496703205376): 31 -- 0.13062308297958225 seconds
```

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update number_of_digits.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-08 11:49:47 +00:00
Caeden Perelli-Harris
daa1c7529a
Raise error not string (#7945)
* ci: Add `B023` to `.flake8` ignores

* refactor: Return `bool`/raise Exception

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert: Remove previous branch commit

* Update data_structures/binary_tree/segment_tree_other.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* feat: Apply `__repr__` changes

* chore: Fix failing tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update data_structures/binary_tree/segment_tree_other.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* test: Fix doctests

* random.choice(population_score[:N_SELECTED])[0]

* Update basic_string.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-11-06 15:54:44 +01:00
Sanders Lin
51708530b6
Update 3n_plus_1.py (#7966)
* Update 3n_plus_1.py

1. Minor issue with ValueError message: Given integer should be positive, not greater than 1, as 1 is allowed.
2. += calls underlying list extend method which might be slower. Calling apend seems more appropriate.

* [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>
2022-11-06 10:35:40 +01:00
Christian Clauss
d23e709aea
maths/sum_of_digits.py: Streamline benchmarks (#7914)
* maths/sum_of_digits.py: Streamline benchmarks

```
sum_of_digits(262144): 19 -- 0.3128329170285724 seconds
sum_of_digits_recursion(262144): 19 -- 0.34008108399575576 seconds
sum_of_digits_compact(262144): 19 -- 0.6086010000435635 seconds

sum_of_digits(1125899906842624): 76 -- 0.8079068749793805 seconds
sum_of_digits_recursion(1125899906842624): 76 -- 0.8435653329943307 seconds
sum_of_digits_compact(1125899906842624): 76 -- 1.247976207989268 seconds

sum_of_digits(1267650600228229401496703205376): 115 -- 1.6441589999594726 seconds
sum_of_digits_recursion(1267650600228229401496703205376): 115 -- 1.713684624992311 seconds
sum_of_digits_compact(1267650600228229401496703205376): 115 -- 2.2197747920290567 seconds
```

* updating DIRECTORY.md

* Update sum_of_digits.py

* Update sum_of_digits.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-11-01 14:07:11 +01:00
Caeden Perelli-Harris
7d139ee7f1
refactor(abs): Condense abs_min and abs_max (#7881)
* refactor(abs): Condense `abs_min` and `abs_max`

* [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>
2022-11-01 07:50:43 +01:00
Paradact
7addbccee7
Torus volume (#7905)
* Added Torus volume algorithm

* Updated Torus volume for simplicity (removed ref to vol_sphere())

* Refactoring

* [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>
2022-11-01 10:51:45 +13:00
Paradact
6c15f526e5
Added Torus surface area (#7906)
* Added Torus surface area

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed error in test

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-01 10:50:50 +13:00
Shriyans Gandhi
ded5deabe9
Dodecahedron surface area and volume (#6606)
* Hexagonal number sequence 

A hexagonal number sequence is a sequence of figurate numbers where the nth hexagonal number hₙ is the number of distinct dots in a pattern of dots consisting of the outlines of regular hexagons with sides up to n dots, when the hexagons are overlaid so that they share one vertex.

This program returns the hexagonal number sequence of n length.

* Update hexagonalnumbers.py

* Update hexagonalnumbers.py

* Update hexagonalnumbers.py

* Update hexagonalnumbers.py

* Update and rename hexagonalnumbers.py to hexagonal_numbers.py

* Length must be a positive integer

* Create dodecahedron.py

* Update dodecahedron.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dodecahedron.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dodecahedron.py

* Update dodecahedron.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dodecahedron.py

* Update dodecahedron.py

* Apply suggestions from code review

Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

* Update dodecahedron.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Paul <56065602+ZeroDayOwl@users.noreply.github.com>
2022-10-31 18:15:37 +01:00
himanshit0304
f8958ebe20
Add print_multiplication_table.py (#6607)
* Add print_multiplication_table.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added return type description

* Update print_multiplication_table.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 23:55:11 +01:00
kumarsurajsk
2c65597093
addition_without_arithmetic (#6830)
* Addition_without_arithmetic

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added_param

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added_param_in_first_sec

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* change_align

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update Addition_without_arithmetic.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Rename Addition_without_arithmetic.py to addition_without_arithmetic.py

* Update addition_without_arithmetic.py

* Update addition_without_arithmetic.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 13:52:37 +01:00
Lukas Esc
cafbbab125
shortened code using abs() and inplace ops (#7191)
n = -n if n < 0 else n --> n = abs(n)
n = n // 10 --> n //= 10
2022-10-30 11:56:54 +01:00
Emmanuel Bauma Murairi
b5d7f186f4
Polynomial (#6745)
* implement function to handle polynomial operations

* edit documentation

* fix type hint and linter errors

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix short variable name

* fix spelling

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 11:52:50 +01:00
happiestbee
00fc53de97
added sumset.py Fixes: #{6563} (#6742)
* Create sumset.py

* updating DIRECTORY.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add descriptive var names

* Update maths/sumset.py

Co-authored-by: Caeden <caedenperelliharris@gmail.com>

* Update sumset.py

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-30 11:49:05 +01:00
Carlos Villar
17d93cab78
Added Manhattan distance algorithm (#7790)
* Added Manhattan distance algorithm, Fixes: #7776

* Forgot that isinstance can accept a tuple

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update manhattan_distance.py

* Update manhattan_distance.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-30 10:00:47 +01:00
Andrey
584e743422
Fix yesqa hook (#7843)
* fix yesqa hook

* Remove redundant noqa

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-29 15:07:02 +02:00
Kuldeep Borkar
3a671b57a2
Implemented Swish Function (#7357)
* Implemented Swish Function

* Added more description and return hint in def

* Changed the name and added more descrition including test for sigmoid function

* Added * in front of links
2022-10-28 16:27:16 +02:00
Caeden Perelli-Harris
61eedc16c3
Remove useless code in doctests (#7733)
* refactor: Fix matrix display deprecation

* refactor: Remove useless `print` and `pass` statements

* revert: Replace broken doctests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert: Fix failing doctests

* chore: Satisfy pre-commit

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-27 22:52:00 +02:00
Alexandre Velloso
501a1cf0c7
Remove unnecessary else statement (#7759)
* Remove unnecessary else statement

* [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>
2022-10-27 22:51:14 +02:00
Matteo Messmer
71e8ed81ae
Added spheres union (#6879)
* Spheres union

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update volume.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update volume.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* f-strings

* Update maths/volume.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* more tests

* fix non negative

* fix 0 radius

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix tests

* fix print

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix comment

* fix comment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update volume.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>
Co-authored-by: Christian Clauss <cclauss@me.com>
2022-10-27 19:45:58 +02:00
Caeden Perelli-Harris
9bba42eca8
refactor: Indent ... for visual purposes (#7744) 2022-10-27 19:42:30 +02:00
Mislah
505c5e20fa
Included area of n sided regular polygon (#7438)
* Included area of n sided regular polygon 

Added a function to calculate the area of n sided regular polygons

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* code standard fixes as per PR comments

* [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>
2022-10-26 00:26:05 +02:00
Tianyi Zheng
d25187eb7f
Remove type cast in combinations algorithm (#7607)
* Remove commented-out print statements in algorithmic functions

* Encapsulate non-algorithmic code in __main__

* Remove unused print_matrix function

* Remove print statement in __init__

* Remove print statement from doctest

* Encapsulate non-algorithmic code in __main__

* Modify algorithm to return instead of print

* Encapsulate non-algorithmic code in __main__

* Refactor data_safety_checker to return instead of print

* updating DIRECTORY.md

* updating DIRECTORY.md

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updating DIRECTORY.md

* Remove int cast and change float division to int division

* Move new-line chars

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-25 22:34:46 +02:00