Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #561 from iKostanOrg/master #562

Merged
merged 106 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
4523ab4
Merge pull request #561 from iKostanOrg/master
ikostan Dec 15, 2024
1781eaa
Create pydocstyle_kyu6.yml
ikostan Dec 15, 2024
17f626e
Update __init__.py
ikostan Dec 15, 2024
f58f8a8
Update __init__.py
ikostan Dec 15, 2024
c30fb64
Array.diff
ikostan Dec 15, 2024
2cfcfcb
Update .yamllint.yaml
ikostan Dec 15, 2024
9af83a5
Array to table
ikostan Dec 17, 2024
0560dde
Binary to text
ikostan Dec 17, 2024
43045c1
Binary to text
ikostan Dec 17, 2024
44d7c29
Update test_list_to_html_table.py
ikostan Dec 17, 2024
ac44d86
Update test_list_to_html_table.py
ikostan Dec 17, 2024
167ebf2
Update test_binary_to_string.py
ikostan Dec 17, 2024
4e717cb
Update test_binary_to_string.py
ikostan Dec 17, 2024
06e3458
Update test_binary_to_string.py
ikostan Dec 17, 2024
a73c8ec
Update test_binary_to_string.py
ikostan Dec 17, 2024
27d8192
Update test_binary_to_string.py
ikostan Dec 17, 2024
ed81bf9
Update test_list_to_html_table.py
ikostan Dec 17, 2024
7b6a0aa
Update test_binary_to_string.py
ikostan Dec 17, 2024
6c213d1
Update test_binary_to_string.py
ikostan Dec 17, 2024
96f2b67
Update test_binary_to_string.py
ikostan Dec 17, 2024
682c9d6
Update test_binary_to_string.py
ikostan Dec 17, 2024
4a5bfbc
Update test_list_to_html_table.py
ikostan Dec 17, 2024
62ae6a5
Update test_binary_to_string.py
ikostan Dec 17, 2024
8d735fd
Update test_binary_to_string.py
ikostan Dec 17, 2024
878727b
# Casino chips
ikostan Dec 17, 2024
05e51ac
Character frequency
ikostan Dec 17, 2024
2fc9911
# Color Choice
ikostan Dec 17, 2024
8f905bf
# Count letters in string
ikostan Dec 17, 2024
8085085
# Decipher this
ikostan Dec 17, 2024
5d92c6e
# DefaultList
ikostan Dec 17, 2024
0e8ff85
# Disease Spread
ikostan Dec 17, 2024
255dd84
# Duplicate Encoder
ikostan Dec 17, 2024
c20735f
# Easy Diagonal
ikostan Dec 17, 2024
43d7540
# Encrypt this
ikostan Dec 17, 2024
ad80b8d
# Find the odd int
ikostan Dec 17, 2024
f482cea
# First character that repeats
ikostan Dec 17, 2024
18b4033
# Format a string of names like 'Bart, Lisa & Maggie'
ikostan Dec 17, 2024
f3f8cf2
# Help the bookseller
ikostan Dec 17, 2024
e762a26
# Character with longest consecutive repetition
ikostan Dec 17, 2024
9ed0edc
# Multiples of 3 or 5
ikostan Dec 17, 2024
e396da8
# No arithmetic progressions
ikostan Dec 17, 2024
b212c8a
# Number Zoo Patrol
ikostan Dec 17, 2024
284430f
Update test_longest_repetition.py
ikostan Dec 17, 2024
7c984c9
Update test_stock_list.py
ikostan Dec 17, 2024
70204c9
Update test_longest_repetition.py
ikostan Dec 17, 2024
11d2069
Update test_alphanumeric.py
ikostan Dec 17, 2024
f49c559
Update test_longest_repetition.py
ikostan Dec 17, 2024
82943ef
Update .codeclimate.yml
ikostan Dec 17, 2024
cadec14
# Numericals of a String
ikostan Dec 17, 2024
84ba365
# Permute a Palindrome
ikostan Dec 17, 2024
62b0ea1
# Pokemon Damage Calculator
ikostan Dec 17, 2024
33c7994
# Potion Class 101
ikostan Dec 17, 2024
1d08d44
# Pyramid Array
ikostan Dec 17, 2024
2ad5d87
# ROTATE THE LETTERS OF EACH ELEMENT
ikostan Dec 17, 2024
a18f2d2
# Row of the odd triangle
ikostan Dec 17, 2024
e4694d7
# Scheduling (Shortest Job First or SJF)
ikostan Dec 17, 2024
ffe8bb9
# Sort the odd
ikostan Dec 17, 2024
061266e
# String subpattern recognition I
ikostan Dec 17, 2024
b778a9a
# String subpattern recognition II
ikostan Dec 17, 2024
cc5ac75
# String subpattern recognition III
ikostan Dec 17, 2024
29d8688
# String transformer
ikostan Dec 17, 2024
77dc370
# Sum of Digits / Digital Root
ikostan Dec 17, 2024
5163e6e
# Sums of Parts
ikostan Dec 17, 2024
edb8fe5
Update test_odd_row.py
ikostan Dec 17, 2024
ec3629f
# Unique In Order
ikostan Dec 18, 2024
b553c77
Update test_sort_array.py
ikostan Dec 18, 2024
0695155
Update unique_in_order.py
ikostan Dec 18, 2024
dbe5410
Update test_unique_in_order.py
ikostan Dec 18, 2024
62d1e18
# Valid Braces
ikostan Dec 18, 2024
168a6b0
# Vasya - Clerk
ikostan Dec 18, 2024
cd22053
# Who likes it
ikostan Dec 18, 2024
00be386
# Your order, please
ikostan Dec 18, 2024
ccf04c4
Update test_order.py
ikostan Dec 18, 2024
54d428c
Update test_order.py
ikostan Dec 18, 2024
0e67a55
Update solution.py
ikostan Dec 18, 2024
f41ac82
Update solution.py
ikostan Dec 18, 2024
e7168bb
Update string_transformer.py
ikostan Dec 18, 2024
ae4fbac
Update group_cities.py
ikostan Dec 18, 2024
535114f
Update thirt.py
ikostan Dec 18, 2024
3f205f0
Update epidemic_test_data.py
ikostan Dec 18, 2024
4f75ac3
Update solution.py
ikostan Dec 18, 2024
274a640
Update sequence.py
ikostan Dec 18, 2024
270a50e
Update sequence.py
ikostan Dec 18, 2024
9dafa55
Update unique_in_order.py
ikostan Dec 18, 2024
c74dcec
Update order.py
ikostan Dec 18, 2024
1d66000
Update sequence.py
ikostan Dec 18, 2024
70891e1
Update default_list.py
ikostan Dec 18, 2024
6dd86f2
Update order.py
ikostan Dec 18, 2024
8e090ea
Update valid_braces.py
ikostan Dec 19, 2024
4c77fc6
Recognition of string subpattern
ikostan Dec 19, 2024
89950bc
Update test_calculate_damage.py
ikostan Dec 19, 2024
360ee7e
Update solution.py
ikostan Dec 19, 2024
8eebd81
Update test_likes_function.py
ikostan Dec 19, 2024
52ba64d
Update test_namelist.py
ikostan Dec 19, 2024
5136bf5
Update test_list_to_html_table.py
ikostan Dec 19, 2024
ddfcd25
Update test_likes_function.py
ikostan Dec 19, 2024
9ce726e
Default list
ikostan Dec 19, 2024
4242c0e
Update test_default_list.py
ikostan Dec 19, 2024
047f607
Update test_default_list.py
ikostan Dec 19, 2024
0ef885f
Update test_order.py
ikostan Dec 19, 2024
85706b4
Edge cases
ikostan Dec 19, 2024
160e6b2
Update test_edge_case_list.py
ikostan Dec 19, 2024
ec4d39b
Update tickets.py
ikostan Dec 19, 2024
34a3d2b
Update test_stock_list.py
ikostan Dec 19, 2024
d5763de
Update test_stock_list.py
ikostan Dec 19, 2024
8f7dce0
Update test_edge_case_list.py
ikostan Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/pydocstyle_kyu6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: pydocstyle for kyu6

