Teradata / jupyter-demos

14 stars 16 forks source link

Create ReadOnly notebooks Pass 1 #333

Open DougEbel opened 1 year ago

DougEbel commented 1 year ago

We want a set of read-only notebooks that are saved with populated content and put only into the ReadOnly branch of github. That branch is never to be merged to main, but will leverage the files that are in main. To see the files, in Terminal issue:

git switch ReadOnly find . -name 'Pop*.ipynb'

The notebooks with populated output should be saved with a "Pop_" prefix. I'm started with a partial list of notebooks to process to check out the process and ask for your recommendations.

While on the ReadOnly branch, Run notebooks from the list below. (Use the >> icon at the top of Jupyter to run all steps automatically. You'll just need to respond to the password. Then, page through the notebook to ensure there were no failures, and save the notebook with the prefix "Pop_" followed by the existing notebook name. As a result, your directories should look something like:

(base) jovyan@312b5e287f52:~/JupyterLabRoot$ ls ./UseCases/Telco_Network_Coverage -l total 11460 drwx------ 2 jovyan 1000 4096 Jul 3 13:53 data -rw-r--r-- 1 jovyan users 11701799 Jul 4 16:59 Pop_Telco_Network_Coverage_PY_SQL.ipynb -rw-rw-r-- 1 jovyan 1000 25816 Jul 3 13:53 Telco_Network_Coverage_PY_SQL.ipynb

Given the naming pattern, when you've made a number of populated notebooks,(while still on ReadOnly branch) you can use: (example):

git add UseCases/Telco_Network_Coverage/Pop_Telco_Network_Coverage_PY_SQL.ipynb git commit -m "creating populated note book versions" git push

New notebooks may be added to main causing the ReadOnly branch to be behind and not showing the latest notebooks. To get the ReadOnly branch to be up-to-date with main, I've been using:

git pull git checkout ReadOnly git reset --hard origin/main git pull .... you will need to add a comment because it acts like a commit git push

(The above may be streamlined with some more testing).

The resulting URL: https://nbviewer.org/github/Teradata/jupyter-demos/blob/b9b38ef5cffee1f3bd5e2d9991a9bf96fd90ac51/UseCases/Telco_Network_Coverage/Pop_Telco_Network_Coverage_PY_SQL.ipynb

In github, switch to the ReadOnly Branch, navigate to the Pop file and on the 3-dot menu in the upper right, get a Perm Link. That will be something like: https://github.com/Teradata/jupyter-demos/blob/b9b38ef5cffee1f3bd5e2d9991a9bf96fd90ac51/UseCases/Telco_Network_Coverage/Pop_Telco_Network_Coverage_PY_SQL.ipynb

You need to strip the front of the perm link and add https://nbviews/github

The starting list of notebooks to convert:

Air Passenger Forecasting Anomaly Detection Banking Customer Churn Basic Jupyter Navigation Battery Defect Analysis Broken Digital Journey Car Complaints Carbon Footprint Analytics Charting and Visualization Consumer Complaints Credit Card Data Preparation Customer Behavior Analysis (PY_SQL) Customer Behavior Analysis (Python)

... there could be challenges in the URL containing ( and )

nupur-lal commented 1 year ago

updated the branch with above read only notebooks