U
    \	a                  	   @   s   d dl mZmZ ddlmZmZmZmZ ddlm	Z	 ddl
mZ G dd dZe Zeeje	eeeee d	d
 ZdddZejZejje d dS )   )axes	docstring   )
AitoffAxes
HammerAxesLambertAxesMollweideAxes)	PolarAxes    )Axes3Dc                   @   s0   e Zd ZdZdd Zdd Zdd Zdd	 Zd
S )ProjectionRegistryz?A mapping of registered projection names to projection classes.c                 C   s
   i | _ d S N_all_projection_typesself r   C/tmp/pip-unpacked-wheel-wjyw_3jo/matplotlib/projections/__init__.py__init__
   s    zProjectionRegistry.__init__c                 G   s   |D ]}|j }|| j|< qdS )z"Register a new set of projections.N)namer   )r   Zprojections
projectionr   r   r   r   register   s    zProjectionRegistry.registerc                 C   s
   | j | S )z'Get a projection class from its *name*.r   )r   r   r   r   r   get_projection_class   s    z'ProjectionRegistry.get_projection_classc                 C   s
   t | jS )z9Return the names of all projections currently registered.)sortedr   r   r   r   r   get_projection_names   s    z'ProjectionRegistry.get_projection_namesN)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r      s
   r   c                 C   s   t |  d S r   )projection_registryr   )clsr   r   r   register_projection(   s    r!   Nc              
   C   sN   | dkrd} zt | W S  tk
rH } ztd|  |W 5 d}~X Y nX dS )z|
    Get a projection class from its name.

    If *projection* is None, a standard rectilinear projection is returned.
    NZrectilinearzUnknown projection %r)r   r   KeyError
ValueError)r   errr   r   r   r   ,   s    r   )Zprojection_names)N) r   r   Zgeor   r   r   r   Zpolarr	   Zmpl_toolkits.mplot3dr   r   r   r   ZAxesr!   r   r   Zinterpdupdater   r   r   r   <module>   s$   
