xloft 0.1.25__py3-none-any.whl → 0.3.0__py3-none-any.whl

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.

Potentially problematic release.


This version of xloft might be problematic. Click here for more details.

xloft/__init__.py CHANGED
@@ -7,6 +7,8 @@ Modules exported by this package:
7
7
  - `quantum` - A set of tools for quantum calculations.
8
8
  """
9
9
 
10
+ from __future__ import annotations
11
+
10
12
  __all__ = ("NamedTuple",)
11
13
 
12
14
  from xloft.namedtuple import NamedTuple
xloft/errors.py CHANGED
@@ -1,5 +1,7 @@
1
1
  """XLOT Exceptions."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
 
4
6
  class XLOTException(Exception):
5
7
  """Root Custom Exception."""
xloft/humanism.py CHANGED
@@ -5,6 +5,8 @@ The module contains the following functions:
5
5
  - `to_human_size(size)` - Returns a humanized string: 200 bytes | 1 KB | 1.5 MB etc.
6
6
  """
7
7
 
8
+ from __future__ import annotations
9
+
8
10
  import math
9
11
 
10
12
 
xloft/namedtuple.py CHANGED
@@ -52,6 +52,8 @@ Examples:
52
52
  Error: AttributeCannotBeDelete
53
53
  """
54
54
 
55
+ from __future__ import annotations
56
+
55
57
  from typing import Any
56
58
 
57
59
  from xloft.errors import (
xloft/quantum.py CHANGED
@@ -1,5 +1,13 @@
1
1
  """A set of tools for quantum calculations.
2
2
 
3
+ A Qubit in a regular computer is quantum of algorithm that is executed in
4
+ one iteration of a cycle in a separate processor thread.
5
+
6
+ Quantum is a function with an algorithm of task for data processing.
7
+
8
+ In this case, the Qubit is not a single information,
9
+ but it is a concept of the principle of operation of quantum calculations on a regular computer.
10
+
3
11
  The module contains the following tools:
4
12
 
5
13
  - `count_qubits()` - Counting the number of qubits of your computer.
@@ -7,19 +15,22 @@ The module contains the following tools:
7
15
  - `QuantumLoop` - Separation of the cycle into quantums.
8
16
  """
9
17
 
18
+ from __future__ import annotations
19
+
10
20
  import concurrent.futures
11
21
  import multiprocessing
22
+ from collections.abc import Callable, Iterable
12
23
  from enum import Enum
13
- from typing import Any, Callable, Iterable, Never, assert_never
24
+ from typing import Any, Never, assert_never
14
25
 
15
26
 
16
27
  def count_qubits() -> int:
17
- """Counting the number of qubits of your computer.
28
+ """Counting the number of conceptual qubits of your computer.
18
29
 
19
- A qubit in a regular computer is quantum of algorithm that is executed in
20
- one iteration of a cycle in a separate processor thread.
30
+ Conceptual qubit is quantum of algorithm (task) that is executed in
31
+ iterations of a cycle in a separate processor thread.
21
32
 
22
- Quantum is a function with an algorithm of task for data processing.
33
+ Quantum of algorithm is a function for data processing.
23
34
 
24
35
  Examples:
25
36
  >>> from xloft.quantum import count_qubits
@@ -27,7 +38,7 @@ def count_qubits() -> int:
27
38
  16
28
39
 
29
40
  Returns:
30
- The number of qubits.
41
+ The number of conceptual qubits.
31
42
  """
32
43
  return multiprocessing.cpu_count()
33
44
 
@@ -40,7 +51,7 @@ class LoopMode(Enum):
40
51
 
41
52
 
42
53
  class QuantumLoop:
43
- """Separation of the cycle into quantums.
54
+ """Separation of the cycle into quantum algorithms for multiprocessing data processing.
44
55
 
45
56
  Args:
46
57
  quantum: Function with a task algorithm.
@@ -92,7 +103,7 @@ class QuantumLoop:
92
103
  chunksize=self.chunksize,
93
104
  ),
94
105
  )
95
- return results
106
+ return results # noqa: RET504
96
107
 
97
108
  def thread_pool(self) -> list[Any]:
98
109
  """More suitable for tasks related to input-output
@@ -107,7 +118,7 @@ class QuantumLoop:
107
118
  chunksize=self.chunksize,
108
119
  ),
