Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Jupyter Notebook 08 #43

Open
mathieuboudreau opened this issue Feb 14, 2023 · 2 comments
Open

Bug in Jupyter Notebook 08 #43

mathieuboudreau opened this issue Feb 14, 2023 · 2 comments
Assignees

Comments

@mathieuboudreau
Copy link
Collaborator

For some reason, the two cells for Deep GM where

plot_single_scatter(x=indexes_numbers, ...

is run, there is an error, but it doesn't occur for the three other ROI types.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_236/1609318161.py in <module>
----> 1 fig_id = plot_single_scatter(x=indexes_numbers,
      2                              y=deepgm_estimate,
      3                              y_std=deepgm_std,
      4                              title='Deep GM',
      5                              x_label='Site #',

/tmp/ipykernel_236/1687494210.py in plot_single_scatter(x, y, y_std, title, x_label, y_label, file_prefix, folder_path, fig_id, y_type)
      3                         file_prefix, folder_path, fig_id,
      4                         y_type):
----> 5     plt.errorbar(x,y, y_std, fmt='o', solid_capstyle='projecting')
      6     plt.title(title)
      7     plt.xlabel(x_label)

/opt/conda/lib/python3.9/site-packages/matplotlib/pyplot.py in errorbar(x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, data, **kwargs)
   2519         uplims=False, xlolims=False, xuplims=False, errorevery=1,
   2520         capthick=None, *, data=None, **kwargs):
-> 2521     return gca().errorbar(
   2522         x, y, yerr=yerr, xerr=xerr, fmt=fmt, ecolor=ecolor,
   2523         elinewidth=elinewidth, capsize=capsize, barsabove=barsabove,

/opt/conda/lib/python3.9/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1410     def inner(ax, *args, data=None, **kwargs):
   1411         if data is None:
-> 1412             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1413 
   1414         bound = new_sig.bind(ax, *args, **kwargs)

/opt/conda/lib/python3.9/site-packages/matplotlib/axes/_axes.py in errorbar(self, x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, **kwargs)
   3458             low, high = dep + np.row_stack([-(1 - lolims), 1 - uplims]) * err
   3459 
-> 3460             barcols.append(lines_func(
   3461                 *apply_mask([indep, low, high], everymask), **eb_lines_style))
   3462             # Normal errorbars for points without upper/lower limits.

/opt/conda/lib/python3.9/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1410     def inner(ax, *args, data=None, **kwargs):
   1411         if data is None:
-> 1412             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1413 
   1414         bound = new_sig.bind(ax, *args, **kwargs)

/opt/conda/lib/python3.9/site-packages/matplotlib/axes/_axes.py in vlines(self, x, ymin, ymax, colors, linestyles, label, **kwargs)
   1140 
   1141         if len(x) > 0:
-> 1142             minx = x.min()
   1143             maxx = x.max()
   1144             miny = min(ymin.min(), ymax.min())

/opt/conda/lib/python3.9/site-packages/numpy/ma/core.py in min(self, axis, out, fill_value, keepdims)
   5698         # No explicit output
   5699         if out is None:
-> 5700             result = self.filled(fill_value).min(
   5701                 axis=axis, out=out, **kwargs).view(type(self))
   5702             if result.ndim:

/opt/conda/lib/python3.9/site-packages/numpy/core/_methods.py in _amin(a, axis, out, keepdims, initial, where)
     42 def _amin(a, axis=None, out=None, keepdims=False,
     43           initial=_NoValue, where=True):
---> 44     return umr_minimum(a, axis, None, out, keepdims, initial, where)
     45 
     46 def _sum(a, axis=None, dtype=None, out=None, keepdims=False,

TypeError: '<=' not supported between instances of 'str' and 'float'

Commenting out these cells could be a quick temporary fix (the notebook doesn't run fully otherwise).

@mathieuboudreau mathieuboudreau self-assigned this Feb 14, 2023
@agahkarakuzu
Copy link
Collaborator

agahkarakuzu commented Feb 14, 2023

Is the cast type of deepgm_estimate are different than the ones that work (i.e., wm_estimate)? Probably the lists or the dataframe slices contain mixed types, casting entries to a unified type would solve the issue.

@mathieuboudreau
Copy link
Collaborator Author

I looked at the values and it all looked the same to me (which they should), but maybe there's a NaN or something that I missed. Must of had a change in behaviour in one of the underlying requirement packages (numpy?) in a recent version that broke it, as the notebooks worked as-is previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants