kbasic 0.3.0__tar.gz → 0.3.2__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 (26) hide show
  1. {kbasic-0.3.0 → kbasic-0.3.2}/PKG-INFO +1 -1
  2. {kbasic-0.3.0 → kbasic-0.3.2}/pyproject.toml +1 -1
  3. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/__init__.py +1 -1
  4. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/array.py +2 -1
  5. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/vectors.py +17 -17
  6. {kbasic-0.3.0 → kbasic-0.3.2}/README.md +0 -0
  7. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/Tex.py +0 -0
  8. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/audio/__init__.py +0 -0
  9. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/audio/lib/Caroline Rose - year of the slug - 01 everything in its right place.wav +0 -0
  10. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/audio/lib/success.mp3 +0 -0
  11. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/audio/sound.py +0 -0
  12. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/bar.py +0 -0
  13. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/environment/Keyan.py +0 -0
  14. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/environment/__init__.py +0 -0
  15. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/environment/anvil.py +0 -0
  16. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/environment/defaultPC.py +0 -0
  17. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/__init__.py +0 -0
  18. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/basic.py +0 -0
  19. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/log.py +0 -0
  20. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/parser.py +0 -0
  21. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/toml.py +0 -0
  22. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/parsing/utils.py +0 -0
  23. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/shell.py +0 -0
  24. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/strings.py +0 -0
  25. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/typing.py +0 -0
  26. {kbasic-0.3.0 → kbasic-0.3.2}/src/kbasic/user_input.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: kbasic
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Keyan's basic utility functions.
5
5
  Author: Keyan Gootkin
6
6
  Author-email: Keyan Gootkin <keyangootkin@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "kbasic"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Keyan's basic utility functions."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -8,4 +8,4 @@ from kbasic.user_input import *
8
8
  from kbasic.Tex import *
9
9
  from kbasic.typing import *
10
10
  from kbasic.vectors import *
11
- from kbasic.parsing import *
11
+ from kbasic.parsing import *
@@ -3,11 +3,12 @@
3
3
  # >-|===|> Imports <|===|-<
4
4
  # !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
5
5
  from typing import Callable
6
- from kbasic.typing import Number, ArrayLike, NDArray
6
+ from kbasic.typing import Number
7
7
  from numpy import argmin, any, all, absolute, hypot, logspace, log10, where, \
8
8
  nanmean, nanmin, nanmax, sqrt, linspace, nanstd, array, isnan, \
9
9
  isfinite, arange, mgrid, r_, c_, zeros, delete, unravel_index
10
10
  from numpy.fft import fftshift, fft2, fftn
11
+ from numpy.typing import ArrayLike, NDArray
11
12
  from scipy.interpolate import RegularGridInterpolator
12
13
  from tqdm import tqdm
13
14
 
@@ -28,9 +28,9 @@ def hamilton_product(q1, q2):
28
28
  class VectorBase:
29
29
  def __init__(self, *components) -> None:
30
30
  match components[0]:
31
- case x if type(x) in Number.types:
31
+ case Number():
32
32
  self.components = components
33
- case x if type(x) in Array.types:
33
+ case Array():
34
34
  self.components = tuple(array(x) for x in components)
35
35
  case Generator():
36
36
  self.components = tuple(components[0])
@@ -77,15 +77,15 @@ class VectorBase:
77
77
  match other:
78
78
  case VectorBase():
79
79
  return Vector(xs+xo for xs, xo in zip(self.components, other.components))
80
- case x if type(x) in Number.types:
80
+ case Number():
81
81
  return Vector(xi+other for xi in self)
82
- case x if type(x) in Array.types:
82
+ case Array():
83
83
  return Vector(xs+xo for xs, xo in zip(self.components, other))
84
84
  def __sub__(self, other) -> Self:
85
85
  match other:
86
- case x if type(x) in Number.types:
86
+ case Number():
87
87
  return type(self)(x-other for x in self)
88
- case x if type(x) in Array.types:
88
+ case Array():
89
89
  return type(self)(xs-xo for xs, xo in zip(self.components, other))
90
90
  case VectorBase():
91
91
  return type(self)(xs-xo for xs, xo in zip(self.components, other.components))
@@ -93,23 +93,23 @@ class VectorBase:
93
93
  match other:
94
94
  case VectorBase():
95
95
  return sum(list(c1*c2 for c1,c2 in zip(self, other)), axis=0)
96
- case x if type(x) in Number.types:
96
+ case Number():
97
97
  return type(self)(c*other for c in self)
98
- case x if type(x) in Array.types:
98
+ case Array():
99
99
  return type(self)(c1*c2 for c1, c2 in zip(self, other))
100
100
  def __truediv__(self, other) -> Self:
101
101
  match other:
102
102
  case VectorBase():
103
103
  return Vector(c1 / c2 for c1, c2 in zip(self, other))
104
- case x if type(x) in Number.types:
104
+ case Number():
105
105
  return type(self)(c / other for c in self)
106
- case x if type(x) in Array.types:
106
+ case Array():
107
107
  return type(self)(c1 / c2 for c1, c2 in zip(self, other))
108
108
  def __floordiv__(self, other) -> Self:
109
109
  match other:
110
- case x if type(x) in Number.types:
110
+ case Number():
111
111
  return type(self)(c//other for c in self)
112
- case x if type(x) in Array.types:
112
+ case Array():
113
113
  return type(self)(c1//c2 for c1, c2 in zip(self, other))
114
114
  def __radd__(self, other) -> Self:
115
115
  match other:
@@ -125,15 +125,15 @@ class VectorBase:
125
125
  case _: return self.__mul__(other)
126
126
  def __rtruediv__(self, other) -> Self:
127
127
  match other:
128
- case x if type(x) in Number.types:
128
+ case Number():
129
129
  return type(self)(other/c for c in self)
130
- case x if type(x) in Array.types:
130
+ case Array():
131
131
  return type(self)(c2/c1 for c1, c2 in zip(self, other))
132
132
  def __rfloordiv__(self, other) -> Self:
133
133
  match other:
134
- case x if type(x) in Number.types:
134
+ case Number():
135
135
  return type(self)(other//c for c in self)
136
- case x if type(x) in Array.types:
136
+ case Array():
137
137
  return type(self)(c2//c1 for c1, c2 in zip(self, other))
138
138
  class Vector(VectorBase):
139
139
  def __new__(cls, *components) -> Self: # the vector factory
@@ -145,7 +145,7 @@ class Vector(VectorBase):
145
145
  case (Generator(),):
146
146
  return Vector(tuple(components[0]))
147
147
  # single array
148
- case (x,) if type(x) in Array.types:
148
+ case (Array(),):
149
149
  return Vector(*x)
150
150
  # 2D
151
151
  case (x, y):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes