solprop.translate.admission#

What the general modal route and the coupled flow execute, checked once.

check_general_route() refuses, by name, each general modal or coupled-flow problem solprop does not run, and check_leaf_types() a general-modal leaf that is not its record type. Both backends execute the same combinations of these leaves, so the list is part of the problem’s validation (solprop.translate.problem.PropagationProblem.validate(), which solprop.translate.problem.validate_run() runs where a backend is built): each refusal has one raise site, before any buffer is allocated. The leaves’ consistency with the state – channel and component counts, axes, extents – is validate’s own and runs first. A problem can be assembled by something other than solprop.translate.assembly.assemble(), so nothing here relies on the assembly having refused it already.

Functions

check_general_route(problem)

Refuse, by name, each general modal or coupled-flow problem solprop does not run.

check_leaf_types(problem)

Refuse a general-modal leaf that is not its record type, by name.

solprop.translate.admission.check_general_route(problem)[source]#

Refuse, by name, each general modal or coupled-flow problem solprop does not run.

The coupled flow first: a metric or a table beside it is this route’s refusal to make, not the general route’s. Then the general modal route: the tables’ own execution maps, an identity metric or the dense metric of a declared unitary change of basis of one, the constant unit power weight, no channel response beside the route’s own, per-region responses of a known model, and moving maps only beside the flow that carries their connection. Its field grid is the leaves’ own structure’s to require: a leaf’s increasing frequency axis is grids.omega, which an envelope grid’s FFT-ordered axis is not. A problem carrying none of the general-modal leaves passes untouched.

Parameters:
problemsolprop.translate.problem.PropagationProblem

The problem to check, its leaves consistent with its state.

Raises:
TranslationError

Naming the leaf, or the part of the problem around it, that is not executed.

Examples

>>> from solprop.driver import Simulation
>>> from solprop.translate.admission import check_general_route
>>> simulation = Simulation.from_gnlse(
...     0.11, 0.01, [0.0, 0.0, -1.183e-26], wavelength=835e-9,
...     wavelength_limits=(500e-9, 2e-6), trange=1e-12,
...     width=100e-15, peak_power=9.8, shape="sech",
... )
>>> check_general_route(simulation.translate()) is None
True
solprop.translate.admission.check_leaf_types(problem)[source]#

Refuse a general-modal leaf that is not its record type, by name.

The first of the leaves’ consistency checks (validate()), so that a hand-built problem holding something else there meets a named refusal rather than an attribute error further in.

Parameters:
problemsolprop.translate.problem.PropagationProblem

The problem to check.

Raises:
TranslationError

Naming the leaf, the type it holds and the type it must be.