From 2c7a462f1989fd9cc55776c5433cf7ee2b62183c Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 14:24:05 +0000 Subject: [PATCH 1/9] updating DIRECTORY.md --- DIRECTORY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index 2f828aa512a9..01667c9feee8 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -419,6 +419,7 @@ * [Koch Snowflake](fractals/koch_snowflake.py) * [Mandelbrot](fractals/mandelbrot.py) * [Sierpinski Triangle](fractals/sierpinski_triangle.py) + * [Vicsek](fractals/vicsek.py) ## Fuzzy Logic * [Fuzzy Operations](fuzzy_logic/fuzzy_operations.py) @@ -678,6 +679,7 @@ * [Newton Forward Interpolation](maths/numerical_analysis/newton_forward_interpolation.py) * [Newton Raphson](maths/numerical_analysis/newton_raphson.py) * [Numerical Integration](maths/numerical_analysis/numerical_integration.py) + * [Proper Fractions](maths/numerical_analysis/proper_fractions.py) * [Runge Kutta](maths/numerical_analysis/runge_kutta.py) * [Runge Kutta Fehlberg 45](maths/numerical_analysis/runge_kutta_fehlberg_45.py) * [Runge Kutta Gills](maths/numerical_analysis/runge_kutta_gills.py) From 3a5fef8c9ef1332d98914f7ab38df4c661acded0 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:33:29 +0300 Subject: [PATCH 2/9] Enable ruff DTZ001 rule --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a69ab7aa6437..09093433a47a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule "B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME "B905", # `zip()` without an explicit `strict=` parameter -- FIX ME - "DTZ001", # The use of `datetime.datetime()` without `tzinfo` argument is not allowed -- FIX ME "DTZ005", # The use of `datetime.datetime.now()` without `tzinfo` argument is not allowed -- FIX ME "E741", # Ambiguous variable name 'l' -- FIX ME "EM101", # Exception must not use a string literal, assign to variable first From 70d71eebc0846f309e2d9efed90c088fdd9d58d3 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:38:52 +0300 Subject: [PATCH 3/9] Fix other/gauss_easter.py --- other/gauss_easter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index d1c525593f79..ebe5698ba51b 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -3,7 +3,7 @@ """ import math -from datetime import datetime, timedelta +from datetime import datetime, timedelta, UTC def gauss_easter(year: int) -> datetime: @@ -45,11 +45,11 @@ def gauss_easter(year: int) -> datetime: ) % 7 if days_to_add == 29 and days_from_phm_to_sunday == 6: - return datetime(year, 4, 19) + return datetime(year, 4, 19, tzinfo=UTC) elif days_to_add == 28 and days_from_phm_to_sunday == 6: - return datetime(year, 4, 18) + return datetime(year, 4, 18, tzinfo=UTC) else: - return datetime(year, 3, 22) + timedelta( + return datetime(year, 3, 22, tzinfo=UTC) + timedelta( days=int(days_to_add + days_from_phm_to_sunday) ) From dd48128f40e552441d8ba16793ac511b12d10d36 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:43:11 +0300 Subject: [PATCH 4/9] Fix --- other/gauss_easter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index ebe5698ba51b..10906147c6ed 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -3,7 +3,7 @@ """ import math -from datetime import datetime, timedelta, UTC +from datetime import UTC, datetime, timedelta def gauss_easter(year: int) -> datetime: From 99b880476b77b4fbf2a017389e942e6d72464b19 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:47:40 +0300 Subject: [PATCH 5/9] Fix --- other/gauss_easter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index 10906147c6ed..369d5293900a 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -11,16 +11,16 @@ def gauss_easter(year: int) -> datetime: Calculation Gregorian easter date for given year >>> gauss_easter(2007) - datetime.datetime(2007, 4, 8, 0, 0) + datetime.datetime(2007, 4, 8, 0, 0, tzinfo=UTC) >>> gauss_easter(2008) - datetime.datetime(2008, 3, 23, 0, 0) + datetime.datetime(2008, 3, 23, 0, 0, tzinfo=UTC) >>> gauss_easter(2020) - datetime.datetime(2020, 4, 12, 0, 0) + datetime.datetime(2020, 4, 12, 0, 0, tzinfo=UTC) >>> gauss_easter(2021) - datetime.datetime(2021, 4, 4, 0, 0) + datetime.datetime(2021, 4, 4, 0, 0, tzinfo=UTC) """ metonic_cycle = year % 19 julian_leap_year = year % 4 From c8098aec60513b984fb3366fb0a26610b6be9ac4 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:55:07 +0300 Subject: [PATCH 6/9] Fix --- other/gauss_easter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index 369d5293900a..aa2174ea1e2d 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -3,7 +3,7 @@ """ import math -from datetime import UTC, datetime, timedelta +from datetime import UTC, datetime, timedelta, timezone def gauss_easter(year: int) -> datetime: @@ -11,16 +11,16 @@ def gauss_easter(year: int) -> datetime: Calculation Gregorian easter date for given year >>> gauss_easter(2007) - datetime.datetime(2007, 4, 8, 0, 0, tzinfo=UTC) + datetime.datetime(2007, 4, 8, 0, 0, tzinfo=timezone.utcs) >>> gauss_easter(2008) - datetime.datetime(2008, 3, 23, 0, 0, tzinfo=UTC) + datetime.datetime(2008, 3, 23, 0, 0, tzinfo=timezone.utc) >>> gauss_easter(2020) - datetime.datetime(2020, 4, 12, 0, 0, tzinfo=UTC) + datetime.datetime(2020, 4, 12, 0, 0, tzinfo=timezone.utc) >>> gauss_easter(2021) - datetime.datetime(2021, 4, 4, 0, 0, tzinfo=UTC) + datetime.datetime(2021, 4, 4, 0, 0, tzinfo=timezone.utc) """ metonic_cycle = year % 19 julian_leap_year = year % 4 From ffdf5a0220deb1941625e803548230374820e853 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 17:58:26 +0300 Subject: [PATCH 7/9] Fix --- other/gauss_easter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index aa2174ea1e2d..3aeb8265bca3 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -11,7 +11,7 @@ def gauss_easter(year: int) -> datetime: Calculation Gregorian easter date for given year >>> gauss_easter(2007) - datetime.datetime(2007, 4, 8, 0, 0, tzinfo=timezone.utcs) + datetime.datetime(2007, 4, 8, 0, 0, tzinfo=timezone.utc) >>> gauss_easter(2008) datetime.datetime(2008, 3, 23, 0, 0, tzinfo=timezone.utc) From 5911849910628d2b2202a7371e8b0024f6112dfc Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 18:02:05 +0300 Subject: [PATCH 8/9] Fix --- other/gauss_easter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index 3aeb8265bca3..e83d55e675c8 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -3,7 +3,7 @@ """ import math -from datetime import UTC, datetime, timedelta, timezone +from datetime import UTC, datetime, timedelta def gauss_easter(year: int) -> datetime: @@ -11,16 +11,16 @@ def gauss_easter(year: int) -> datetime: Calculation Gregorian easter date for given year >>> gauss_easter(2007) - datetime.datetime(2007, 4, 8, 0, 0, tzinfo=timezone.utc) + datetime.datetime(2007, 4, 8, 0, 0, tzinfo=datetime.timezone.utc) >>> gauss_easter(2008) - datetime.datetime(2008, 3, 23, 0, 0, tzinfo=timezone.utc) + datetime.datetime(2008, 3, 23, 0, 0, tzinfo=datetime.timezone.utc) >>> gauss_easter(2020) - datetime.datetime(2020, 4, 12, 0, 0, tzinfo=timezone.utc) + datetime.datetime(2020, 4, 12, 0, 0, tzinfo=datetime.imezone.utc) >>> gauss_easter(2021) - datetime.datetime(2021, 4, 4, 0, 0, tzinfo=timezone.utc) + datetime.datetime(2021, 4, 4, 0, 0, tzinfo=datetime.timezone.utc) """ metonic_cycle = year % 19 julian_leap_year = year % 4 From e251a72c46eae025fed46b3afadc3b64c4812124 Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Wed, 20 Mar 2024 18:05:56 +0300 Subject: [PATCH 9/9] Fix --- other/gauss_easter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/gauss_easter.py b/other/gauss_easter.py index e83d55e675c8..7ccea7f5bbf0 100644 --- a/other/gauss_easter.py +++ b/other/gauss_easter.py @@ -17,7 +17,7 @@ def gauss_easter(year: int) -> datetime: datetime.datetime(2008, 3, 23, 0, 0, tzinfo=datetime.timezone.utc) >>> gauss_easter(2020) - datetime.datetime(2020, 4, 12, 0, 0, tzinfo=datetime.imezone.utc) + datetime.datetime(2020, 4, 12, 0, 0, tzinfo=datetime.timezone.utc) >>> gauss_easter(2021) datetime.datetime(2021, 4, 4, 0, 0, tzinfo=datetime.timezone.utc)