def log_scalar(self, name: str, value: float, step: Optional[int] = None) -> None:
        """
        Add a new measurement.

        The measurement will be processed by the MongoDB* observer
        during a heartbeat event.
        Other observers are not yet supported.


        Parameters
        ----------
        name
            The name of the metric, e.g. training.loss
        value
            The measured value
        step
            The step number (integer), e.g. the iteration number
            If not specified, an internal counter for each metric
            is used, incremented by one.
        """
        # Method added in change https://github.com/chovanecm/sacred/issues/4
        # The same as Run.log_scalar
        self.current_run.log_scalar(name, value, step)

        Add a new measurement.

        The measurement will be processed by the MongoDB* observer
        during a heartbeat event.
        Other observers are not yet supported.


        Parameters
        ----------
        name
            The name of the metric, e.g. training.loss
        value
            The measured value
        step
            The step number (integer), e.g. the iteration number
            If not specified, an internal counter for each metric
            is used, incremented by one.
        
sacred/experiment.py