ephemeral_injected_file
Stable function · Load-time lowering and templates
Tier: stable · Kind: function · Topic: Load-time lowering and templates
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
| not exported | ephemeralInjectedFile | not exported | ephemeral_injected_file | not exported |
Julia
Julia does not export this function.
TypeScript
function ephemeralInjectedFile(file: EsmFile | null, sourcePath: string | null, mname: string, imports: readonly unknown[], baseDir: string): Promise<EsmFile>
esm-spec §9.7.10 form C: build a throwaway EsmFile in which component
mname has the run’s imports (raw §9.7.2 entries) appended to its own
expression_template_imports, so the ordinary import resolver + §9.6.3
fixpoint lower its rewrite-targets under the run-chosen discretization. The
persisted file is never mutated. This is what lets one test/analysis suite
exercise a discretization-agnostic PDE leaf under several schemes with no
conflict between runs.
The raw base is re-read from sourcePath when given (relative import refs
resolve against its directory), else re-serialized from file; baseDir
anchors the injected refs. Mirrors the Julia reference
_ephemeral_injected_file (EarthSciAST.jl/src/inline_tests.jl).
This binding does not numerically simulate PDEs; the ephemeral build is the structural-lowering half of form C (the leaf’s rewrite-target is lowered in this copy only). No solver is implied.
Python
Python does not export this function.
Rust
pub fn ephemeral_injected_file(file: &EsmFile, source_path: Option<&Path>, model_name: &str, imports: &[Value], base_dir: &Path) -> Result<EsmFile, EsmError>
esm-spec §9.7.10 form C: build a throwaway EsmFile
in which component
model_name has the test’s imports (raw §9.7.2 entries) appended to its
own expression_template_imports, so the ordinary import resolver + §9.6.3
fixpoint lower its rewrite-targets under the test-chosen discretization. The
persisted file is never mutated. When source_path is Some, the raw base
is re-read from it (relative refs resolve against its directory); otherwise
it is re-serialized from the loaded file (base_dir anchors the injected
refs). This is what lets one test suite exercise a discretization-agnostic
PDE leaf under several schemes with no conflict between tests. Mirrors the
Julia reference (inline_tests.jl _ephemeral_injected_file).
Go
Go does not export this function.