kbasic 0.1.6__tar.gz → 0.1.7__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.
- {kbasic-0.1.6 → kbasic-0.1.7}/PKG-INFO +1 -1
- {kbasic-0.1.6 → kbasic-0.1.7}/pyproject.toml +1 -1
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/array.py +11 -2
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/shell.py +13 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/README.md +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/Tex.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/__init__.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/audio/__init__.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/audio/lib/Caroline Rose - year of the slug - 01 everything in its right place.wav +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/audio/lib/success.mp3 +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/audio/sound.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/bar.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/parsing.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/typing.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/user_input.py +0 -0
- {kbasic-0.1.6 → kbasic-0.1.7}/src/kbasic/vectors.py +0 -0
|
@@ -56,7 +56,8 @@ def nan_clip(*args):
|
|
|
56
56
|
return nanless_args
|
|
57
57
|
def interpolate2d(
|
|
58
58
|
data, factor: int,
|
|
59
|
-
method: str = 'linear'
|
|
59
|
+
method: str = 'linear',
|
|
60
|
+
periodic: bool = True
|
|
60
61
|
) -> ndarray:
|
|
61
62
|
"""interpolate 2d data on a regular grid by an even factor
|
|
62
63
|
|
|
@@ -68,8 +69,16 @@ def interpolate2d(
|
|
|
68
69
|
Returns:
|
|
69
70
|
ndarray[ndarray]: an interpolated grid of data
|
|
70
71
|
"""
|
|
72
|
+
assert periodic, "non-periodic version not implemented yet! make one but be careful because the shapes will be awkward"
|
|
71
73
|
Nx, Ny = array(data).shape
|
|
72
|
-
|
|
74
|
+
grid = (arange(Nx+1), arange(Ny+1))
|
|
75
|
+
data_repeat = np.zeros((Nx+1, Ny+1))
|
|
76
|
+
data_repeat[:Nx, :Ny] = data
|
|
77
|
+
data_repeat[-1,:-1] = data[0]
|
|
78
|
+
data_repeat[:-1,-1] = data[:,0]
|
|
79
|
+
data_repeat[-1,-1] = data[-1,-1]
|
|
80
|
+
new_grid = mgrid[:Nx:1/factor, :Ny:1/factor].T
|
|
81
|
+
return RegularGridInterpolator(grid, data_repeat, method=method)(new_grid).T
|
|
73
82
|
|
|
74
83
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
75
84
|
# >-|===|> Decorators <|===|-<
|
|
@@ -59,6 +59,19 @@ qs = anvil_queue
|
|
|
59
59
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
60
60
|
# >-|===|> Classes <|===|-<
|
|
61
61
|
# !==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==!==
|
|
62
|
+
class Color:
|
|
63
|
+
HEADER = '\033[95m'
|
|
64
|
+
OKBLUE = '\033[94m'
|
|
65
|
+
OKCYAN = '\033[96m'
|
|
66
|
+
OKGREEN = '\033[92m'
|
|
67
|
+
WARNING = '\033[93m'
|
|
68
|
+
FAIL = '\033[91m'
|
|
69
|
+
ENDC = '\033[0m'
|
|
70
|
+
BOLD = '\033[1m'
|
|
71
|
+
UNDERLINE = '\033[4m'
|
|
72
|
+
def warn(self, text: str):
|
|
73
|
+
print(self.WARNING + text + self.ENC)
|
|
74
|
+
|
|
62
75
|
class AnvilJob:
|
|
63
76
|
def __init__(self, queue_row: str, sep="DISTINCTSEPERATOR"):
|
|
64
77
|
self.sep = sep
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|