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

Cherry pick #729 to demo #737

Merged
merged 11 commits into from
Jan 11, 2025
Merged

Conversation

patudom
Copy link
Contributor

@patudom patudom commented Jan 7, 2025

This brings over functionality from #729 (to add "My Age measurement" subset to the class age histogram).

@Carifio24, in Stage 4, the "Shortcut: Jump to Stage 5" button gives this error. Can you please fix the button so it correctly initializes the needed information before moving to Stage 5? (If you go through Stage 4 in sequence, there are no errors going to Stage 5).

Traceback (most recent call last):
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/reacton/core.py", line 1707, in _render
    root_element = el.component.f(*el.args, **el.kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/Documents/GitHub/hubbleds/src/hubbleds/pages/05-class-results-uncertainty/__init__.py", line 299, in Page
    gjapp, viewers = solara.use_memo(glue_setup, dependencies=[])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/reacton/core.py", line 879, in use_memo
    return rc.use_memo(f, dependencies, debug_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/reacton/core.py", line 1244, in use_memo
    value = f()
            ^^^
  File "/Users/Pat/Documents/GitHub/hubbleds/src/hubbleds/pages/05-class-results-uncertainty/__init__.py", line 173, in glue_setup
    layer_viewer.add_data(student_data)
  File "/Users/Pat/Documents/GitHub/cosmicds/src/cosmicds/viewers/viewer.py", line 68, in add_data
    return super().add_data(data, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue_jupyter/view.py", line 118, in add_data
    result = super().add_data(data)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/viewers/common/viewer.py", line 209, in add_data
    layer = get_layer_artist_from_registry(data, self) or self.get_data_layer_artist(data)
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/viewers/common/viewer.py", line 240, in get_data_layer_artist
    return self.get_layer_artist(self._data_artist_cls, layer=layer, layer_state=layer_state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue_jupyter/view.py", line 143, in get_layer_artist
    return cls(self, self.state, layer=layer, layer_state=layer_state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue_plotly/viewers/scatter/layer_artist.py", line 65, in __init__
    super().__init__(
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/viewers/common/layer_artist.py", line 25, in __init__
    self.state = layer_state or self._layer_state_cls(viewer_state=viewer_state,
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/viewers/scatter/state.py", line 344, in __init__
    self._on_layer_change()
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/viewers/scatter/state.py", line 409, in _on_layer_change
    self.cmap_att_helper.set_multiple_data([self.layer])
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/core/data_combo_helper.py", line 322, in set_multiple_data
    self.refresh()
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/core/data_combo_helper.py", line 353, in refresh
    if ((data.get_kind(cid) == 'numerical' and self.numeric) or
         ^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/core/data.py", line 1431, in get_kind
    elif comp.numeric:
         ^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/core/component.py", line 95, in numeric
    return np.can_cast(self[(0,) * self.ndim].dtype, complex)
                       ~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/Pat/anaconda3/envs/common-solara/lib/python3.11/site-packages/glue/core/component.py", line 84, in __getitem__
    return self._data[key]
           ~~~~~~~~~~^^^^^
IndexError: index 0 is out of bounds for axis 0 with size 0

@patudom patudom marked this pull request as ready for review January 11, 2025 00:17
@patudom patudom merged commit 9aae472 into cosmicds:short-demo Jan 11, 2025
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

Successfully merging this pull request may close these issues.

2 participants