109
120
  )
110
- return results
121
+ return results # noqa: RET504
111
122
 
112
123
  def run(self) -> list[Any]:
113
124
  """Run the quantum loop."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xloft
3
- Version: 0.1.25
3
+ Version: 0.3.0
4
4
  Summary: (XLOFT) X-Library of tools
5
5
  Project-URL: Homepage, https://github.com/kebasyaty/xloft
6
6
  Project-URL: Repository, https://github.com/kebasyaty/xloft
@@ -174,6 +174,7 @@ print(s) # => 1023.999 KB
174
174
  ```python
175
175
  from xloft.quantum import LoopMode, QuantumLoop, count_qubits
176
176
 
177
+ # Counting the number of conceptual qubits of your computer.
177
178
  num = count_qubits()
178
179
  print(num) # => 16
179
180
 
@@ -183,6 +184,7 @@ def quantum(item):
183
184
 
184
185
  data = range(10)
185
186
 
187
+ # Separation of the cycle into quantum algorithms for multiprocessing data processing.
186
188
  qloop = QuantumLoop(quantum, data)
187
189
  results = qloop.run()
188
190
  print(results) # => [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
@@ -0,0 +1,10 @@
1
+ xloft/__init__.py,sha256=oYQan7jqPh5XKw9msdT290f6fPo4c53p6OkFcCoqi_s,409
2
+ xloft/errors.py,sha256=hZcmF0QVVdvE5oM1jsXymRk_pPGgDSnUDM9wx9zJAYQ,895
3
+ xloft/humanism.py,sha256=odRbUF_58YuFWC_VQeRDZ-6ifHDiiAH2HNb5G5K6JIM,1106
4
+ xloft/namedtuple.py,sha256=a_l3bZF-L2I7MGxuF2CXzAHgNai-Vyj6SY1ODwxs7TU,6856
5
+ xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ xloft/quantum.py,sha256=2l7L6ifYvBp5fQUcrdBiuK_QukIohpc2AJm1iFv_igk,4664
7
+ xloft-0.3.0.dist-info/METADATA,sha256=5NIrvvMnloUcCbrDG5s60NNTscPkKLmRMPLDgSLY3sI,7235
8
+ xloft-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ xloft-0.3.0.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
10
+ xloft-0.3.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- xloft/__init__.py,sha256=FZ2m329mXkIm4ETgl0ERwEzRzsFvd-_1ug2Eo1kSVo0,371
2
- xloft/errors.py,sha256=GYXvi2l01VUDQSs6skiOfQsKLF6tFuUhJMqNkL7BJNI,857
3
- xloft/humanism.py,sha256=I6q56MhviapBSWF4B_1xd77TDwQMM1jrkbl1N-fOURc,1068
4
- xloft/namedtuple.py,sha256=OkAHqMaV4hN6Qj_oaOYQ9-y9x4Muv4mNrBn48T6RpiI,6818
5
- xloft/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- xloft/quantum.py,sha256=0c6-vz6SilbKxtz6vJvL-9MpsByGVb4mWZvo67fwFBU,4159
7
- xloft-0.1.25.dist-info/METADATA,sha256=nP-9CLu5N_XLg1p8mQYxxmZC0Va7II49LgP2gOieVYE,7088
8
- xloft-0.1.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- xloft-0.1.25.dist-info/licenses/LICENSE,sha256=2zZINd6m_jNYlowdQImlEizyhSui5cBAJZRhWQURcEc,1095
10
- xloft-0.1.25.dist-info/RECORD,,
File without changes