""" Engine and Engine View bindings """ from __future__ import annotations import collections.abc import fourdst._phys.atomic import fourdst._phys.composition import gridfire._gridfire.io import gridfire._gridfire.partition import gridfire._gridfire.reaction import gridfire._gridfire.screening import gridfire._gridfire.type import numpy import numpy.typing import typing from . import diagnostics __all__: list[str] = ['ACTIVE', 'ADAPTIVE_ENGINE_VIEW', 'AdaptiveEngineView', 'BuildDepthType', 'DEFAULT', 'DEFINED_ENGINE_VIEW', 'DefinedEngineView', 'DynamicEngine', 'EQUILIBRIUM', 'Engine', 'EngineTypes', 'FILE_DEFINED_ENGINE_VIEW', 'FULL_SUCCESS', 'FifthOrder', 'FileDefinedEngineView', 'FourthOrder', 'Full', 'GRAPH_ENGINE', 'GraphEngine', 'INACTIVE_FLOW', 'MAX_ITERATIONS_REACHED', 'MULTISCALE_PARTITIONING_ENGINE_VIEW', 'MultiscalePartitioningEngineView', 'NONE', 'NOT_PRESENT', 'NO_SPECIES_TO_PRIME', 'NetworkBuildDepth', 'NetworkConstructionFlags', 'NetworkJacobian', 'NetworkPrimingEngineView', 'PRIMING_ENGINE_VIEW', 'PrimingReport', 'PrimingReportStatus', 'REACLIB', 'REACLIB_STRONG', 'REACLIB_WEAK', 'SecondOrder', 'Shallow', 'SparsityPattern', 'SpeciesStatus', 'StepDerivatives', 'ThirdOrder', 'WRL_BETA_MINUS', 'WRL_BETA_PLUS', 'WRL_ELECTRON_CAPTURE', 'WRL_POSITRON_CAPTURE', 'WRL_WEAK', 'build_nuclear_network', 'diagnostics', 'primeNetwork', 'regularize_jacobian'] class AdaptiveEngineView(DynamicEngine): def __init__(self, baseEngine: DynamicEngine) -> None: """ Construct an adaptive engine view with a base engine. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getBaseEngine(self) -> DynamicEngine: """ Get the base engine associated with this adaptive engine view. """ def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class BuildDepthType: pass class DefinedEngineView(DynamicEngine): def __init__(self, peNames: collections.abc.Sequence[str], baseEngine: GraphEngine) -> None: """ Construct a defined engine view with a list of tracked reactions and a base engine. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getBaseEngine(self) -> DynamicEngine: """ Get the base engine associated with this defined engine view. """ def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class DynamicEngine: pass class Engine: pass class EngineTypes: """ Members: GRAPH_ENGINE : The standard graph-based engine. ADAPTIVE_ENGINE_VIEW : An engine that adapts based on certain criteria. MULTISCALE_PARTITIONING_ENGINE_VIEW : An engine that partitions the system at multiple scales. PRIMING_ENGINE_VIEW : An engine that uses a priming strategy for simulations. DEFINED_ENGINE_VIEW : An engine defined by user specifications. FILE_DEFINED_ENGINE_VIEW : An engine defined through external files. """ ADAPTIVE_ENGINE_VIEW: typing.ClassVar[EngineTypes] # value = DEFINED_ENGINE_VIEW: typing.ClassVar[EngineTypes] # value = FILE_DEFINED_ENGINE_VIEW: typing.ClassVar[EngineTypes] # value = GRAPH_ENGINE: typing.ClassVar[EngineTypes] # value = MULTISCALE_PARTITIONING_ENGINE_VIEW: typing.ClassVar[EngineTypes] # value = PRIMING_ENGINE_VIEW: typing.ClassVar[EngineTypes] # value = __members__: typing.ClassVar[dict[str, EngineTypes]] # value = {'GRAPH_ENGINE': , 'ADAPTIVE_ENGINE_VIEW': , 'MULTISCALE_PARTITIONING_ENGINE_VIEW': , 'PRIMING_ENGINE_VIEW': , 'DEFINED_ENGINE_VIEW': , 'FILE_DEFINED_ENGINE_VIEW': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... @typing.overload def __repr__(self) -> str: ... @typing.overload def __repr__(self) -> str: """ String representation of the EngineTypes. """ def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class FileDefinedEngineView(DefinedEngineView): def __init__(self, baseEngine: GraphEngine, fileName: str, parser: gridfire._gridfire.io.NetworkFileParser) -> None: """ Construct a defined engine view from a file and a base engine. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getBaseEngine(self) -> DynamicEngine: """ Get the base engine associated with this file defined engine view. """ def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getNetworkFile(self) -> str: """ Get the network file associated with this defined engine view. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getParser(self) -> gridfire._gridfire.io.NetworkFileParser: """ Get the parser used for this defined engine view. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class GraphEngine(DynamicEngine): @staticmethod def getNetReactionStoichiometry(reaction: ...) -> dict[fourdst._phys.atomic.Species, int]: """ Get the net stoichiometry for a given reaction. """ @typing.overload def __init__(self, composition: fourdst._phys.composition.Composition, depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Initialize GraphEngine with a composition and build depth. """ @typing.overload def __init__(self, composition: fourdst._phys.composition.Composition, partitionFunction: gridfire._gridfire.partition.PartitionFunction, depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Initialize GraphEngine with a composition, partition function and build depth. """ @typing.overload def __init__(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Initialize GraphEngine with a set of reactions. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def calculateReverseRate(self, reaction: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat, composition: ...) -> float: """ Calculate the reverse rate for a given reaction at a specific temperature, density, and composition. """ def calculateReverseRateTwoBody(self, reaction: ..., T9: typing.SupportsFloat, forwardRate: typing.SupportsFloat, expFactor: typing.SupportsFloat) -> float: """ Calculate the reverse rate for a two-body reaction at a specific temperature. """ def calculateReverseRateTwoBodyDerivative(self, reaction: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat, composition: fourdst._phys.composition.Composition, reverseRate: typing.SupportsFloat) -> float: """ Calculate the derivative of the reverse rate for a two-body reaction at a specific temperature. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ def exportToCSV(self, filename: str) -> None: """ Export the network to a CSV file for analysis. """ def exportToDot(self, filename: str) -> None: """ Export the network to a DOT file for visualization. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getPartitionFunction(self) -> gridfire._gridfire.partition.PartitionFunction: """ Get the partition function used by the engine. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ @typing.overload def getSpeciesDestructionTimescales(self, composition: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeReactions: gridfire._gridfire.reaction.ReactionSet) -> ...: ... @typing.overload def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ @typing.overload def getSpeciesTimescales(self, composition: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeReactions: gridfire._gridfire.reaction.ReactionSet) -> ...: ... @typing.overload def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def involvesSpecies(self, species: fourdst._phys.atomic.Species) -> bool: """ Check if a given species is involved in the network. """ def isPrecomputationEnabled(self) -> bool: """ Check if precomputation is enabled for the engine. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def isUsingReverseReactions(self) -> bool: """ Check if the engine is using reverse reactions. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setPrecomputation(self, precompute: bool) -> None: """ Enable or disable precomputation for the engine. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def setUseReverseReactions(self, useReverse: bool) -> None: """ Enable or disable the use of reverse reactions in the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class MultiscalePartitioningEngineView(DynamicEngine): def __init__(self, baseEngine: GraphEngine) -> None: """ Construct a multiscale partitioning engine view with a base engine. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ def exportToDot(self, filename: str, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> None: """ Export the network to a DOT file for visualization. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getBaseEngine(self) -> DynamicEngine: """ Get the base engine associated with this multiscale partitioning engine view. """ def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getDynamicSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of dynamic species in the network. """ def getFastSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of fast species in the network. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getNormalizedEquilibratedComposition(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Get the normalized equilibrated composition for the algebraic species. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def involvesSpecies(self, species: fourdst._phys.atomic.Species) -> bool: """ Check if a given species is involved in the network (in either the algebraic or dynamic set). """ def involvesSpeciesInDynamic(self, species: fourdst._phys.atomic.Species) -> bool: """ Check if a given species is involved in the network's dynamic set. """ def involvesSpeciesInQSE(self, species: fourdst._phys.atomic.Species) -> bool: """ Check if a given species is involved in the network's algebraic set. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ @typing.overload def partitionNetwork(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Partition the network based on species timescales and connectivity. """ @typing.overload def partitionNetwork(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Partition the network based on a NetIn object. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class NetworkBuildDepth: """ Members: Full : Full network build depth Shallow : Shallow network build depth SecondOrder : Second order network build depth ThirdOrder : Third order network build depth FourthOrder : Fourth order network build depth FifthOrder : Fifth order network build depth """ FifthOrder: typing.ClassVar[NetworkBuildDepth] # value = FourthOrder: typing.ClassVar[NetworkBuildDepth] # value = Full: typing.ClassVar[NetworkBuildDepth] # value = SecondOrder: typing.ClassVar[NetworkBuildDepth] # value = Shallow: typing.ClassVar[NetworkBuildDepth] # value = ThirdOrder: typing.ClassVar[NetworkBuildDepth] # value = __members__: typing.ClassVar[dict[str, NetworkBuildDepth]] # value = {'Full': , 'Shallow': , 'SecondOrder': , 'ThirdOrder': , 'FourthOrder': , 'FifthOrder': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class NetworkConstructionFlags: """ Members: NONE : No special construction flags. REACLIB_STRONG : Include strong reactions from reaclib. WRL_BETA_MINUS : Include beta-minus decay reactions from weak rate library. WRL_BETA_PLUS : Include beta-plus decay reactions from weak rate library. WRL_ELECTRON_CAPTURE : Include electron capture reactions from weak rate library. WRL_POSITRON_CAPTURE : Include positron capture reactions from weak rate library. REACLIB_WEAK : Include weak reactions from reaclib. WRL_WEAK : Include all weak reactions from weak rate library. REACLIB : Include all reactions from reaclib. DEFAULT : Default construction flags (Reaclib strong and weak). """ DEFAULT: typing.ClassVar[NetworkConstructionFlags] # value = NONE: typing.ClassVar[NetworkConstructionFlags] # value = REACLIB: typing.ClassVar[NetworkConstructionFlags] # value = REACLIB_STRONG: typing.ClassVar[NetworkConstructionFlags] # value = REACLIB_WEAK: typing.ClassVar[NetworkConstructionFlags] # value = WRL_BETA_MINUS: typing.ClassVar[NetworkConstructionFlags] # value = WRL_BETA_PLUS: typing.ClassVar[NetworkConstructionFlags] # value = WRL_ELECTRON_CAPTURE: typing.ClassVar[NetworkConstructionFlags] # value = WRL_POSITRON_CAPTURE: typing.ClassVar[NetworkConstructionFlags] # value = WRL_WEAK: typing.ClassVar[NetworkConstructionFlags] # value = __members__: typing.ClassVar[dict[str, NetworkConstructionFlags]] # value = {'NONE': , 'REACLIB_STRONG': , 'WRL_BETA_MINUS': , 'WRL_BETA_PLUS': , 'WRL_ELECTRON_CAPTURE': , 'WRL_POSITRON_CAPTURE': , 'REACLIB_WEAK': , 'WRL_WEAK': , 'REACLIB': , 'DEFAULT': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... @typing.overload def __repr__(self) -> str: ... @typing.overload def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class NetworkJacobian: @typing.overload def __getitem__(self, key: tuple[fourdst._phys.atomic.Species, fourdst._phys.atomic.Species]) -> float: """ Get an entry from the Jacobian matrix using species identifiers. """ @typing.overload def __getitem__(self, key: tuple[typing.SupportsInt, typing.SupportsInt]) -> float: """ Get an entry from the Jacobian matrix using indices. """ @typing.overload def __setitem__(self, key: tuple[fourdst._phys.atomic.Species, fourdst._phys.atomic.Species], value: typing.SupportsFloat) -> None: """ Set an entry in the Jacobian matrix using species identifiers. """ @typing.overload def __setitem__(self, key: tuple[typing.SupportsInt, typing.SupportsInt], value: typing.SupportsFloat) -> None: """ Set an entry in the Jacobian matrix using indices. """ def data(self) -> ...: """ Get the underlying sparse matrix data. """ def infs(self) -> list[tuple[tuple[fourdst._phys.atomic.Species, fourdst._phys.atomic.Species], float]]: """ Get all infinite entries in the Jacobian matrix. """ def mapping(self) -> dict[fourdst._phys.atomic.Species, int]: """ Get the species-to-index mapping. """ def nans(self) -> list[tuple[tuple[fourdst._phys.atomic.Species, fourdst._phys.atomic.Species], float]]: """ Get all NaN entries in the Jacobian matrix. """ def nnz(self) -> int: """ Get the number of non-zero entries in the Jacobian matrix. """ def rank(self) -> int: """ Get the rank of the Jacobian matrix. """ def shape(self) -> tuple[int, int]: """ Get the shape of the Jacobian matrix as (rows, columns). """ def singular(self) -> bool: """ Check if the Jacobian matrix is singular. """ def to_csv(self, filename: str) -> None: """ Export the Jacobian matrix to a CSV file. """ def to_numpy(self) -> numpy.typing.NDArray[numpy.float64]: """ Convert the Jacobian matrix to a NumPy array. """ class NetworkPrimingEngineView(DefinedEngineView): @typing.overload def __init__(self, primingSymbol: str, baseEngine: GraphEngine) -> None: """ Construct a priming engine view with a priming symbol and a base engine. """ @typing.overload def __init__(self, primingSpecies: fourdst._phys.atomic.Species, baseEngine: GraphEngine) -> None: """ Construct a priming engine view with a priming species and a base engine. """ def calculateEpsDerivatives(self, comp: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> ...: """ Calculate deps/dT and deps/drho """ def calculateMolarReactionFlow(self: DynamicEngine, reaction: ..., comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> float: """ Calculate the molar reaction flow for a given reaction. """ def calculateRHSAndEnergy(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> StepDerivatives: """ Calculate the right-hand side (dY/dt) and energy generation rate. """ def collectComposition(self, composition: ..., T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> fourdst._phys.composition.Composition: """ Recursively collect composition from current engine and any sub engines if they exist. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> NetworkJacobian: """ Generate the Jacobian matrix for the current state. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, activeSpecies: collections.abc.Sequence[fourdst._phys.atomic.Species]) -> NetworkJacobian: """ Generate the jacobian matrix only for the subset of the matrix representing the active species. """ @typing.overload def generateJacobianMatrix(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat, sparsityPattern: collections.abc.Sequence[tuple[typing.SupportsInt, typing.SupportsInt]]) -> NetworkJacobian: """ Generate the jacobian matrix for the given sparsity pattern """ def generateStoichiometryMatrix(self) -> None: ... def getBaseEngine(self) -> DynamicEngine: """ Get the base engine associated with this priming engine view. """ def getDepth(self) -> gridfire._gridfire.engine.NetworkBuildDepth | int: """ Get the current build depth of the engine. """ def getNetworkReactions(self) -> gridfire._gridfire.reaction.ReactionSet: """ Get the set of logical reactions in the network. """ def getNetworkSpecies(self) -> list[fourdst._phys.atomic.Species]: """ Get the list of species in the network. """ def getScreeningModel(self) -> gridfire._gridfire.screening.ScreeningType: """ Get the current screening model of the engine. """ def getSpeciesDestructionTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the destruction timescales for each species in the network. """ def getSpeciesIndex(self, species: fourdst._phys.atomic.Species) -> int: """ Get the index of a species in the network. """ def getSpeciesStatus(self, species: fourdst._phys.atomic.Species) -> SpeciesStatus: """ Get the status of a species in the network. """ def getSpeciesTimescales(self: DynamicEngine, comp: fourdst._phys.composition.Composition, T9: typing.SupportsFloat, rho: typing.SupportsFloat) -> dict[fourdst._phys.atomic.Species, float]: """ Get the timescales for each species in the network. """ def getStoichiometryMatrixEntry(self, species: fourdst._phys.atomic.Species, reaction: ...) -> int: """ Get an entry from the stoichiometry matrix. """ def isStale(self, netIn: gridfire._gridfire.type.NetIn) -> bool: """ Check if the engine is stale based on the provided NetIn object. """ def mapNetInToMolarAbundanceVector(self, netIn: gridfire._gridfire.type.NetIn) -> list[float]: """ Map a NetIn object to a vector of molar abundances. """ def primeEngine(self, netIn: gridfire._gridfire.type.NetIn) -> PrimingReport: """ Prime the engine with a NetIn object to prepare for calculations. """ def rebuild(self, composition: ..., depth: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ...) -> None: """ Rebuild the engine with a new composition and build depth. """ def setNetworkReactions(self, reactions: gridfire._gridfire.reaction.ReactionSet) -> None: """ Set the network reactions to a new set of reactions. """ def setScreeningModel(self, screeningModel: gridfire._gridfire.screening.ScreeningType) -> None: """ Set the screening model for the engine. """ def update(self, netIn: gridfire._gridfire.type.NetIn) -> fourdst._phys.composition.Composition: """ Update the engine state based on the provided NetIn object. """ class PrimingReport: def __repr__(self) -> str: ... @property def primedComposition(self) -> fourdst._phys.composition.Composition: """ The composition after priming. """ @property def status(self) -> PrimingReportStatus: """ Status message from the priming process. """ @property def success(self) -> bool: """ Indicates if the priming was successful. """ class PrimingReportStatus: """ Members: FULL_SUCCESS : Priming was full successful. NO_SPECIES_TO_PRIME : Solver Failed to converge during priming. MAX_ITERATIONS_REACHED : Engine has already been primed. """ FULL_SUCCESS: typing.ClassVar[PrimingReportStatus] # value = MAX_ITERATIONS_REACHED: typing.ClassVar[PrimingReportStatus] # value = NO_SPECIES_TO_PRIME: typing.ClassVar[PrimingReportStatus] # value = __members__: typing.ClassVar[dict[str, PrimingReportStatus]] # value = {'FULL_SUCCESS': , 'NO_SPECIES_TO_PRIME': , 'MAX_ITERATIONS_REACHED': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... @typing.overload def __repr__(self) -> str: ... @typing.overload def __repr__(self) -> str: """ String representation of the PrimingReport. """ def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class SparsityPattern: pass class SpeciesStatus: """ Members: ACTIVE : Species is active in the network. EQUILIBRIUM : Species is in equilibrium. INACTIVE_FLOW : Species is inactive due to flow. NOT_PRESENT : Species is not present in the network. """ ACTIVE: typing.ClassVar[SpeciesStatus] # value = EQUILIBRIUM: typing.ClassVar[SpeciesStatus] # value = INACTIVE_FLOW: typing.ClassVar[SpeciesStatus] # value = NOT_PRESENT: typing.ClassVar[SpeciesStatus] # value = __members__: typing.ClassVar[dict[str, SpeciesStatus]] # value = {'ACTIVE': , 'EQUILIBRIUM': , 'INACTIVE_FLOW': , 'NOT_PRESENT': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... @typing.overload def __repr__(self) -> str: ... @typing.overload def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class StepDerivatives: @property def dYdt(self) -> dict[fourdst._phys.atomic.Species, float]: """ The right-hand side (dY/dt) of the ODE system. """ @property def energy(self) -> float: """ The energy generation rate. """ def build_nuclear_network(composition: ..., weakInterpolator: ..., maxLayers: gridfire._gridfire.engine.NetworkBuildDepth | typing.SupportsInt = ..., ReactionTypes: NetworkConstructionFlags = ...) -> gridfire._gridfire.reaction.ReactionSet: """ Build a nuclear network from a composition using all archived reaction data. """ def primeNetwork(netIn: gridfire._gridfire.type.NetIn, engine: ..., ignoredReactionTypes: collections.abc.Sequence[...] | None = None) -> PrimingReport: """ Prime a network with a short timescale ignition """ def regularize_jacobian(jacobian: NetworkJacobian, composition: fourdst._phys.composition.Composition) -> NetworkJacobian: """ regularize_jacobian """ ACTIVE: SpeciesStatus # value = ADAPTIVE_ENGINE_VIEW: EngineTypes # value = DEFAULT: NetworkConstructionFlags # value = DEFINED_ENGINE_VIEW: EngineTypes # value = EQUILIBRIUM: SpeciesStatus # value = FILE_DEFINED_ENGINE_VIEW: EngineTypes # value = FULL_SUCCESS: PrimingReportStatus # value = FifthOrder: NetworkBuildDepth # value = FourthOrder: NetworkBuildDepth # value = Full: NetworkBuildDepth # value = GRAPH_ENGINE: EngineTypes # value = INACTIVE_FLOW: SpeciesStatus # value = MAX_ITERATIONS_REACHED: PrimingReportStatus # value = MULTISCALE_PARTITIONING_ENGINE_VIEW: EngineTypes # value = NONE: NetworkConstructionFlags # value = NOT_PRESENT: SpeciesStatus # value = NO_SPECIES_TO_PRIME: PrimingReportStatus # value = PRIMING_ENGINE_VIEW: EngineTypes # value = REACLIB: NetworkConstructionFlags # value = REACLIB_STRONG: NetworkConstructionFlags # value = REACLIB_WEAK: NetworkConstructionFlags # value = SecondOrder: NetworkBuildDepth # value = Shallow: NetworkBuildDepth # value = ThirdOrder: NetworkBuildDepth # value = WRL_BETA_MINUS: NetworkConstructionFlags # value = WRL_BETA_PLUS: NetworkConstructionFlags # value = WRL_ELECTRON_CAPTURE: NetworkConstructionFlags # value = WRL_POSITRON_CAPTURE: NetworkConstructionFlags # value = WRL_WEAK: NetworkConstructionFlags # value =