class_docstr: Parameter representing a scalar.
  
  Parameters
  ----------
  init: optional float
      initial value of the scalar (defaults to 0.0 if both bounds are not provided)
  lower: optional float
      minimum value if any
  upper: optional float
      maximum value if any
  mutable_sigma: bool
      whether the mutation standard deviation must mutate as well (for mutation based algorithms)
  
  Notes
  -----
  - by default, this is an unbounded scalar with Gaussian mutations.
  - if both lower and upper bounds are provided, sigma will be adapted so that the range spans 6 sigma.
    Also, if init is not provided, it will be set to the middle value.
  - More specific behaviors can be obtained throught the following methods:
    :code:`set_bounds`, :code:`set_mutation`, :code:`set_integer_casting`
class_docstr_tok: ["Parameter","representing","a","scalar",".","Parameters","--","--","--","--","--","init",":","optional","float","initial","value","of","the","scalar","(","defaults","to","0.0","if","both","bounds","are","not","provided",")","lower",":","optional","float","minimum","value","if","any","upper",":","optional","float","maximum","value","if","any","mutable_sigma",":","bool","whether","the","mutation","standard","deviation","must","mutate","as","well","(","for","mutation","based","algorithms",")","Notes","--","--","-","-","by","default",",","this","is","an","unbounded","scalar","with","Gaussian","mutations",".","-","if","both","lower","and","upper","bounds","are","provided",",","sigma","will","be","adapted","so","that","the","range","spans","6","sigma",".","Also",",","if","init","is","not","provided",",","it","will","be","set","to","the","middle","value",".","-","More","specific","behaviors","can","be","obtained","throught","the","following","methods",":",":","code",":","`","set_bounds","`",",",":","code",":","`","set_mutation","`",",",":","code",":","`","set_integer_casting","`"]
code: def __init__(
      self,
      init: tp.Optional[float] = None,
      *,
      lower: tp.Optional[float] = None,
      upper: tp.Optional[float] = None,
      mutable_sigma: bool = True,
  ) -> None:
      bounded = all(a is not None for a in (lower, upper))
      no_init = init is None
      if bounded:
          if init is None:
              init = (lower + upper) / 2.0  # type: ignore
      if init is None:
          init = 0.0
      super().__init__(
          init=np.array([init]), mutable_sigma=mutable_sigma
      )
      if bounded:
          self.set_mutation(sigma=(upper - lower) / 6)  # type: ignore
      if any(a is not None for a in (lower, upper)):
          self.set_bounds(
              lower=lower,
              upper=upper,
              full_range_sampling=bounded and no_init,
          )
      self.add_layer(_layering._ScalarCasting())
  
imports: import numpy
  import nevergrad.common.typing
  from nevergrad.common import errors
  from .None import _layering
  from .None import core
  from .container import Dict
  from .None import utils
label_desc: Use image node_id 1 to create a new Scalar object from inherited base classes: Data with example: obj = Scalar(init)