on: # yamllint disable-line rule:truthy
push:
branches:
- 'kyu6'

permissions:
contents: read
pull-requests: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.x"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install pydocstyle
pip install types-requests
- name: Check to make sure that the module is in your Python path
run: |
echo $PYTHONPATH
- name: Check pydocstyle version
run: |
pydocstyle --version
- name: Doc style checking with pydocstyle
# Pydocstyle testing (Guide)
# https://www.pydocstyle.org/en/stable/usage.html#cli-usage
run: |
pydocstyle --verbose --explain --count kyu_6
1 change: 1 addition & 0 deletions kyu_6/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""6 kyu - Novice package."""
1 change: 1 addition & 0 deletions kyu_6/a_rule_of_divisibility_by_13/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""A Rule of Divisibility by 13."""
1 change: 1 addition & 0 deletions kyu_6/array_diff/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""# Array.diff."""
3 changes: 2 additions & 1 deletion kyu_6/array_diff/solution.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Solution for -> Array.diff
Solution for -> Array.diff.

Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""
Expand Down
51 changes: 23 additions & 28 deletions kyu_6/array_diff/test_array_diff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Test for -> Array.diff
Test for -> Array.diff.

Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""
Expand All @@ -8,6 +9,7 @@

import unittest
import allure
from parameterized import parameterized
from kyu_6.array_diff.solution import array_diff
from utils.log_func import print_log

