← Về thư mục
skills/fluidsim/scripts/_common.py
- ToolError · class · L49-L50 — class ToolError(ValueError)
- bounded_int · function · L53-L62 — def bounded_int( value: Any, *, name: str, minimum: int, maximum: int ) -> int
- finite_float · function · L65-L86 — def finite_float( value: Any, *, name: str, minimum: float | None = None, maximum: float | None = None, allow_none: bool = False, ) -> float | None
- validate_keys · function · L89-L105 — def validate_keys( value: Mapping[str, Any], *, allowed: Iterable[str], required: Iterable[str] = (), context: str, ) -> None
- require_mapping · function · L108-L111 — def require_mapping(value: Any, *, context: str) -> Mapping[str, Any]
- require_text · function · L114-L123 — def require_text( value: Any, *, name: str, minimum: int = 1, maximum: int = 2_000 ) -> str
- require_text_list · function · L126-L134 — def require_text_list( value: Any, *, name: str, minimum: int = 1, maximum: int = 100 ) -> list[str]
- safe_slug · function · L137-L145 — def safe_slug(value: Any, *, name: str) -> str
- safe_relative_path · function · L148-L176 — def safe_relative_path( value: Any, *, name: str, suffixes: Iterable[str] | None = None, allow_nested: bool = False, ) -> str
- _reject_unsafe_path_text · function · L179-L191 — def _reject_unsafe_path_text(value: str) -> None
- _absolute_lexical · function · L194-L195 — def _absolute_lexical(path: Path) -> Path
- _reject_symlink_components · function · L198-L210 — def _reject_symlink_components(path: Path) -> None
- checked_root · function · L213-L227 — def checked_root(value: str | os.PathLike[str]) -> Path
- _within_root · function · L230-L234 — def _within_root(path: Path, root: Path) -> None
- checked_input · function · L237-L279 — def checked_input( value: str | os.PathLike[str], *, root: str | os.PathLike[str] = ".", kind: str = "file", suffixes: Iterable[str] | None = None, max_bytes: int = MAX_HDF5_BYTES, ) -> Path
- checked_output · function · L282-L312 — def checked_output( value: str | os.PathLike[str], *, root: str | os.PathLike[str] = ".", suffixes: Iterable[str], force: bool = False, ) -> Path
- atomic_write · function · L315-L336 — def atomic_write( destination: Path, payload: bytes, *, force: bool = False ) -> None
- _reject_json_constant · function · L339-L340 — def _reject_json_constant(value: str) -> None
- _unique_object · function · L343-L349 — def _unique_object(pairs: list[tuple[str, Any]]) -> dict[str, Any]
- load_json · function · L352-L367 — def load_json(path: Path, *, max_bytes: int = MAX_JSON_BYTES) -> Any
- strict_json_loads · function · L370-L380 — def strict_json_loads(text: str) -> Any
- json_bytes · function · L383-L399 — def json_bytes(document: Any) -> bytes
- emit_json · function · L402-L403 — def emit_json(document: Any) -> None
- fail_json · function · L406-L415 — def fail_json(tool: str, exc: Exception) -> int
- sha256_file · function · L418-L428 — def sha256_file(path: Path, *, max_bytes: int) -> str | None
- iter_local_files · function · L431-L480 — def iter_local_files( path: Path, *, suffixes: Iterable[str] | None, max_files: int, recursive: bool = True, ) -> list[Path]
- relative_display · function · L483-L491 — def relative_display(path: Path, root: Path) -> str