|
1 | | -from .. import axes, cbook |
| 1 | +from .. import axes, docstring, cbook |
2 | 2 | from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes |
3 | 3 | from .polar import PolarAxes |
4 | 4 | from mpl_toolkits.mplot3d import Axes3D |
5 | 5 |
|
6 | 6 |
|
7 | 7 | class ProjectionRegistry: |
8 | | - """ |
9 | | - Manages the set of projections available to the system. |
10 | | - """ |
| 8 | + """A mapping of registered projection names to projection classes.""" |
| 9 | + |
11 | 10 | def __init__(self): |
12 | 11 | self._all_projection_types = {} |
13 | 12 |
|
14 | 13 | def register(self, *projections): |
15 | | - """ |
16 | | - Register a new set of projections. |
17 | | - """ |
| 14 | + """Register a new set of projections.""" |
18 | 15 | for projection in projections: |
19 | 16 | name = projection.name |
20 | 17 | self._all_projection_types[name] = projection |
21 | 18 |
|
22 | 19 | def get_projection_class(self, name): |
23 | | - """ |
24 | | - Get a projection class from its *name*. |
25 | | - """ |
| 20 | + """Get a projection class from its *name*.""" |
26 | 21 | return self._all_projection_types[name] |
27 | 22 |
|
28 | 23 | def get_projection_names(self): |
29 | | - """ |
30 | | - Get a list of the names of all projections currently registered. |
31 | | - """ |
| 24 | + """Return the names of all projections currently registered.""" |
32 | 25 | return sorted(self._all_projection_types) |
33 | 26 |
|
34 | 27 |
|
@@ -68,8 +61,5 @@ def process_projection_requirements(figure, *args, **kwargs): |
68 | 61 | return figure._process_projection_requirements(*args, **kwargs) |
69 | 62 |
|
70 | 63 |
|
71 | | -def get_projection_names(): |
72 | | - """ |
73 | | - Get a list of acceptable projection names. |
74 | | - """ |
75 | | - return projection_registry.get_projection_names() |
| 64 | +get_projection_names = projection_registry.get_projection_names |
| 65 | +docstring.interpd.update(projection_names=get_projection_names()) |
0 commit comments