GithubHelp home page GithubHelp logo

unidata / python-workshop Goto Github PK

View Code? Open in Web Editor NEW
149.0 33.0 123.0 309.45 MB

A series of Jupyter Notebooks on exploring Unidata technology with Python. See website for more information.

Home Page: https://unidata.github.io/unidata-python-workshop/

License: MIT License

Jupyter Notebook 95.48% Python 4.49% Dockerfile 0.03%
python jupyter notebooks atmospheric-science meteorology weather

python-workshop's Introduction

This repository holds the archived content for Unidata's Python Training Workshops.

It has been superseded by Unidata's Python Training repository.

python-workshop's People

Contributors

brianmapes avatar deeplycloudy avatar dopplershift avatar duncombe avatar ethanrd avatar haileyajohnson avatar jcla490 avatar jrleeman avatar jswhit avatar jthielen avatar julienchastang avatar kgoebber avatar lesserwhirls avatar madry avatar mgrover1 avatar mhermida avatar mjames-upc avatar rsignell-usgs avatar shawncheeks avatar wardf avatar zbruick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-workshop's Issues

Set up period?

If we are going to have the users do the install, should we have a set up period scheduled?

get_latest_dods_url fails

the pytds function get_latest_dods_url fails on several datasets, for example:

http://thredds.ucar.edu/thredds/catalog/grib/NCEP/DGEX/CONUS_12km/catalog.xml
http://thredds.ucar.edu/thredds/catalog/grib/NCEP/DGEX/CONUS_12km/files/catalog.xml

http://thredds.ucar.edu/thredds/catalog/nexrad/level2/KFTG/catalog.xml
http://thredds.ucar.edu/thredds/catalog/nexrad/level2/KFTG/20130701/catalog.xml


In [16]: pytds.util.get_latest_dods_url(url)

UnboundLocalError Traceback (most recent call last)
in ()
----> 1 pytds.util.get_latest_dods_url(url)

/Users/sarms/dev/unidata/tds-python-workshop/pytds/util/catalog_util.py in get_latest_dods_url(dataset_url)
76 """Given a top level dataset URL, return the latest dataset."""
77 o = urlparse(dataset_url)
---> 78 resolver = get_resolver_xml_url(dataset_url)
79 latest = None
80 if (resolver is not None):

/Users/sarms/dev/unidata/tds-python-workshop/pytds/util/catalog_util.py in get_resolver_xml_url(dataset_url)
53 latest = s.get("name")
54 latest_base = s.get("base")
---> 55 ds = find_dataset(root,latest)
56 if (ds is not None):
57 # TODO: generalize this to handle relatives paths starting with a '/'

/Users/sarms/dev/unidata/tds-python-workshop/pytds/util/catalog_util.py in find_dataset(root, service_name)
39 return ds
40 else:
---> 41 if find_dataset(ds, service_name) is not None:
42 return find_dataset(ds, service_name)
43

/Users/sarms/dev/unidata/tds-python-workshop/pytds/util/catalog_util.py in find_dataset(root, service_name)
36 for ds in root.findall(xmlns_prefix + 'dataset'):
37 sn = ds.find(xmlns_prefix + "serviceName")
---> 38 if ((sn is not None) and (service_name == sn.text)):
39 return ds
40 else:

UnboundLocalError: local variable 'sn' referenced before assignment

Update notebooks

  • Port syntax, etc. to Python 3
  • Move from pyudl to siphon
  • Make sure they work

Regardless, they should be saved to bring them up to IPython's latest notebook format (and eliminate the scary message when you load them on IPython 3).

Need to check:

  • CompositeRadar.ipynb
  • Geocoded_METAR.ipynb
  • matplotlib.ipynb
  • netcdf-by-coordinates.ipynb
  • numpy.ipynb
  • reading_netCDF.ipynb
  • wms_sample.ipynb
  • writing_netCDF.ipynb

Materials for using WMS

Tracker for reviewing/enhancing materials for Exploring WMS (w/ ncWMS & Cartopy extensions)

Materials for MetPy

Need to create materials for MetPy. Should start with the exercise created for the Users' workshop.

Fix environment instructions.

At a minimum, we need to put back the correct instructions for setting up the ipython/jupyter notebook in our environment. This means installing ipython-notebook rather than a hand accumulated list of tornado, jinja, pyzmq, and ipython, which is no longer accurate.

Better yet, we could restore the instructions to the use conda env create which references the up to date environment.yml file.

Delete cruft

Delete files in github repo that are no longer needed or relevant.

