You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can easily test this going here and following the steps outlined there. If you skip the step specifying the numpy version, you'll see the error.
Full traceback seen when initiating animation when using Numpy 2.1.1
Even when ipympl is installed, working, and specified and you use the version of Hypertools obtained with `pip install git+https://github.com/ContextLab/hypertools.git`, you'll see the following whether using Python 3.11 or 3.10:
---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
CellIn[1], line64importnumpyasnp5arr=np.array( [[math.sin(3*i[/100](https://hub.ovh2.mybinder.org/100)), math.cos (3*i[/100](https://hub.ovh2.mybinder.org/100)), (1[/100](https://hub.ovh2.mybinder.org/100))**2, (i[/100](https://hub.ovh2.mybinder.org/100))**3, 1[/](https://hub.ovh2.mybinder.org/)(1+i[/100](https://hub.ovh2.mybinder.org/100))] foriinrange(0,300)])
---->6hyp.plot(arr, animate=True)
File [/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/plot/backend.py:1070](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/plot/backend.py#line=1069), in manage_backend.<locals>.plot_wrapper(*args, **kwargs)1067ifBACKEND_WARNINGisnotNone:
1068warnings.warn(BACKEND_WARNING)
->1070returnplot_func(*args, **kwargs)
1072finally:
1073# restore rcParams prior to plot1074withwarnings.catch_warnings():
1075# if the matplotlibrc was cached from <=v3.3.0, a TON of1076# (harmless as of v3.2.0) MatplotlibDeprecationWarnings1077# about `axes.Axes3D`-related rcParams fields are issuedFile [/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/plot/plot.py:313](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/plot/plot.py#line=312), in plot(x, fmt, marker, markers, linestyle, linestyles, color, colors, palette, group, hue, labels, legend, title, size, elev, azim, ndims, model, model_params, reduce, cluster, align, normalize, n_clusters, save_path, animate, duration, tail_duration, rotations, zoom, chemtrails, precog, bullettime, frame_rate, interactive, explore, mpl_backend, show, transform, vectorizer, semantic, corpus, ax, frame_kwargs)311iftransformisNone:
312raw=format_data(x, **text_args)
-->313xform=analyze(
314raw,
315ndims=ndims,
316normalize=normalize,
317reduce=reduce,
318align=align,
319internal=True,
320 )
321else:
322xform=transformFile [/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/tools/analyze.py:53](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/tools/analyze.py#line=52), in analyze(data, normalize, reduce, ndims, align, internal)9""" 10 Wrapper function for normalize -> reduce -> align transformations. 11 (...) 49 50 """52# return processed data--->53returnaligner(reducer(normalizer(data, normalize=normalize, internal=internal),
54reduce=reduce, ndims=ndims, internal=internal), align=align)
File [/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/_shared/helpers.py:159](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/_shared/helpers.py#line=158), in memoize.<locals>.memoizer(*args, **kwargs)157key=str(args) +str(kwargs)
158ifkeynotincache:
-->159cache[key] =obj(*args, **kwargs)
160returncache[key]
File [/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/tools/reduce.py:95](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/hypertools/tools/reduce.py#line=94), in reduce(x, reduce, ndims, normalize, align, model, model_params, internal, format_data)92ifreduceisNone:
93returnx--->95elifisinstance(reduce, (str, np.string_)):
96model_name=reduce97model_params= {
98'n_components': ndims99 }
File [/srv/conda/envs/notebook/lib/python3.11/site-packages/numpy/__init__.py:397](https://hub.ovh2.mybinder.org/srv/conda/envs/notebook/lib/python3.11/site-packages/numpy/__init__.py#line=396), in __getattr__(attr)394raiseAttributeError(__former_attrs__[attr])
396ifattrin__expired_attributes__:
-->397raiseAttributeError(
398f"`np.{attr}` was removed in the NumPy 2.0 release. "399f"{__expired_attributes__[attr]}"400 )
402ifattr=="chararray":
403warnings.warn(
404"`np.chararray` is deprecated and will be removed from "405"the main namespace in the future. Use an array with a string "406"or bytes dtype instead.", DeprecationWarning, stacklevel=2)
AttributeError: `np.string_`wasremovedintheNumPy2.0release. Use`np.bytes_`instead.
The text was updated successfully, but these errors were encountered:
This is a follow-up to Plotting animations do not seem to be compatible with Jupyter Notebook 7; however, I think because the new issue with animations is isolatable to the version of Numpy, it probably deserves its own issue post.
Essentially, if you do as it says in Plotting animations do not seem to be compatible with Jupyter Notebook 7 and specify Numpy to not be above version
1.26.4
, the animation will work.If you leave things unspecified so it gets current Numpy, which is v2.1.1, then you get the following when you run the code:
You can easily test this going here and following the steps outlined there. If you skip the step specifying the numpy version, you'll see the error.
Full traceback seen when initiating animation when using Numpy 2.1.1
Even when ipympl is installed, working, and specified and you use the version of Hypertools obtained with `pip install git+https://github.com/ContextLab/hypertools.git`, you'll see the following whether using Python 3.11 or 3.10:The text was updated successfully, but these errors were encountered: