From 1bdf3b27fa630c66a70cc1bc74674074b626cf9b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Oct 2022 09:31:32 +0200 Subject: [PATCH 01/18] Test on Python 3.11 release candidate 2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8481b962a256..95d7addd296a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.x + python-version: 3.11-dev - uses: actions/cache@v3 with: path: ~/.cache/pip From 4c375c12c9ed0a794bdce9fb8cd144fc82e407f3 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 06:18:47 +0200 Subject: [PATCH 02/18] tensorflow; python<3.11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 294494acf41a..64ea31afad9c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ requests sklearn statsmodels sympy -tensorflow +tensorflow; python<3.11 texttable tweepy xgboost From c1d7a42b08aeb39ff6b7e75925504abd283f8714 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 06:21:09 +0200 Subject: [PATCH 03/18] tensorflow; python_version < 3.11 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 64ea31afad9c..519a2363aa7d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ requests sklearn statsmodels sympy -tensorflow; python<3.11 +tensorflow; python_version < 3.11 texttable tweepy xgboost From 71e8d5fa970580be1caceaadbcd128493bd40446 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 06:23:50 +0200 Subject: [PATCH 04/18] tensorflow; python_version < "3.11" --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 519a2363aa7d..d1731d94b0fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ requests sklearn statsmodels sympy -tensorflow; python_version < 3.11 +tensorflow; python_version < "3.11" texttable tweepy xgboost From ff30c4d4251ac1695f4436f4361dc68e3050ba3a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 06:51:10 +0200 Subject: [PATCH 05/18] sympy, tensorflow; python_version < "3.11" --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d1731d94b0fe..490d4d6ed5c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ requests # scikit-fuzzy # Causing broken builds sklearn statsmodels -sympy +sympy; python_version < "3.11" tensorflow; python_version < "3.11" texttable tweepy From b74a60a9668638fb63472ddb8972b7f4a64632af Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 07:26:14 +0200 Subject: [PATCH 06/18] sklearn; python_version < "3.11" --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 490d4d6ed5c6..ff5f0471ae53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ pillow qiskit requests # scikit-fuzzy # Causing broken builds -sklearn +sklearn; python_version < "3.11" statsmodels sympy; python_version < "3.11" tensorflow; python_version < "3.11" From b8de60916501279cad3ca955e9902576923f5e54 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 07:41:21 +0200 Subject: [PATCH 07/18] matplotlib, pandas, qiskit --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index ff5f0471ae53..d4f0a6fef508 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,15 +2,15 @@ beautifulsoup4 fake_useragent keras lxml -matplotlib +matplotlib; python_version < "3.11" numpy opencv-python -pandas +pandas; python_version < "3.11" pillow -qiskit +qiskit; python_version < "3.11" requests # scikit-fuzzy # Causing broken builds -sklearn; python_version < "3.11" +sklearn statsmodels sympy; python_version < "3.11" tensorflow; python_version < "3.11" From 21a807e5df430eaea4bb17ce3960483492b17b4f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 07:58:42 +0200 Subject: [PATCH 08/18] statsmodels; python_version < "3.11" --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d4f0a6fef508..25468cc4cc5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ beautifulsoup4 fake_useragent keras lxml -matplotlib; python_version < "3.11" +matplotlib numpy opencv-python pandas; python_version < "3.11" @@ -11,7 +11,7 @@ qiskit; python_version < "3.11" requests # scikit-fuzzy # Causing broken builds sklearn -statsmodels +statsmodels; python_version < "3.11" sympy; python_version < "3.11" tensorflow; python_version < "3.11" texttable From d0dfc6d70406edbf290a835c497ee5a6686603dd Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 08:18:11 +0200 Subject: [PATCH 09/18] Bring back Pandas --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 25468cc4cc5a..94765225d785 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ lxml matplotlib numpy opencv-python -pandas; python_version < "3.11" +pandas pillow qiskit; python_version < "3.11" requests From 5f6f0b08b8802fb0c034b643d116362736f58634 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 9 Oct 2022 08:40:58 +0200 Subject: [PATCH 10/18] Problem deps are qiskit, statsmodels, and tensorflow --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 94765225d785..bdb743e27b4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ requests # scikit-fuzzy # Causing broken builds sklearn statsmodels; python_version < "3.11" -sympy; python_version < "3.11" +sympy tensorflow; python_version < "3.11" texttable tweepy From 3640c613d41655250fe43bb1b25fb1d07bf8b915 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Wed, 26 Oct 2022 15:31:03 +0000 Subject: [PATCH 11/18] updating DIRECTORY.md --- DIRECTORY.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index 3e722a8784e5..9c4f55e9c241 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -56,8 +56,13 @@ ## Boolean Algebra * [And Gate](boolean_algebra/and_gate.py) + * [Nand Gate](boolean_algebra/nand_gate.py) * [Norgate](boolean_algebra/norgate.py) + * [Not Gate](boolean_algebra/not_gate.py) + * [Or Gate](boolean_algebra/or_gate.py) * [Quine Mc Cluskey](boolean_algebra/quine_mc_cluskey.py) + * [Xnor Gate](boolean_algebra/xnor_gate.py) + * [Xor Gate](boolean_algebra/xor_gate.py) ## Cellular Automata * [Conways Game Of Life](cellular_automata/conways_game_of_life.py) @@ -288,6 +293,7 @@ * [Iterating Through Submasks](dynamic_programming/iterating_through_submasks.py) * [Knapsack](dynamic_programming/knapsack.py) * [Longest Common Subsequence](dynamic_programming/longest_common_subsequence.py) + * [Longest Common Substring](dynamic_programming/longest_common_substring.py) * [Longest Increasing Subsequence](dynamic_programming/longest_increasing_subsequence.py) * [Longest Increasing Subsequence O(Nlogn)](dynamic_programming/longest_increasing_subsequence_o(nlogn).py) * [Longest Sub Array](dynamic_programming/longest_sub_array.py) @@ -298,6 +304,7 @@ * [Minimum Coin Change](dynamic_programming/minimum_coin_change.py) * [Minimum Cost Path](dynamic_programming/minimum_cost_path.py) * [Minimum Partition](dynamic_programming/minimum_partition.py) + * [Minimum Squares To Represent A Number](dynamic_programming/minimum_squares_to_represent_a_number.py) * [Minimum Steps To One](dynamic_programming/minimum_steps_to_one.py) * [Optimal Binary Search Tree](dynamic_programming/optimal_binary_search_tree.py) * [Rod Cutting](dynamic_programming/rod_cutting.py) @@ -474,6 +481,7 @@ * [Add](maths/add.py) * [Aliquot Sum](maths/aliquot_sum.py) * [Allocation Number](maths/allocation_number.py) + * [Arc Length](maths/arc_length.py) * [Area](maths/area.py) * [Area Under Curve](maths/area_under_curve.py) * [Armstrong Numbers](maths/armstrong_numbers.py) @@ -609,7 +617,9 @@ ## Matrix * [Binary Search Matrix](matrix/binary_search_matrix.py) * [Count Islands In Matrix](matrix/count_islands_in_matrix.py) + * [Cramers Rule 2X2](matrix/cramers_rule_2x2.py) * [Inverse Of Matrix](matrix/inverse_of_matrix.py) + * [Largest Square Area In Matrix](matrix/largest_square_area_in_matrix.py) * [Matrix Class](matrix/matrix_class.py) * [Matrix Operation](matrix/matrix_operation.py) * [Max Area Of Island](matrix/max_area_of_island.py) @@ -657,6 +667,7 @@ ## Physics * [Casimir Effect](physics/casimir_effect.py) * [Horizontal Projectile Motion](physics/horizontal_projectile_motion.py) + * [Kinetic Energy](physics/kinetic_energy.py) * [Lorentz Transformation Four Vector](physics/lorentz_transformation_four_vector.py) * [N Body Simulation](physics/n_body_simulation.py) * [Newtons Law Of Gravitation](physics/newtons_law_of_gravitation.py) @@ -1048,6 +1059,7 @@ * [Hamming Distance](strings/hamming_distance.py) * [Indian Phone Validator](strings/indian_phone_validator.py) * [Is Contains Unique Chars](strings/is_contains_unique_chars.py) + * [Is Isogram](strings/is_isogram.py) * [Is Palindrome](strings/is_palindrome.py) * [Is Pangram](strings/is_pangram.py) * [Is Spain National Id](strings/is_spain_national_id.py) From a9bdb8b5c413dfcb94dab1b17ada5bb5bbd804b7 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 12:37:36 +0100 Subject: [PATCH 12/18] python-version: 3.11-dev --> 3.11 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 95d7addd296a..0ef146d0e136 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.11-dev + python-version: 3.11 - uses: actions/cache@v3 with: path: ~/.cache/pip From a2a4b3a68d5612e068f2197d2a18da7f257eecdf Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Mon, 31 Oct 2022 11:54:14 +0000 Subject: [PATCH 13/18] updating DIRECTORY.md --- DIRECTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index be3a121c80bd..0b0d1e6a7c9d 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -328,6 +328,7 @@ * [Electric Conductivity](electronics/electric_conductivity.py) * [Electric Power](electronics/electric_power.py) * [Electrical Impedance](electronics/electrical_impedance.py) + * [Ind Reactance](electronics/ind_reactance.py) * [Ohms Law](electronics/ohms_law.py) * [Resistor Equivalence](electronics/resistor_equivalence.py) * [Resonant Frequency](electronics/resonant_frequency.py) From 58f6b1ecf0bf96295f807dbb6dd117a9c8b81318 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 14:21:42 +0100 Subject: [PATCH 14/18] Add pytest --ignore to pyproject.toml --- pyproject.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 410e7655b2b5..8000bd598c64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,16 @@ +# ERROR computer_vision/cnn_classification.py - ModuleNotFoundError: No module named 'tensorflow' +# ERROR machine_learning/forecasting/run.py - ModuleNotFoundError: No module named 'statsmodels' +# ERROR machine_learning/lstm/lstm_prediction.py - ModuleNotFoundError: No module named 'tensorflow' +# ERROR quantum/deutsch_jozsa.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/half_adder.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/not_gate.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/q_full_adder.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/quantum_entanglement.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/quantum_teleportation.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/ripple_adder_classic.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/single_qubit_measure.py - ModuleNotFoundError: No module named 'qiskit' +# ERROR quantum/superdense_coding.py - ModuleNotFoundError: No module named 'qiskit' + [tool.pytest.ini_options] markers = [ "mat_ops: mark a test as utilizing matrix operations.", @@ -7,7 +20,12 @@ addopts = [ "--doctest-modules", "--showlocals", ] - +ignore = [ + "computer_vision/cnn_classification.py", + "machine_learning/forecasting/run.py", + "machine_learning/lstm/lstm_prediction.py", + "quantum", +] [tool.coverage.report] omit = [".env/*"] From 28938f03ca12adc9be2426eeb6c7fad96601ec6c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 14:37:41 +0100 Subject: [PATCH 15/18] Update build.yml --- .github/workflows/build.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f3adb5d0b97..1069c68d215f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,15 @@ jobs: python -m pip install --upgrade pip setuptools six wheel python -m pip install pytest-cov -r requirements.txt - name: Run tests - run: pytest --ignore=project_euler/ --ignore=scripts/validate_solutions.py --cov-report=term-missing:skip-covered --cov=. . + # See: #6591 for re-enabling tests on Python v3.11 + run: pytest + --ignore=computer_vision/cnn_classification.py + --ignore=machine_learning/forecasting/run.py + --ignore=machine_learning/lstm/lstm_prediction.py + --ignore=quantum/ + --ignore=project_euler/ + --ignore=scripts/validate_solutions.py + --cov-report=term-missing:skip-covered + --cov=. . - if: ${{ success() }} run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md From e931c322bd12e874e99c7708551a6e7d84913a91 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 14:38:56 +0100 Subject: [PATCH 16/18] Update pyproject.toml --- pyproject.toml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8000bd598c64..5f9b1aa06c0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,3 @@ -# ERROR computer_vision/cnn_classification.py - ModuleNotFoundError: No module named 'tensorflow' -# ERROR machine_learning/forecasting/run.py - ModuleNotFoundError: No module named 'statsmodels' -# ERROR machine_learning/lstm/lstm_prediction.py - ModuleNotFoundError: No module named 'tensorflow' -# ERROR quantum/deutsch_jozsa.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/half_adder.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/not_gate.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/q_full_adder.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/quantum_entanglement.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/quantum_teleportation.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/ripple_adder_classic.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/single_qubit_measure.py - ModuleNotFoundError: No module named 'qiskit' -# ERROR quantum/superdense_coding.py - ModuleNotFoundError: No module named 'qiskit' - [tool.pytest.ini_options] markers = [ "mat_ops: mark a test as utilizing matrix operations.", @@ -20,12 +7,6 @@ addopts = [ "--doctest-modules", "--showlocals", ] -ignore = [ - "computer_vision/cnn_classification.py", - "machine_learning/forecasting/run.py", - "machine_learning/lstm/lstm_prediction.py", - "quantum", -] [tool.coverage.report] omit = [".env/*"] From c456b171807fd8b2c9f39e576ea56a39d5fd7ec5 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 14:39:55 +0100 Subject: [PATCH 17/18] Update pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 5f9b1aa06c0e..410e7655b2b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ addopts = [ "--showlocals", ] + [tool.coverage.report] omit = [".env/*"] sort = "Cover" From 74ac4ca09b31e4f60172ab1f80e2af75bf9559c7 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 31 Oct 2022 14:46:31 +0100 Subject: [PATCH 18/18] Python 3.11 --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37e020b8fd8a..3ce5bd1edf68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ pre-commit run --all-files --show-diff-on-failure We want your work to be readable by others; therefore, we encourage you to note the following: -- Please write in Python 3.10+. For instance: `print()` is a function in Python 3 so `print "Hello"` will *not* work but `print("Hello")` will. +- Please write in Python 3.11+. For instance: `print()` is a function in Python 3 so `print "Hello"` will *not* work but `print("Hello")` will. - Please focus hard on the naming of functions, classes, and variables. Help your reader by using __descriptive names__ that can help you to remove redundant comments. - Single letter variable names are *old school* so please avoid them unless their life only spans a few lines. - Expand acronyms because `gcd()` is hard to understand but `greatest_common_divisor()` is not.