HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/pkgs/altair-5.0.1-py312haa95532_0/info/test/altair/expr/consts.py
from typing import Dict

from .core import ConstExpression


CONST_LISTING = {
    "NaN": "not a number (same as JavaScript literal NaN)",
    "LN10": "the natural log of 10 (alias to Math.LN10)",
    "E": "the transcendental number e (alias to Math.E)",
    "LOG10E": "the base 10 logarithm e (alias to Math.LOG10E)",
    "LOG2E": "the base 2 logarithm of e (alias to Math.LOG2E)",
    "SQRT1_2": "the square root of 0.5 (alias to Math.SQRT1_2)",
    "LN2": "the natural log of 2 (alias to Math.LN2)",
    "SQRT2": "the square root of 2 (alias to Math.SQRT1_2)",
    "PI": "the transcendental number pi (alias to Math.PI)",
}

NAME_MAP: Dict[str, str] = {}


def _populate_namespace():
    globals_ = globals()
    for name, doc in CONST_LISTING.items():
        py_name = NAME_MAP.get(name, name)
        globals_[py_name] = ConstExpression(name, doc)
        yield py_name


__all__ = list(_populate_namespace())