ó
/¾I]c           @   sØ  d  Z  d d l m Z m Z m Z m Z m Z m Z m Z m	 Z	 m
 Z
 d d l m Z d d l m Z m Z d d l m Z d d l m Z m Z d d l m Z d d	 l m Z m Z d
 e e e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e d e f d „  ƒ  Yƒ Z e d e f d „  ƒ  Yƒ Z e d e f d „  ƒ  Yƒ Z e d e f d „  ƒ  Yƒ Z  e d e f d „  ƒ  Yƒ Z! d e f d „  ƒ  YZ" d e" f d „  ƒ  YZ# e d e# f d „  ƒ  Yƒ Z$ d  S(!   s<   Float class.

Represents an unbounded float using a widget.
iÿÿÿÿ(	   t   Instancet   Unicodet   CFloatt   Boolt   CaselessStrEnumt   Tuplet
   TraitErrort   validatet   defaulti   (   t   DescriptionWidget(   t   InstanceDictt   NumberFormat(   t   ValueWidget(   t   registert   widget_serialization(   t
   CoreWidget(   t   ProgressStylet   SliderStylet   _Floatc           B   s2   e  Z e d  d d ƒj d e ƒ Z d d „ Z RS(   g        t   helps   Float valuet   syncc         K   s3   | d  k	 r | | d <n  t t |  ƒ j |   d  S(   Nt   value(   t   Nonet   superR   t   __init__(   t   selfR   t   kwargs(    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR      s    N(   t   __name__t
   __module__R   t   tagt   TrueR   R   R   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR      s   t   _BoundedFloatc           B   sƒ   e  Z e d  d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e d ƒ d „  ƒ Z e d ƒ d	 „  ƒ Z	 e d
 ƒ d „  ƒ Z
 RS(   g      Y@R   s	   Max valueR   g        s	   Min valueR   c         C   sM   | d } |  j  | k s( |  j | k  rI t  t | |  j  ƒ |  j ƒ } n  | S(   s   Cap and floor valueR   (   t   mint   max(   R   t   proposalR   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   _validate_value!   s    
!R    c         C   sG   | d } | |  j  k r( t d ƒ ‚ n  | |  j k rC | |  _ n  | S(   s   Enforce min <= value <= maxR   s   Setting min > max(   R!   R   R   (   R   R"   R    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   _validate_min)   s    
R!   c         C   sG   | d } | |  j  k  r( t d ƒ ‚ n  | |  j k  rC | |  _ n  | S(   s   Enforce min <= value <= maxR   s   setting max < min(   R    R   R   (   R   R"   R!   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   _validate_max3   s    
(   R   R   R   R   R   R!   R    R   R#   R$   R%   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR      s
   
t   _BoundedLogFloatc           B   s¿   e  Z e d  d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e d d d	 ƒj d e ƒ Z e	 d
 ƒ d „  ƒ Z
 e	 d ƒ d „  ƒ Z e	 d ƒ d „  ƒ Z RS(   g      @R   s   Max value for the exponentR   g        s   Min value for the exponentg      $@s   Base of valueg      ð?s   Float valueR   c         C   si   | d } |  j  |  j | k s6 |  j  |  j | k  re t t | |  j  |  j ƒ |  j  |  j ƒ } n  | S(   s   Cap and floor valueR   (   t   baseR    R!   (   R   R"   R   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR#   C   s    
,/R    c         C   sU   | d } | |  j  k r( t d ƒ ‚ n  |  j | |  j k rQ |  j | |  _ n  | S(   s+   Enforce base ** min <= value <= base ** maxR   s   Setting min > max(   R!   R   R'   R   (   R   R"   R    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR$   K   s    
R!   c         C   sU   | d } | |  j  k  r( t d ƒ ‚ n  |  j | |  j k  rQ |  j | |  _ n  | S(   s+   Enforce base ** min <= value <= base ** maxR   s   setting max < min(   R    R   R'   R   (   R   R"   R!   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR%   U   s    
(   R   R   R   R   R   R!   R    R'   R   R   R#   R$   R%   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR&   =   s   
t	   FloatTextc           B   sž   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e e	 d d ƒj d e ƒ Z
 e e	 d d ƒj d e ƒ Z e d	 d e d d ƒj d e ƒ Z RS(
   sj   Displays a float value within a textbox. For a textbox in
    which the value must be within a specific range, use BoundedFloatText.

    Parameters
    ----------
    value : float
        value displayed
    step : float
        step of the increment (if None, any step is allowed)
    description : str
        description displayed next to the text box
    t   FloatTextViewR   t   FloatTextModelR   s   Enable or disable user changessl   Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.t
   allow_nones#   Minimum step to increment the valueN(   R   R   t   __doc__R   R   R   t
   _view_namet   _model_nameR   t   Falset   disabledt   continuous_updateR   R   t   step(    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR(   `   s   t   BoundedFloatTextc           B   sž   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e e	 d d ƒj d e ƒ Z
 e e	 d d ƒj d e ƒ Z e d	 d e d d ƒj d e ƒ Z RS(
   s8   Displays a float value within a textbox. Value must be within the range specified.

    For a textbox in which the value doesn't need to be within a specific range, use FloatText.

    Parameters
    ----------
    value : float
        value displayed
    min : float
        minimal value of the range of possible values displayed
    max : float
        maximal value of the range of possible values displayed
    step : float
        step of the increment (if None, any step is allowed)
    description : str
        description displayed next to the textbox
    R)   R   t   BoundedFloatTextModelR   s   Enable or disable user changessl   Update the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.R+   s#   Minimum step to increment the valueN(   R   R   R,   R   R   R   R-   R.   R   R/   R0   R1   R   R   R2   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR3   u   s   t   FloatSliderc           B   s  e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d ƒj d e ƒ Z	 e
 d d d	 g d
 d d d ƒ j d e ƒ Z e e d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e e ƒ j d e e  Z RS(   s   Slider/trackbar of floating values with the specified range.

    Parameters
    ----------
    value : float
        position of the slider
    min : float
        minimal position of the slider
    max : float
        maximal position of the slider
    step : float
        step of the trackbar
    description : str
        name of the slider
    orientation : {'horizontal', 'vertical'}
        default is 'horizontal', orientation of the slider
    readout : {True, False}
        default is True, display the current value of the slider next to it
    readout_format : str
        default is '.2f', specifier for the format function used to represent
        slider value for human consumption, modeled after Python 3's format
        specification mini-language (PEP 3101).
    t   FloatSliderViewR   t   FloatSliderModelgš™™™™™¹?R   s#   Minimum step to increment the valuet   valuest
   horizontalt   verticalt   default_values   Vertical or horizontal.s3   Display the current value of the slider next to it.s   .2fs   Format for the readoutsA   Update the value of the widget as the user is holding the slider.s   Enable or disable user changes(   R   R   R,   R   R   R   R-   R.   R   R2   R   t   orientationR   t   readoutR   t   readout_formatR1   R/   R0   R
   R   R   t   style(    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR5   Ž   s   t   FloatLogSliderc           B   s:  e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d ƒj d e ƒ Z	 e
 d d d	 g d
 d d d ƒ j d e ƒ Z e e d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e e ƒ j d e e  Z RS(   sþ   Slider/trackbar of logarithmic floating values with the specified range.

    Parameters
    ----------
    value : float
        position of the slider
    base : float
        base of the logarithmic scale. Default is 10
    min : float
        minimal position of the slider in log scale, i.e., actual minimum is base ** min
    max : float
        maximal position of the slider in log scale, i.e., actual maximum is base ** max
    step : float
        step of the trackbar, denotes steps for the exponent, not the actual value
    description : str
        name of the slider
    orientation : {'horizontal', 'vertical'}
        default is 'horizontal', orientation of the slider
    readout : {True, False}
        default is True, display the current value of the slider next to it
    readout_format : str
        default is '.3g', specifier for the format function used to represent
        slider value for human consumption, modeled after Python 3's format
        specification mini-language (PEP 3101).
    t   FloatLogSliderViewR   t   FloatLogSliderModelgš™™™™™¹?R   s3   Minimum step in the exponent to increment the valueR8   R9   R:   R;   s   Vertical or horizontal.s3   Display the current value of the slider next to it.s   .3gs   Format for the readoutsA   Update the value of the widget as the user is holding the slider.s   Enable or disable user changesg      $@s   Base for the logarithm(   R   R   R,   R   R   R   R-   R.   R   R2   R   R<   R   R=   R   R>   R1   R/   R0   R'   R
   R   R   R?   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR@   µ   s   t   FloatProgressc        	   B   sÂ   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d g d d d d	 ƒ j d e ƒ Z	 e d d
 d d d d g d d d e d d ƒ j d e ƒ Z
 e e ƒ j d e e  Z RS(   sd   Displays a progress bar.

    Parameters
    -----------
    value : float
        position within the range of the progress bar
    min : float
        minimal position of the slider
    max : float
        maximal position of the slider
    description : str
        name of the progress bar
    orientation : {'horizontal', 'vertical'}
        default is 'horizontal', orientation of the progress bar
    bar_style: {'success', 'info', 'warning', 'danger', ''}
        color of the progress bar, default is '' (blue)
        colors are: 'success'-green, 'info'-light blue, 'warning'-orange, 'danger'-red
    t   ProgressViewR   t   FloatProgressModelR8   R9   R:   R;   R   s   Vertical or horizontal.t   successt   infot   warningt   dangert    R+   s-   Use a predefined styling for the progess bar.(   R   R   R,   R   R   R   R-   R.   R   R<   t	   bar_styleR
   R   R   R?   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRC   ß   s   t   _FloatRangec           B   sŒ   e  Z e e ƒ  e ƒ  d  d d d ƒj d e ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z
 e
 j	 d	 „  ƒ Z
 e d
 ƒ d „  ƒ Z RS(   R;   g        g      ð?R   s   Tuple of (lower, upper) boundsR   c         C   s   |  j  d S(   Ni    (   R   (   R   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   lower  s    c         C   s   | |  j  d f |  _  d  S(   Ni   (   R   (   R   RM   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRM     s    c         C   s   |  j  d S(   Ni   (   R   (   R   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   upper  s    c         C   s   |  j  d | f |  _  d  S(   Ni    (   R   (   R   RN   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRN     s    R   c         C   s5   | d \ } } | | k  r+ t  d ƒ ‚ n  | | f S(   NR   s   setting lower > upper(   R   (   R   R"   RM   RN   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR#     s    (   g        g      ð?(   R   R   R   R   R   R   R   t   propertyRM   t   setterRN   R   R#   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRL      s   t   _BoundedFloatRangec           B   s˜   e  Z e d  d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z d „  Z e	 d	 d
 ƒ d „  ƒ Z
 e	 d ƒ d „  ƒ Z RS(   g      ð?R   s<   Minimum step that the value can take (ignored by some views)R   g      Y@s	   Max valueg        s	   Min valuec         O   s…   | j  d d ƒ | j  d d ƒ } } | j  d d  ƒ d  k rh d | d | d | d | f | d <n  t t |  ƒ j | | Ž  d  S(   NR    g        R!   g      Y@R   g      è?g      Ð?(   t   getR   R   RQ   R   (   R   t   argsR   R    R!   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR   !  s
    %R    R!   c         C   sô   | d } | d } | j  d k rA | |  j k rA t d ƒ ‚ n  | j  d k rn | |  j k  rn t d ƒ ‚ n  | j  d k r¯ t | |  j d ƒ t | |  j d ƒ f |  _ n  | j  d k rð t | |  j d ƒ t | |  j d ƒ f |  _ n  | S(	   Nt   traitR   R    s   setting min > maxR!   s   setting max < mini    i   (   t   nameR!   R   R    R   (   R   R"   RT   t   new(    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   _validate_bounds(  s    

22R   c         C   sr   t  t |  ƒ j | ƒ \ } } t | |  j ƒ t | |  j ƒ } } t | |  j ƒ t | |  j ƒ } } | | f S(   N(   R   RQ   R#   R    R!   (   R   R"   RM   RN   (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyR#   6  s    %%(   R   R   R   R   R   R2   R!   R    R   R   RW   R#   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRQ     s   	t   FloatRangeSliderc           B   s  e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d ƒj d e ƒ Z	 e
 d d d	 g d
 d d d ƒ j d e ƒ Z e e d d ƒj d e ƒ Z e d d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z e e ƒ j d e e  Z RS(   s   Slider/trackbar that represents a pair of floats bounded by minimum and maximum value.

    Parameters
    ----------
    value : float tuple
        range of the slider displayed
    min : float
        minimal position of the slider
    max : float
        maximal position of the slider
    step : float
        step of the trackbar
    description : str
        name of the slider
    orientation : {'horizontal', 'vertical'}
        default is 'horizontal'
    readout : {True, False}
        default is True, display the current value of the slider next to it
    readout_format : str
        default is '.2f', specifier for the format function used to represent
        slider value for human consumption, modeled after Python 3's format
        specification mini-language (PEP 3101).
    t   FloatRangeSliderViewR   t   FloatRangeSliderModelgš™™™™™¹?R   s#   Minimum step to increment the valueR8   R9   R:   R;   s   Vertical or horizontal.s3   Display the current value of the slider next to it.s   .2fs   Format for the readoutsA   Update the value of the widget as the user is sliding the slider.s   Enable or disable user changes(   R   R   R,   R   R   R   R-   R.   R   R2   R   R<   R   R=   R   R>   R1   R/   R0   R
   R   R   R?   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyRX   >  s   N(%   R,   t	   traitletsR    R   R   R   R   R   R   R   R   t   widget_descriptionR	   t   trait_typesR
   R   t   valuewidgetR   t   widgetR   R   t   widget_coreR   t
   widget_intR   R   R   R   R&   R(   R3   R5   R@   RC   RL   RQ   RX   (    (    (    s>   lib/python2.7/site-packages/ipywidgets/widgets/widget_float.pyt   <module>   s0   @	 #&) "