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

UW sounding regions #199

Merged
merged 2 commits into from Mar 30, 2018
Merged

Conversation

jrleeman
Copy link
Contributor

Closes #176 and improves the region functionality. Users can specify human readable names instead of the abbreviations (which aren't listed anywhere I've found). The region will also be case insensitive. Adds a test for making sure the region is valid or a helpful KeyError is raised.

@jrleeman jrleeman added this to the 0.7 milestone Mar 27, 2018
Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor things.

try:
region = regions[region.lower()]
except KeyError:
raise(KeyError('Invalid region {}. Valid regions are '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise is not a function. Also, the indentation should line up with the ' in KeyError('.

region (optional) : str
Region for the sounding data. Valid regions are `North America`,
`South America`, `South Pacific`, `New Zealand`, `Antarctica`,
`Arctic`, `Europe`, `Africa`, `Southeast Asia`, `Mideast` Defaults
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Period after Mideast. Also, should probably replace backticks with single quotes...I think.

@jrleeman
Copy link
Contributor Author

Interestingly enough, no matter what the region is, you can get data for any station anywhere. I believe this is a fluke in the web API as I verified the behavior in the browser. Selecting a region changes the map, but doesn't appear to actually limit the station search area in the database. We should probably ping Larry on this.

try:
region = regions[region.lower()]
except KeyError:
raise KeyError("Invalid region {}. Valid regions are 'North America'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably raise a ValueError instead of KeyError, since the error is that the user passed in a bad value.

@jrleeman jrleeman force-pushed the UW_Sounding_Regions branch 2 times, most recently from d101e02 to 5989bbd Compare March 30, 2018 17:10
dopplershift
dopplershift previously approved these changes Mar 30, 2018
@jrleeman
Copy link
Contributor Author

Larry says they do not use region except for the map on the website, so we don't need the ability to pass it. I've just defaulted to naconf and removed the ability to specify a region.

@dopplershift dopplershift merged commit 0d72c80 into Unidata:master Mar 30, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants