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

Moved the nightshade implementation into a feature. #1181

Merged
merged 5 commits into from
Nov 14, 2018

Conversation

pelson
Copy link
Member

@pelson pelson commented Nov 13, 2018

Rationale

Creates a Nightshade feature that can be added to a cartopy GeoAxes, rather than a .nightshade method on the GeoAxes. (follow up to #1135)
The reason is one of cleanliness on the GeoAxes API, as well as a better abstraction for future cartopy growth (e.g. alternative backends)

Implications

  • cartopy/feature.py moved to cartopy/feature/__init__.py
  • cartopy/mpl/_solar.py inlined into cartopy/feature/nightshade.py (solar physics don't need to belong in a matplotlib interface)
  • adding a nightshade to a GeoAxes now looks like:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cartopy.feature.nightshade import Nightshade


ax = plt.axes(projection=ccrs.PlateCarree())
ax.add_feature(Nightshade())
plt.show()

@pelson pelson added this to the 0.17 milestone Nov 13, 2018
lib/cartopy/feature/nightshade.py Outdated Show resolved Hide resolved
lib/cartopy/tests/mpl/test_nightshade.py Show resolved Hide resolved
lib/cartopy/feature/nightshade.py Outdated Show resolved Hide resolved
lib/cartopy/feature/nightshade.py Outdated Show resolved Hide resolved
@dopplershift
Copy link
Contributor

👍 to making this a feature.

…shade, and improved the docstrings for the new functionality.
@pelson
Copy link
Member Author

pelson commented Nov 14, 2018

OK. Ready for final review I think.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

One minor fix.

lib/cartopy/examples/nightshade.py Outdated Show resolved Hide resolved
@QuLogic QuLogic merged commit f918d97 into SciTools:master Nov 14, 2018
@pelson pelson deleted the nightshade_feature branch November 14, 2018 06:27
@pelson
Copy link
Member Author

pelson commented Nov 14, 2018

Thanks for the review @QuLogic. Very happy to see this as a feature 👍

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.

4 participants