ProjectPythia / radar-cookbook

A cookbook meant to work with various weather radar data
http://projectpythia.org/radar-cookbook/
Apache License 2.0
10 stars 15 forks source link

Update to latest template, including new binder #91

Closed brian-rose closed 1 year ago

brian-rose commented 1 year ago

This PR brings the repo more or less up to date with the latest Cookbook template, including

plus some minor cosmetic stuff

github-actions[bot] commented 1 year ago

👋 Thanks for opening this PR! The Cookbook will be automatically built with GitHub Actions. To see the status of your deployment, click below. 🔍 Git commit SHA: 6a36d9aae6a4d1e331b276163998169bc06955dd ✅ Deployment Preview URL: In Progress

brian-rose commented 1 year ago

Unclear to me why the execution failed here. The error message is

nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
[50](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:51)
------------------
[51](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:52)
csapr_files = act.discovery.download_data(arm_username,
[52](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:53)
                                          arm_password,
[53](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:54)
                                          datastream,
[54](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:55)
                                          start_date,
[55](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:56)
                                          end_date,
[56](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:57)
                                         )
[57](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:58)
------------------
[58](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:59)

[59](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:60)

[60](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:61)
---------------------------------------------------------------------------
[61](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:62)
TypeError                                 Traceback (most recent call last)
[62](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:63)
Cell In[3], line 1
[63](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:64)
----> 1 csapr_files = act.discovery.download_data(arm_username,
[64](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:65)
      2 arm_password,
[65](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:66)
      3 datastream,
[66](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:67)
      4 start_date,
[67](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:68)
      5 end_date,
[68](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:69)
      6 )
[69](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:70)

[70](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:71)
File /usr/share/miniconda3/envs/radar-cookbook-dev/lib/python3.9/site-packages/act/discovery/get_armfiles.py:115, in download_data(username, token, datastream, startdate, enddate, time, output)
[71](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:72)
    111     end = f'&end={end}'
[72](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:73)
    112 # build the url to query the web service using the arguments provided
[73](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:74)
    113 query_url = (
[74](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:75)
    114     'https://adc.arm.gov/armlive/livedata/query?' + 'user={0}&ds={1}{2}{3}&wt=json'
[75](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:76)
--> 115 ).format(':'.join([username,token]), datastream, start, end)
[76](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:77)
    117 # get url response, read the body of the message,
[77](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:78)
    118 # and decode from bytes type to utf-8 string
[78](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:79)
    119 response_body = urlopen(query_url).read().decode('utf-8')
[79](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:80)

[80](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:81)
TypeError: sequence item 0: expected str instance, NoneType found
[81](https://github.com/ProjectPythia/radar-cookbook/actions/runs/5282824507/jobs/9558245734#step:17:82)
brian-rose commented 1 year ago

Actually it is clear -- it's because we set the sphinx flag

nb_execution_raise_on_error: true

to catch run-time errors in the notebooks.

The same error appears in the published Cookbook here

@mgrover1 this looks like a bug in the Python code to me, but maybe it's actually a problem with the secrets? Thoughts?

brian-rose commented 1 year ago

Actually it is clear -- it's because we set the sphinx flag

nb_execution_raise_on_error: true

to catch run-time errors in the notebooks.

The same error appears in the published Cookbook here

@mgrover1 this looks like a bug in the Python code to me, but maybe it's actually a problem with the secrets? Thoughts?

I'm getting myself up to speed on how the secrets get passed around in these workflows. I see now that the error is probably caused by a missing secret, and the this is expected when running a PR from a fork because we don't have access to the secret in this context.

But the same error appears in the published rendered cookbook. I'll open a separate issue about that.