core-algorithms 1.2.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/PKG-INFO +8 -4
  2. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/README.rst +4 -0
  3. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/__init__.py +1 -5
  4. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/__init__.py +0 -3
  5. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/bubble_sort.py +2 -6
  6. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/insertion_sort.py +1 -5
  7. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/merge_sort.py +6 -9
  8. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/quick_sort.py +3 -7
  9. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/sorting/selection_sort.py +1 -5
  10. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms.egg-info/PKG-INFO +8 -4
  11. core_algorithms-1.2.1/core_algorithms.egg-info/requires.txt +5 -0
  12. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/pyproject.toml +4 -4
  13. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/setup.py +0 -3
  14. core_algorithms-1.2.0/core_algorithms.egg-info/requires.txt +0 -5
  15. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/LICENSE +0 -0
  16. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms/py.typed +0 -0
  17. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms.egg-info/SOURCES.txt +0 -0
  18. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms.egg-info/dependency_links.txt +0 -0
  19. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/core_algorithms.egg-info/top_level.txt +0 -0
  20. {core_algorithms-1.2.0 → core_algorithms-1.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: core-algorithms
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: This project/library contains common algorithms...
5
5
  Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
6
6
  Maintainer: Alejandro Cora González
@@ -27,10 +27,10 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
27
27
  Requires-Python: >=3.9
28
28
  Description-Content-Type: text/x-rst
29
29
  License-File: LICENSE
30
- Requires-Dist: core-tests>=2.1.0
30
+ Requires-Dist: core-tests>=2.3.0
31
31
  Provides-Extra: dev
32
- Requires-Dist: core-dev-tools>=2.0.0; extra == "dev"
33
- Requires-Dist: core-tests>=2.1.0; extra == "dev"
32
+ Requires-Dist: core-dev-tools>=2.1.0; extra == "dev"
33
+ Requires-Dist: core-tests>=2.3.0; extra == "dev"
34
34
  Dynamic: license-file
35
35
 
36
36
  core-algorithms
@@ -41,6 +41,10 @@ focused on sorting.
41
41
 
42
42
  ===============================================================================
43
43
 
44
+ .. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
45
+ :target: https://pepy.tech/projects/core-algorithms
46
+ :alt: PyPI Downloads
47
+
44
48
  .. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
45
49
  :target: https://pypi.org/project/core-algorithms/
46
50
  :alt: Python Versions
@@ -6,6 +6,10 @@ focused on sorting.
6
6
 
7
7
  ===============================================================================
8
8
 
9
+ .. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
10
+ :target: https://pepy.tech/projects/core-algorithms
11
+ :alt: PyPI Downloads
12
+
9
13
  .. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
10
14
  :target: https://pypi.org/project/core-algorithms/
11
15
  :alt: Python Versions
@@ -1,10 +1,6 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Common algorithm implementations."""
4
2
 
5
- from importlib.metadata import PackageNotFoundError
6
- from importlib.metadata import version
7
-
3
+ from importlib.metadata import PackageNotFoundError, version
8
4
 
9
5
  try:
10
6
  __version__ = version("core-algorithms")
@@ -1,5 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Sorting algorithm implementations."""
4
2
 
5
3
  from .bubble_sort import bubble_sort
@@ -8,7 +6,6 @@ from .merge_sort import merge_sort
8
6
  from .quick_sort import quick_sort
9
7
  from .selection_sort import selection_sort
10
8
 
11
-
12
9
  __all__ = [
13
10
  "bubble_sort",
14
11
  "insertion_sort",
@@ -1,13 +1,9 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Bubble sort algorithm implementation."""
4
2
 
5
- from typing import List
6
-
7
3
 
8
- def bubble_sort(array: List):
4
+ def bubble_sort(array: list):
9
5
  """
10
- Sort *array* in ascending order using bubble
6
+ Sort *array* in ascending order using bubble
11
7
  sort and return it.
12
8
  """
13
9
 
@@ -1,11 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Insertion sort algorithm implementation."""
4
2
 
5
- from typing import List
6
-
7
3
 
8
- def insertion_sort(array: List):
4
+ def insertion_sort(array: list):
9
5
  """
10
6
  Sort *array* in ascending order using insertion
11
7
  sort and return it."""
@@ -1,11 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Merge sort algorithm implementation."""
4
2
 
5
- from typing import List
6
-
7
3
 
8
- def merge_sort(array: List):
4
+ def merge_sort(array: list):
9
5
  """
10
6
  Sort *array* in ascending order using merge
11
7
  sort and return it."""
@@ -35,10 +31,11 @@ def _merge(left, right, merged):
35
31
  merged[left_cursor + right_cursor] = right[right_cursor]
36
32
  right_cursor += 1
37
33
 
38
- for left_cursor in range(left_cursor, len(left)):
39
- merged[left_cursor + right_cursor] = left[left_cursor]
34
+ # Copy whatever remains on either side...
35
+ for i in range(left_cursor, len(left)):
36
+ merged[i + right_cursor] = left[i]
40
37
 
41
- for right_cursor in range(right_cursor, len(right)):
42
- merged[left_cursor + right_cursor] = right[right_cursor]
38
+ for j in range(right_cursor, len(right)):
39
+ merged[left_cursor + j] = right[j]
43
40
 
44
41
  return merged
@@ -1,11 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Quick sort algorithm implementation."""
4
2
 
5
- from typing import List
6
-
7
3
 
8
- def _partition(array: List, begin: int, end: int):
4
+ def _partition(array: list, begin: int, end: int):
9
5
  pivot_idx = begin
10
6
  for i in range(begin + 1, end + 1):
11
7
  if array[i] <= array[begin]:
@@ -16,7 +12,7 @@ def _partition(array: List, begin: int, end: int):
16
12
  return pivot_idx
17
13
 
18
14
 
19
- def _quick_sort_recursion(array: List, begin: int, end: int):
15
+ def _quick_sort_recursion(array: list, begin: int, end: int):
20
16
  if begin >= end:
21
17
  return
22
18
 
@@ -25,7 +21,7 @@ def _quick_sort_recursion(array: List, begin: int, end: int):
25
21
  _quick_sort_recursion(array, pivot_idx + 1, end)
26
22
 
27
23
 
28
- def quick_sort(array: List, begin=0, end=None):
24
+ def quick_sort(array: list, begin=0, end=None):
29
25
  """
30
26
  Sort *array* in ascending order using quick
31
27
  sort and return it.
@@ -1,11 +1,7 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  """Selection sort algorithm implementation."""
4
2
 
5
- from typing import List
6
-
7
3
 
8
- def selection_sort(array: List):
4
+ def selection_sort(array: list):
9
5
  """
10
6
  Sort *array* in ascending order using selection
11
7
  sort and return it.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: core-algorithms
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: This project/library contains common algorithms...
5
5
  Author-email: Alejandro Cora González <alek.cora.glez@gmail.com>
6
6
  Maintainer: Alejandro Cora González
@@ -27,10 +27,10 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
27
27
  Requires-Python: >=3.9
28
28
  Description-Content-Type: text/x-rst
29
29
  License-File: LICENSE
30
- Requires-Dist: core-tests>=2.1.0
30
+ Requires-Dist: core-tests>=2.3.0
31
31
  Provides-Extra: dev
32
- Requires-Dist: core-dev-tools>=2.0.0; extra == "dev"
33
- Requires-Dist: core-tests>=2.1.0; extra == "dev"
32
+ Requires-Dist: core-dev-tools>=2.1.0; extra == "dev"
33
+ Requires-Dist: core-tests>=2.3.0; extra == "dev"
34
34
  Dynamic: license-file
35
35
 
36
36
  core-algorithms
@@ -41,6 +41,10 @@ focused on sorting.
41
41
 
42
42
  ===============================================================================
43
43
 
44
+ .. image:: https://static.pepy.tech/personalized-badge/core-algorithms?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads
45
+ :target: https://pepy.tech/projects/core-algorithms
46
+ :alt: PyPI Downloads
47
+
44
48
  .. image:: https://img.shields.io/pypi/pyversions/core-algorithms.svg
45
49
  :target: https://pypi.org/project/core-algorithms/
46
50
  :alt: Python Versions
@@ -0,0 +1,5 @@
1
+ core-tests>=2.3.0
2
+
3
+ [dev]
4
+ core-dev-tools>=2.1.0
5
+ core-tests>=2.3.0
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
  [project]
10
10
  name = "core-algorithms"
11
11
  description = "This project/library contains common algorithms..."
12
- version = "1.2.0"
12
+ version = "1.2.1"
13
13
 
14
14
  authors = [
15
15
  {name = "Alejandro Cora González", email = "alek.cora.glez@gmail.com"}
@@ -42,13 +42,13 @@ classifiers = [
42
42
  ]
43
43
 
44
44
  dependencies = [
45
- "core-tests>=2.1.0"
45
+ "core-tests>=2.3.0"
46
46
  ]
47
47
 
48
48
  [project.optional-dependencies]
49
49
  dev = [
50
- "core-dev-tools>=2.0.0",
51
- "core-tests>=2.1.0",
50
+ "core-dev-tools>=2.1.0",
51
+ "core-tests>=2.3.0",
52
52
  ]
53
53
 
54
54
  [project.urls]
@@ -1,6 +1,3 @@
1
- # -*- coding: utf-8 -*-
2
-
3
1
  from setuptools import setup
4
2
 
5
-
6
3
  setup()
@@ -1,5 +0,0 @@
1
- core-tests>=2.1.0
2
-
3
- [dev]
4
- core-dev-tools>=2.0.0
5
- core-tests>=2.1.0
File without changes