Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #347 from jrleeman/fix_build
Browse files Browse the repository at this point in the history
Fix Build
  • Loading branch information
jrleeman authored Oct 3, 2018
2 parents 9ca4df0 + 86b65b7 commit 16af18c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ env:
matrix:
- Python=3.5
- Python=3.6
- Python=3.7

before_install:
# Taken from: http://conda.pydata.org/docs/travis.html
Expand Down Expand Up @@ -52,5 +51,5 @@ before_script:
script:
- python notebooks_preprocess.py
- python run_notebooks.py
- python notebooks/Command_Line_Tools/synopticplot.py --gfslevel 850 --gfsfield Relative_humidity_isobaric --savefig --imgformat jpg
#- python notebooks/Command_Line_Tools/synopticplot.py --gfslevel 850 --gfsfield Relative_humidity_isobaric --savefig --imgformat jpg
- python notebooks/Command_Line_Tools/skewt.py --date 20170420 --hour 0 --station BMX --savefig --imgformat jpg
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/Unidata/unidata-python-workshop/master)

[![Travis Status](https://travis-ci.org/Unidata/unidata-python-workshop.svg?branch=master)](https://travis-ci.org/Unidata/unidata-python-workshop)
[![Travis Status](https://api.travis-ci.org/Unidata/unidata-python-workshop.svg?branch=master)](https://travis-ci.org/Unidata/unidata-python-workshop)

[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/rgmgbsv0yia7i0nm?svg=true)](https://ci.appveyor.com/project/Unidata/unidata-python-workshop)

Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ environment:

matrix:
- PYTHON_VERSION: "3.6"
- PYTHON_VERSION: "3.7"

platform:
- x64
Expand Down Expand Up @@ -34,4 +33,4 @@ build: off
test_script:
- cmd: python notebooks_preprocess.py
- cmd: python run_notebooks.py
- cmd: python notebooks/Command_Line_Tools/synopticplot.py --gfslevel 850 --gfsfield Relative_humidity_isobaric --savefig --imgformat jpg
#- cmd: python notebooks/Command_Line_Tools/synopticplot.py --gfslevel 850 --gfsfield Relative_humidity_isobaric --savefig --imgformat jpg
5 changes: 1 addition & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
dependencies:
- python=3
- numpy
- nomkl
- matplotlib
- cartopy
- jupyter
Expand All @@ -18,6 +17,4 @@
- pip
- ffmpeg
- pytest
- pip:
- python-awips
- mpldatacursor
- mplcursors
8 changes: 4 additions & 4 deletions notebooks/Command_Line_Tools/skewt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from metpy.plots import Hodograph, SkewT
from metpy.units import units
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from mpldatacursor import datacursor
import mplcursors
import numpy as np
from siphon.simplewebservice.wyoming import WyomingUpperAir

Expand Down Expand Up @@ -37,8 +37,9 @@ def plot_sounding(date, station):
skew = SkewT(fig)

# Plot the data
skew.plot(p, T, color='tab:red')
skew.plot(p, Td, color='blue')
temperature_line, = skew.plot(p, T, color='tab:red')
dewpoint_line, = skew.plot(p, Td, color='blue')
cursor = mplcursors.cursor([temperature_line, dewpoint_line])

# Plot thermodynamic parameters and parcel path
skew.plot(p, parcel_path, color='black')
Expand Down Expand Up @@ -109,5 +110,4 @@ def plot_sounding(date, station):
datetime.strftime(date, '%Y%m%d_%HZ'),
args.imgformat))
else:
datacursor(formatter=u'{y:.02f} hPa \n{x:.02f}\u00B0C'.format, bbox=dict(fc='white'))
plt.show()
11 changes: 9 additions & 2 deletions notebooks/Model_Output/Downloading model fields with NCSS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,14 @@
"metadata": {},
"outputs": [],
"source": [
"ds['time1']"
"# Figure out if the time is `time` or `time1`\n",
"if 'time' in ds.keys():\n",
" time_name = 'time'\n",
"else:\n",
" time_name = 'time1'\n",
"\n",
"# Let's look at the time coordinate\n",
"ds[time_name]"
]
},
{
Expand Down Expand Up @@ -344,7 +351,7 @@
" transform=data_projection, zorder=0)\n",
"ax.contour(longitude, latitude, height_var[time_index].squeeze(), contours, colors='k',\n",
" transform=data_projection, linewidths=2, zorder=1)\n",
"ax.set_title(ds['time1'][time_index].values)\n",
"ax.set_title(ds[time_name][time_index].values)\n",
"\n",
"\\# add some common geographic features\n",
"ax.coastlines(resolution='10m', color='black')\n",
Expand Down
12 changes: 5 additions & 7 deletions notebooks/Time_Series/Basic Time Series Plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
"## Obtaining Data\n",
"To learn about time series analysis, we first need to find some data and get it into Python. In this case we're going to use data from the [National Data Buoy Center](http://www.ndbc.noaa.gov). We'll use the [pandas](http://pandas.pydata.org) library for our data subset and manipulation operations after obtaining the data with siphon. \n",
"\n",
"In this case, we'll look at data from Hurricane Lane as it passed Hawaii.\n",
"\n",
"Each buoy has many types of data availabe, you can read all about it in the [NDBC Web Data Guide](https://www.ndbc.noaa.gov/docs/ndbc_web_data_guide.pdf). There is a mechanism in siphon to see which data types are available for a given buoy."
]
},
Expand All @@ -60,7 +58,7 @@
"source": [
"from siphon.simplewebservice.ndbc import NDBC\n",
"\n",
"data_types = NDBC.buoy_data_types('51002')\n",
"data_types = NDBC.buoy_data_types('46042')\n",
"print(data_types)"
]
},
Expand All @@ -77,7 +75,7 @@
"metadata": {},
"outputs": [],
"source": [
"df = NDBC.realtime_observations('51002')"
"df = NDBC.realtime_observations('46042')"
]
},
{
Expand Down Expand Up @@ -163,8 +161,8 @@
"metadata": {},
"outputs": [],
"source": [
"from datetime import datetime\n",
"idx = (df.time >= datetime(2018, 8, 21)) & (df.time <= datetime(2018, 8, 27))\n",
"from datetime import datetime, timedelta\n",
"idx = df.time >= (datetime.utcnow() - timedelta(days=7))\n",
"df = df[idx]\n",
"df.head()"
]
Expand Down Expand Up @@ -500,7 +498,7 @@
"\\# Same as above\n",
"myax.set_xlabel('Time')\n",
"myax.set_ylabel('Wave Height (m)')\n",
"myax.set_title('Buoy 41056 Data')\n",
"myax.set_title('Buoy Data')\n",
"myax.grid(True)\n",
"\n",
"\\# Plotting on the first y-axis\n",
Expand Down

0 comments on commit 16af18c

Please sign in to comment.