← Về thư mục
skills/uncertainty-and-units/scripts/_common.py
- CliError · class · L95-L96 — class CliError(ValueError)
- bounded_int · function · L99-L113 — def bounded_int(minimum: int, maximum: int) -> Callable[[str], int]
- convert · function · L102-L111 — def convert(value: str) -> int
- finite_float · function · L116-L125 — def finite_float(value: str) -> float
- non_negative_float · function · L128-L134 — def non_negative_float(value: str) -> float
- positive_float · function · L137-L143 — def positive_float(value: str) -> float
- probability · function · L146-L152 — def probability(value: str) -> float
- as_finite · function · L155-L163 — def as_finite(value: Any, *, label: str) -> float
- as_degrees_of_freedom · function · L166-L176 — def as_degrees_of_freedom(value: Any, *, label: str) -> float
- normalize_distribution · function · L179-L192 — def normalize_distribution(value: Any, *, label: str) -> str
- checked_input_file · function · L195-L220 — def checked_input_file( value: str | os.PathLike[str], *, suffixes: Iterable[str], max_bytes: int = MAX_INPUT_BYTES, ) -> Path
- checked_output_file · function · L223-L250 — def checked_output_file( value: str | os.PathLike[str], *, suffixes: Iterable[str], force: bool = False, ) -> Path
- atomic_write_bytes · function · L253-L271 — def atomic_write_bytes(path: Path, payload: bytes, *, force: bool = False) -> None
- _json_bytes · function · L274-L294 — def _json_bytes(document: Any) -> bytes
- emit_json · function · L297-L310 — def emit_json( document: Any, *, output: str | os.PathLike[str] | None = None, force: bool = False, ) -> None
- emit_text · function · L313-L330 — def emit_text( text: str, *, output: str | os.PathLike[str] | None = None, force: bool = False, ) -> None
- load_json · function · L333-L345 — def load_json(value: str | os.PathLike[str]) -> Any
- reject_constant · function · L338-L339 — def reject_constant(constant: str) -> None
- read_text_file · function · L348-L357 — def read_text_file( value: str | os.PathLike[str], *, suffixes: Iterable[str] = (".py",) ) -> tuple[str, Path]
- parse_expression · function · L368-L421 — def parse_expression(text: str) -> ast.Expression
- _check_depth · function · L424-L430 — def _check_depth(node: ast.AST, depth: int) -> None
- expression_variables · function · L433-L450 — def expression_variables(tree: ast.Expression) -> list[str]
- reduce_expression · function · L453-L501 — def reduce_expression( tree: ast.Expression, variables: dict[str, Any], functions: dict[str, Callable[..., Any]], ) -> Any
- walk · function · L460-L492 — def walk(node: ast.AST) -> Any
- scalar_functions · function · L504-L520 — def scalar_functions() -> dict[str, Callable[..., Any]]
- array_functions · function · L523-L569 — def array_functions() -> dict[str, Callable[..., Any]]
- erf · function · L559-L566 — def erf(value: Any) -> Any
- json_dof · function · L572-L577 — def json_dof(value: float | None) -> float | None
- format_dof · function · L580-L585 — def format_dof(value: float | None) -> str
- welch_satterthwaite · function · L588-L606 — def welch_satterthwaite( combined_uncertainty: float, terms: Iterable[tuple[float, float]] ) -> float
- coverage_factor · function · L609-L626 — def coverage_factor(dof: float, coverage_probability: float) -> float
- numerical_tolerance · function · L629-L643 — def numerical_tolerance(combined_uncertainty: float, significant_digits: int) -> float
- shortest_coverage_interval · function · L646-L666 — def shortest_coverage_interval( sorted_sample: Any, coverage_probability: float ) -> tuple[float, float]