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

Input data selection error in jupyter notebook #18

Open
polaya07 opened this issue Nov 30, 2023 · 1 comment
Open

Input data selection error in jupyter notebook #18

polaya07 opened this issue Nov 30, 2023 · 1 comment
Assignees

Comments

@polaya07
Copy link
Contributor

When running the main jupyter notebook, there are two issues:

  1. The input data selection cell throws and error:
%cd $note_START
display(sm_widg)
print('Insert the name of the Covariates')
display(cov_widg)
reg_acc = region_widget(reg_type_acc)

Error

%cd $note_START

display(sm_widg)

print('Insert the name of the Covariates')

display(cov_widg)

reg_acc = region_widget(reg_type_acc)

/home/jovyan/work/SOMOSPIE

BoundedIntText(value=2017, description='Which year do you want to use?', max=2017, min=2017)

Insert the name of the Covariates

Accordion(children=(VBox(children=(HBox(children=(Checkbox(value=True), Label(value='CONUS_DEM1km'))), HBox(ch…

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[18], line 5
      3 print('Insert the name of the Covariates')
      4 display(cov_widg)
----> 5 reg_acc = region_widget(reg_type_acc)

File ~/work/SOMOSPIE/code/workflow_jupyter-notebook/utils.py:641, in region_widget(reg_type_acc)
    638 # Of the VBoxes within the accordion that have a list of Checkbox options, 
    639 #  check the first of the first by default.
    640 for i in range(len(reg_acc.children)):
--> 641     if reg_acc._titles[str(i)]!="BOX":
    642         reg_acc.children[i].children[0].children[0].value = True
    643         break

AttributeError: 'Accordion' object has no attribute '_titles'
  1. When the default soil moisture data is already downloaded, cell 5 in the notebook fails.
%cd $note_START
sm_widg = SoilMoistureData(sm_widgets)

Perhaps a solution is to get a nicer message message in that download function so people don't think that it's failing.

This is the container environment I'm running in:
Container: https://hub.docker.com/r/globalcomputinglab/somospie

@glaboy-vol
Copy link
Collaborator

Has to do with the docker version of SOMOSPIE pulling a more updated version of the ipywidgets library that changes how the Accordion title object is accessed. Can be fixed by either:
a) Forcing docker version to use older version of ipywidgets library
b) Changing access to title variable by Accordion object

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

3 participants