Closed Roanol closed 1 year ago
Please, copy the stack trace of the exception here for diagnosing the problem.
Traceback (most recent call last):
File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\interactiveshell.py", line 3508, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "C:\Users\ANDRES OLIVERO\AppData\Local\Temp\ipykernel_25752\2989687894.py", line 1, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\interactiveshell.py", line 2105, in showtraceback stb = self.InteractiveTB.structured_traceback( File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 1396, in structured_traceback return FormattedTB.structured_traceback( File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 1287, in structured_traceback return VerboseTB.structured_traceback( File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 1140, in structured_traceback formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context, File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 1055, in format_exception_as_a_whole frames.append(self.format_record(record)) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 955, in format_record frame_info.lines, Colors, self.has_colors, lvals File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\IPython\core\ultratb.py", line 778, in lines return self._sd.lines File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\utils.py", line 144, in cached_property_wrapper value = obj.dict[self.func.name] = self.func(obj) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\core.py", line 734, in lines pieces = self.included_pieces File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\utils.py", line 144, in cached_property_wrapper value = obj.dict[self.func.name] = self.func(obj) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\core.py", line 681, in included_pieces pos = scope_pieces.index(self.executing_piece) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\utils.py", line 144, in cached_property_wrapper value = obj.dict[self.func.name] = self.func(obj) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\stack_data\core.py", line 660, in executing_piece return only( File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\executing\executing.py", line 182, in only if isinstance(it, Sized): File "C:\Users\ANDRES OLIVERO\AppData\Local\Programs\Python\Python38\lib\typing.py", line 769, in instancecheck return self.subclasscheck(type(obj)) File "C:\Users\ANDRES OLIVERO\AppData\Local\Programs\Python\Python38\lib\typing.py", line 774, in subclasscheck return issubclass(cls, self.origin) File "C:\Users\ANDRES OLIVERO\AppData\Local\Programs\Python\Python38\lib\abc.py", line 102, in subclasscheck return _abc_subclasscheck(cls, subclass) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\typing_extensions.py", line 583, in subclasscheck return super().subclasscheck(other) File "C:\Users\ANDRES OLIVERO\AppData\Local\Programs\Python\Python38\lib\abc.py", line 102, in subclasscheck return _abc_subclasscheck(cls, subclass) File "c:\Users\ANDRES OLIVERO\Documents\Repos\Environments\functional_analysis\lib\site-packages\typing_extensions.py", line 639, in _proto_hook raise TypeError("Instance and class checks can only be used with" TypeError: Instance and class checks can only be used with @runtime_checkable protocols
As you can see its in any kind of plot
What is the version of the typing_extensions
package?
typing_extensions==4.6.2
I was able to reproduce it and I am trying to solve this. As a stopgap measure you can downgrade that package to version 4.3, which worked well.
thanks!
I traced this to a bug in the module typing_extensions (https://github.com/python/typing_extensions/issues/207), which in turn was caused by copying buggy behavior from Python 3.11 (https://github.com/python/cpython/issues/105144).
The authors of typing_extensions have updated their package to version 4.6.3, which should solve this issue. Please, tell me if that works for you.
I came across the same issue and can confirm that upgrading typing-extensions to the latest version solves issue.
I will close the issue then, since it seems to be solved.
Describe the bug
when trying to plot it raises: TypeError("Instance and class checks can only be used with" TypeError: Instance and class checks can only be used with @runtime_checkable protocols
To Reproduce
any of the examples
from skfda import datasets from skfda.exploratory.depth import ModifiedBandDepth, IntegratedDepth from skfda.exploratory.visualization import Boxplot
import matplotlib.pyplot as plt import numpy as np
X, y = datasets.fetch_weather(return_X_y=True, as_frame=True) fd = X.iloc[:, 0].values fd_temperatures = fd.coordinates[0]
colormap = plt.cm.get_cmap('seismic') label_names = y.values.categories nlabels = len(label_names) label_colors = colormap(np.arange(nlabels) / (nlabels - 1))
fd_temperatures.plot(group=y.values.codes, group_colors=label_colors, group_names=label_names)
Expected behavior
Ploting something
Version information
Additional context Add any other context about the problem here.