Expand All @@ -28,7 +30,7 @@
# pylint: enable-msg=R0801
class ArrayDiffTestCase(unittest.TestCase):
"""
Testing array_diff function
Testing array_diff function.

Your goal in this kata is to implement a difference function,
which subtracts one list from another and returns the result.
Expand All @@ -42,9 +44,16 @@ class ArrayDiffTestCase(unittest.TestCase):
array_diff([1,2,2,2,3],[2]) == [1,3]
"""

def test_array_diff_function(self):
@parameterized.expand([
([1, 2], [1], [2], "a was [1,2], b was [1], expected [2]"),
([1, 2, 2], [1], [2, 2], "a was [1,2,2], b was [1], expected [2,2]"),
([1, 2, 2], [2], [1], "a was [1,2,2], b was [2], expected [1]"),
([1, 2, 2], [], [1, 2, 2], "a was [1,2,2], b was [], expected [1,2,2]"),
([], [1, 2], [], "a was [], b was [1,2], expected []")])
def test_array_diff_function(self, a, b, expected, message):
"""
Testing array_diff function
Testing array_diff function.

:return:
"""
# pylint: disable-msg=R0801
Expand All @@ -59,29 +68,15 @@ def test_array_diff_function(self):
"and returns the result. It should remove all values from "
"list a, which are present in list b.</p>")
# pylint: enable-msg=R0801
test_data: tuple = (
([1, 2], [1], [2], "a was [1,2], b was [1], expected [2]"),
([1, 2, 2], [1], [2, 2], "a was [1,2,2], b was [1], expected [2,2]"),
([1, 2, 2], [2], [1], "a was [1,2,2], b was [2], expected [1]"),
([1, 2, 2], [], [1, 2, 2], "a was [1,2,2], b was [], expected [1,2,2]"),
([], [1, 2], [], "a was [], b was [1,2], expected []"))

for test_item in test_data:
a: list = test_item[0]
b: list = test_item[1]
expected: list = test_item[2]
message: str = test_item[-1]
with allure.step(f"Enter a test data: {a, b} and verify the "
f"expected output vs actual result: {expected}."):
actual_result: list = array_diff(a, b)
print_log(a=a,
b=b,
exp=expected,
message=message,
actual_result=actual_result)

with allure.step("Enter a test data and verify the "
"expected output vs actual result"):

print_log(a=a,
b=b,
exp=expected,
message=message,
res=actual_result)

self.assertEqual(expected,
actual_result,
message)
self.assertEqual(expected,
actual_result,
message)
Loading