dtools.circular-array 3.13.0__tar.gz → 3.15.0__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.
@@ -2,12 +2,29 @@
2
2
 
3
3
  PyPI grscheller.circular-array project.
4
4
 
5
- - first digit - major event, epoch, or paradigm shift
6
- - second digit - breaking API changes, major changes
7
- - third digit - bug fixes, API additions
5
+ - Strict 3 digit semantic versioning (adopted 2025-05-19)
6
+ - MAJOR version for incompatible API changes
7
+ - MINOR version for backward compatible added functionality
8
+ - PATCH version for backward compatible bug fixes
8
9
 
9
10
  ## Releases and Important Milestones
10
11
 
12
+ ### Adapting strict Semantic from this point on - date 2025-05-19
13
+
14
+ - [Semantic Versioning 2.0.0](https://semver.org/)
15
+ - see top of file
16
+ - previous versioning scheme used
17
+ - first digit - major event, epoch, or paradigm shift
18
+ - second digit - breaking API changes, major changes
19
+ - third digit - bug fixes, API additions
20
+
21
+ ### Version 3.14.0 - PyPI release date 2025-05-10
22
+
23
+ - Made package just a single module
24
+ - dtools.circular_array.ca -> dtools.circular_array
25
+ - dtools/circular_array.ca.py -> dtools/circular_array.py
26
+ - docstring consolidations/updates
27
+
11
28
  ### Version 3.13.0 - PyPI release date 2025-05-06
12
29
 
13
30
  - version no longer determined dynamically
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dtools.circular-array
3
- Version: 3.13.0
4
- Summary: ### Developer Tools - Circular Array Data Structure
3
+ Version: 3.15.0
4
+ Summary: An indexable circular array data structure.
5
5
  Keywords: circular array,dequeue,pop,push,indexable,auto resizing
6
6
  Author-email: "Geoffrey R. Scheller" <geoffrey@scheller.com>
7
7
  Requires-Python: >=3.12
@@ -16,15 +16,16 @@ Classifier: Typing :: Typed
16
16
  License-File: LICENSE
17
17
  Requires-Dist: pytest >=8.3.5 ; extra == "test"
18
18
  Project-URL: Changelog, https://github.com/grscheller/dtools-circular-array/blob/main/CHANGELOG.md
19
- Project-URL: Documentation, https://grscheller.github.io/dtools-docs/circular-array
20
- Project-URL: Homepage, https://github.com/grscheller/dtools-docs
19
+ Project-URL: Documentation, https://grscheller.github.io/dtools-namespace-projects/circular-array
20
+ Project-URL: Homepage, https://github.com/grscheller/dtools-namespace-projects/blob/main/README.md
21
21
  Project-URL: Source, https://github.com/grscheller/dtools-circular-array
22
22
  Provides-Extra: test
23
23
 
24
24
  # Developer Tools - Circular Array
25
25
 
26
26
  Python package containing a module implementing a circular array data
27
- structure,
27
+ structure, This project is part of the [Developer Tools for Python][4]
28
+ **dtools** namespace projects.
28
29
 
29
30
  - **Repositories**
30
31
  - [dtools.circular-array][1] project on *PyPI*
@@ -32,29 +33,27 @@ structure,
32
33
  - **Detailed documentation**
33
34
  - [Detailed API documentation][3] on *GH-Pages*
34
35
 
35
- This project is part of the [Developer Tools for Python][4] **dtools.**
36
- namespace project.
37
-
38
36
  ## Overview
39
37
 
40
- - O(1) amortized pushes and pops either end.
41
- - O(1) indexing
42
- - fully supports slicing
43
- - safely mutates over previous state
44
-
45
- ### Module circular_array
46
-
47
38
  A full featured auto resizing circular array data structure. Double
48
39
  sided, indexable, sliceable, and iterable. When iterated, uses cached
49
40
  copies of its present state so that the circular array itself can safely
50
41
  be mutated.
51
42
 
43
+ - O(1) amortized pushes and pops either end.
44
+ - O(1) indexing
45
+ - fully supports slicing
46
+ - safely mutates over previous state
47
+
52
48
  Useful either if used directly like a Python list, or in a "has-a"
53
49
  relationship when implementing other data structures.
54
50
 
55
51
  - *module* dtools.circular_array
56
- - *class* CA: circular array data structure
57
- - *function* ca: factory function to produce a CA from data
52
+ - *class* `CA:` circular array data structure
53
+ - initializer takes 1 or 0 iterators
54
+ - like `list` or `set` does
55
+ - *function* `ca`: produces a `CA` from the function's arguments
56
+ - similar use case as syntactic constructs `[]` or `{}`
58
57
 
59
58
  Above nomenclature modeled after builtin data types like `list`, where
60
59
  `CA` and `ca` correspond respectfully to `list` and `[]` in their use
@@ -63,7 +62,7 @@ cases.
63
62
  #### Usage
64
63
 
65
64
  ```python
66
- from dtools.circular_array.ca import CA, ca
65
+ from dtools.circular_array import CA, ca
67
66
 
68
67
  ca1 = ca(1, 2, 3)
69
68
  assert ca1.popl() == 1
@@ -81,8 +80,8 @@ cases.
81
80
  tup4 = ca2.poprt(4)
82
81
  assert tup3 == (1, 2, 3)
83
82
  assert tup4 == (10, 9, 8, 7)
84
- assert ca2 == CA(4, 5, 6)
85
- four, *rest = ca.popft(1000)
83
+ assert ca2 == ca(4, 5, 6)
84
+ four, *rest = ca2.poplt(1000)
86
85
  assert four == 4
87
86
  assert rest == [5, 6]
88
87
  assert len(ca2) == 0
@@ -96,10 +95,8 @@ cases.
96
95
  assert len(ca2) == 0
97
96
  ```
98
97
 
99
- ______________________________________________________________________
100
-
101
98
  [1]: https://pypi.org/project/dtools.circular-array
102
99
  [2]: https://github.com/grscheller/dtools-circular-array
103
- [3]: https://grscheller.github.io/dtools-docs/circular-array
104
- [4]: https://github.com/grscheller/dtools-docs
100
+ [3]: https://grscheller.github.io/dtools-namespace-projects/circular-array
101
+ [4]: https://github.com/grscheller/dtools-namespace-projects/blob/main/README.md
105
102
 
@@ -1,7 +1,8 @@
1
1
  # Developer Tools - Circular Array
2
2
 
3
3
  Python package containing a module implementing a circular array data
4
- structure,
4
+ structure, This project is part of the [Developer Tools for Python][4]
5
+ **dtools** namespace projects.
5
6
 
6
7
  - **Repositories**
7
8
  - [dtools.circular-array][1] project on *PyPI*
@@ -9,29 +10,27 @@ structure,
9
10
  - **Detailed documentation**
10
11
  - [Detailed API documentation][3] on *GH-Pages*
11
12
 
12
- This project is part of the [Developer Tools for Python][4] **dtools.**
13
- namespace project.
14
-
15
13
  ## Overview
16
14
 
17
- - O(1) amortized pushes and pops either end.
18
- - O(1) indexing
19
- - fully supports slicing
20
- - safely mutates over previous state
21
-
22
- ### Module circular_array
23
-
24
15
  A full featured auto resizing circular array data structure. Double
25
16
  sided, indexable, sliceable, and iterable. When iterated, uses cached
26
17
  copies of its present state so that the circular array itself can safely
27
18
  be mutated.
28
19
 
20
+ - O(1) amortized pushes and pops either end.
21
+ - O(1) indexing
22
+ - fully supports slicing
23
+ - safely mutates over previous state
24
+
29
25
  Useful either if used directly like a Python list, or in a "has-a"
30
26
  relationship when implementing other data structures.
31
27
 
32
28
  - *module* dtools.circular_array
33
- - *class* CA: circular array data structure
34
- - *function* ca: factory function to produce a CA from data
29
+ - *class* `CA:` circular array data structure
30
+ - initializer takes 1 or 0 iterators
31
+ - like `list` or `set` does
32
+ - *function* `ca`: produces a `CA` from the function's arguments
33
+ - similar use case as syntactic constructs `[]` or `{}`
35
34
 
36
35
  Above nomenclature modeled after builtin data types like `list`, where
37
36
  `CA` and `ca` correspond respectfully to `list` and `[]` in their use
@@ -40,7 +39,7 @@ cases.
40
39
  #### Usage
41
40
 
42
41
  ```python
43
- from dtools.circular_array.ca import CA, ca
42
+ from dtools.circular_array import CA, ca
44
43
 
45
44
  ca1 = ca(1, 2, 3)
46
45
  assert ca1.popl() == 1
@@ -58,8 +57,8 @@ cases.
58
57
  tup4 = ca2.poprt(4)
59
58
  assert tup3 == (1, 2, 3)
60
59
  assert tup4 == (10, 9, 8, 7)
61
- assert ca2 == CA(4, 5, 6)
62
- four, *rest = ca.popft(1000)
60
+ assert ca2 == ca(4, 5, 6)
61
+ four, *rest = ca2.poplt(1000)
63
62
  assert four == 4
64
63
  assert rest == [5, 6]
65
64
  assert len(ca2) == 0
@@ -73,9 +72,7 @@ cases.
73
72
  assert len(ca2) == 0
74
73
  ```
75
74
 
76
- ______________________________________________________________________
77
-
78
75
  [1]: https://pypi.org/project/dtools.circular-array
79
76
  [2]: https://github.com/grscheller/dtools-circular-array
80
- [3]: https://grscheller.github.io/dtools-docs/circular-array
81
- [4]: https://github.com/grscheller/dtools-docs
77
+ [3]: https://grscheller.github.io/dtools-namespace-projects/circular-array
78
+ [4]: https://github.com/grscheller/dtools-namespace-projects/blob/main/README.md
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
4
4
 
5
5
  [project]
6
6
  name = "dtools.circular-array"
7
- version = "3.13.0"
7
+ version = "3.15.0"
8
8
  authors = [{ name = "Geoffrey R. Scheller", email = "geoffrey@scheller.com" }]
9
9
  license = { file = "LICENSE" }
10
10
  readme = "README.md"
@@ -35,10 +35,10 @@ test = [
35
35
  ]
36
36
 
37
37
  [project.urls]
38
- Homepage = "https://github.com/grscheller/dtools-docs"
38
+ Homepage = "https://github.com/grscheller/dtools-namespace-projects/blob/main/README.md"
39
39
  Source = "https://github.com/grscheller/dtools-circular-array"
40
40
  Changelog = "https://github.com/grscheller/dtools-circular-array/blob/main/CHANGELOG.md"
41
- Documentation = "https://grscheller.github.io/dtools-docs/circular-array"
41
+ Documentation = "https://grscheller.github.io/dtools-namespace-projects/circular-array"
42
42
 
43
43
  [tool.flit.sdist]
44
44
  exclude = ["dist", "tests", ".gitignore", ".mypy_cache", ".pytest_cache"]
@@ -12,10 +12,27 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- """### An indexable circular array data structure."""
15
+ """An indexable circular array data structure.
16
+
17
+ - generic, stateful, invariant data structure
18
+ - amortized O(1) pushing and popping from either end
19
+ - O(1) random access any element
20
+ - will resize itself as needed
21
+ - sliceable
22
+ - makes defensive copies of contents for the purposes of iteration
23
+ - in boolean context returns
24
+ - `True` when not empty
25
+ - `False` when empty
26
+ - in comparisons compare identity before equality, like builtins do
27
+
28
+ """
16
29
 
17
30
  from __future__ import annotations
18
31
 
32
+ __author__ = 'Geoffrey R. Scheller'
33
+ __copyright__ = 'Copyright (c) 2023-2025 Geoffrey R. Scheller'
34
+ __license__ = 'Apache License 2.0'
35
+
19
36
  from collections.abc import Callable, Iterable, Iterator
20
37
  from typing import cast, Never, overload, TypeVar
21
38
 
@@ -27,7 +44,6 @@ D = TypeVar('D')
27
44
  class CA[D]:
28
45
  """Indexable circular array data structure
29
46
 
30
- - generic, stateful data structure
31
47
  - amortized O(1) pushing and popping from either end
32
48
  - O(1) random access any element
33
49
  - will resize itself as needed
@@ -1,32 +0,0 @@
1
- # Copyright 2023-2025 Geoffrey R. Scheller
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """### Developer Tools - Circular Array Data Structure
16
-
17
- Package for an indexable, sliceable, auto-resizing circular array
18
- data structure with amortized O(1) pushes and pops either end.
19
-
20
- Circular array data structure.
21
-
22
- - *module* dtools.circular_array.ca
23
- - *class* dtools.circular_array.ca.CA
24
- - initializer takes up to 1 iterable
25
- - *function* dtools.circular_array.ca.ca
26
- - constructs a `CA` from a variable number of arguments
27
-
28
- """
29
-
30
- __author__ = 'Geoffrey R. Scheller'
31
- __copyright__ = 'Copyright (c) 2023-2025 Geoffrey R. Scheller'
32
- __license__ = 'Apache License 2.0'