scatter3d-anywidget 0.1.10__tar.gz → 0.1.12__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.
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/PKG-INFO +3 -3
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/pyproject.toml +2 -2
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/scatter3d.py +45 -4
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/README.md +0 -0
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/__init__.py +0 -0
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/static/scatter3d.js +0 -0
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/static/scatter3d.js.map +0 -0
- {scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/widget_test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: scatter3d-anywidget
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Summary: 3D scatter widget with lasso selection
|
|
5
5
|
License: MIT
|
|
6
6
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -10,8 +10,8 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
10
10
|
Classifier: Intended Audience :: Science/Research
|
|
11
11
|
Classifier: Topic :: Scientific/Engineering :: Visualization
|
|
12
12
|
Requires-Dist: anywidget>=0.9.21
|
|
13
|
-
Requires-Dist: narwhals
|
|
14
|
-
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: narwhals==2.6.0
|
|
14
|
+
Requires-Dist: numpy==2.0.2
|
|
15
15
|
Requires-Python: >=3.12
|
|
16
16
|
Project-URL: Homepage, https://github.com/JoseBlanca/any_scatter3d
|
|
17
17
|
Project-URL: Repository, https://github.com/JoseBlanca/any_scatter3d
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "scatter3d-anywidget"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.12"
|
|
4
4
|
description = "3D scatter widget with lasso selection"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
7
7
|
license = { text = "MIT" }
|
|
8
|
-
dependencies = ["anywidget>=0.9.21", "narwhals
|
|
8
|
+
dependencies = ["anywidget>=0.9.21", "narwhals==2.6.0", "numpy==2.0.2"]
|
|
9
9
|
classifiers = [
|
|
10
10
|
"Development Status :: 3 - Alpha",
|
|
11
11
|
"License :: OSI Approved :: MIT License",
|
|
@@ -158,10 +158,51 @@ class Category:
|
|
|
158
158
|
return label_coding
|
|
159
159
|
|
|
160
160
|
def _encode_values(self, values):
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
mapping = self._label_coding
|
|
162
|
+
if mapping is None:
|
|
163
|
+
raise RuntimeError("label coding should be set, but it is not")
|
|
164
|
+
|
|
165
|
+
# Fast-path: no labels => everything is "unassigned" (0).
|
|
166
|
+
# Also avoids Narwhals 2.6.0 pandas replace_strict merge bugs with empty mapping.
|
|
167
|
+
if len(mapping) == 0:
|
|
168
|
+
# preserve length
|
|
169
|
+
n = int(values.len()) if hasattr(values, "len") else len(values.to_native())
|
|
170
|
+
self._coded_values = numpy.zeros(n, dtype=numpy.uint16)
|
|
171
|
+
return
|
|
172
|
+
|
|
173
|
+
# Narwhals 2.6.0 + pandas backend: replace_strict breaks if series.name is None
|
|
174
|
+
if values.name is None:
|
|
175
|
+
tmp_name = "__scatter3d_tmp_category__"
|
|
176
|
+
if values.implementation == narwhals.Implementation.PANDAS:
|
|
177
|
+
native = values.to_native()
|
|
178
|
+
# native is a pandas.Series
|
|
179
|
+
native = native.rename(tmp_name)
|
|
180
|
+
values = narwhals.from_native(native, series_only=True)
|
|
181
|
+
else:
|
|
182
|
+
# rebuild as a named Narwhals series for other backends
|
|
183
|
+
# (to_native may return a backend-native Series; name handling varies)
|
|
184
|
+
arr = values.to_numpy()
|
|
185
|
+
values = narwhals.new_series(
|
|
186
|
+
name=tmp_name, values=arr, backend=values.implementation
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
try:
|
|
190
|
+
# Newer Narwhals path
|
|
191
|
+
coded = values.replace_strict(
|
|
192
|
+
mapping, default=0, return_dtype=narwhals.UInt16
|
|
193
|
+
)
|
|
194
|
+
self._coded_values = coded.to_numpy()
|
|
195
|
+
return
|
|
196
|
+
except TypeError as e:
|
|
197
|
+
if "default" not in str(e):
|
|
198
|
+
raise
|
|
199
|
+
|
|
200
|
+
# Narwhals 2.6.0 path: no default; fill nulls after strict replace
|
|
201
|
+
coded = values.replace_strict(mapping, return_dtype=narwhals.UInt16)
|
|
202
|
+
|
|
203
|
+
# fill_null exists on many backends; if it doesn't, fall back to numpy fill
|
|
204
|
+
coded = coded.fill_null(0)
|
|
205
|
+
self._coded_values = coded.to_numpy()
|
|
165
206
|
|
|
166
207
|
@property
|
|
167
208
|
def values(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scatter3d_anywidget-0.1.10 → scatter3d_anywidget-0.1.12}/src/scatter3d/static/scatter3d.js.map
RENAMED
|
File without changes
|
|
File without changes
|