Add some more resources to site

  • Resources on types in Python (mypy, Cython?) Maybe PEPs?
  • Bash config stuff for git prompt modifications
  • git/Python cheatsheet
  • Links to documentation for libraries

vagrant

Decide if we should keep or remove the vagrant material. Also, if interested, I have a Docker container that runs the workshop material. It is quite nice actually, nice and slim.

Add `environment.yml`

We can put all the channels and packages in this file and just use:
conda env create
from the directory with the file. This should prevent having dependencies duplicated everywhere, and ease installation.

matplotlib magic inserted after matplotlib import (numpy notebook)

For some reason this generates an error:

import matplotlib.pyplot as plt
%matplotlib inline
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

but this does not

%matplotlib inline
import matplotlib.pyplot as plt

make sure matplotlib magic is inserted before the matplotlib import

Materials for METAR/Point obs

Tracker for reviewing and enhancing materials for Point observations w/ TDS

This one especially needs some love to make good use of Siphon and get rid of a lot of ugly hand-coding.

Materials for Siphon

Need to create new materials to talk about Siphon. Steal liberally from the existing examples.

binstar -> anaconda

Binstar has been rebranded to anaconda. This means all channel references to conda.binstar.org should be updated to anaconda.org (the former is not working for me today, but I'm not sure if it's a permanent shutdown). Also, the command line tools are under anaconda now, not binstar.

Jupyter Intro Material

  • Need to update to the latest versions from Jupyter
  • No need to experiment with plotting in jupyter-examples/ 3. Plotting.ipynb
  • Eradicate all mention of pylab

Improve query docs

These need the include_inherited (or whatever Sphinx uses) so that the subclasses of DataQuery have a full listing of useful methods. This is especially important given that the subclasses are all over the place.

Notes from Madison workshop

Here's a dump of the notes we took while giving the workshop in Madison; these need to be turned into individual issues at some point:

Workshop notes

TextWrangler for mac if users do not want to use command line - add as a suggestion for mac users? Notepad for windows, gedit for linux?
Types in Python - dangerous or not?
git add - didn’t we already add?
Do not have them make their own plot in the jupyter-examples/ 3. Plotting.ipynb , as this is covered in intro to numpy and matplotlib notebook
intro to numpy and matplotlib notebook - reword the “reduce by faster of three” exercise prompt. Maybe “For each dimension, select every third element”
busted link in “sharing notebooks” jupyter example
Link to Docs
Presenter notes - scope of exercise, how interactive, how detailed

Things to add to site:

Resource on types in Python
Add bash config stuff for git prompt modifications
Find GIT cheat sheet
PEPs dealing with types in base python?
git ssl issues: git -c http.sslVerify=false clone …
Anaconda (old version clashes???)

Day 2:

Might be good to do pythonic data analysis at before read/write netCDF?

Pythonic data analysis
User getting error reading netCDF. LD_LIBRARY_PATH is set to look in several places for libs, and the end result is that it is finding an older copy of HDF5, which is causing it to be loaded instead of the condo version. This causes the notebook kernel to restart when trying to open a netCDf files, due to a library incompatibility.
make variable names and linestyles separate lists (around cell 10 in solutions notebook)? Makes it more readable.
states dict - capital not capitol
show adding scalar to array with units.
MetPy Units and Upper Air
Remove StringIO from import in cell 2
add hodograph
Siphon HRRR Carroty
list variables from ncss object: ncss.variables
MetPy Surface
Delete time delta from “now”
Radar
Sort stations
Remove carroty bug code

Round 2:

Day 1:

pint<0.7 in environment.yml -> version needs to go
Why isn’t the interactive widgets (or all from jupyter) example more domain specific?
Seriously, we need to murder pylab from the jupyter examples
We should also try to standardize a few more things in the notebooks (subplots vs. add_subplots vs. axes())

Siphon Carroty HRRR

remove calls to plot and use ax, fig objects instead

add colorer and label

ax.set_title("time[t_step].isoformat()")

cax = fig.colorbar(mesh)

cax.set_label(ncvar.units)

Pythonic data analysis lists language features, then jumps into an advanced Matplotlib example with no warning—need to tie that first section into introduction

Ryan really needs to re-examine exercise questions

The workshop page should have a top-level set of resources, cheatsheets, and links to relevant documentation for numpy, matplotlib, metpy, etc.

Why Vagrant instead of native Anaconda install?

For the workshop, why have folks use a virtual machine via Vagrant instead of native Anaconda install? Is it because you are using conda modules that are not built yet for Mac and/or Windows?
If so, which ones haven't been built yet?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.