noads.core.model#

Core model based on gemseo-jax classes.

class noads.core.model.AutoModel(name)[source]#

Bases: Model

Model whose inputs and outputs are auto-detected from a JAX function.

Subclasses implement _jax_func() with named arguments; the argument names become the discipline input names and the returned variables the output names (via gemseo_jax.auto_jax_discipline.AutoJAXDiscipline). This is the most common base class for NOADS models, as it removes the boilerplate of declaring grammars by hand.

discipline: AutoJAXDiscipline#
class noads.core.model.JAXModel(function, input_names, output_names, default_inputs, name)[source]#

Bases: Model

Model built from a dict-based JAX function.

The function maps a dictionary of named input arrays to a dictionary of named output arrays. Input and output names are given explicitly, which allows functions whose signature cannot be introspected (e.g. closures or partial applications). For plain functions with named arguments, prefer AutoModel, which detects names automatically.

discipline: JAXDiscipline#
class noads.core.model.Model(discipline)[source]#

Bases: object

Base class of all NOADS models, wrapping a GEMSEO-JAX discipline.

A model holds a single gemseo_jax.jax_discipline.JAXDiscipline, i.e. a JAX-traceable function with named inputs and outputs that GEMSEO can execute, couple with other disciplines, differentiate with automatic differentiation, and compile just-in-time. Physical and behavioral models (aircraft, fleet, energy, traffic) expose one or several *_model() factory methods returning Model instances, which are then assembled by TemporalScenario.

Parameters:

discipline (JAXDiscipline)

discipline: JAXDiscipline#

Classes

AutoModel(name)

Model whose inputs and outputs are auto-detected from a JAX function.

JAXModel(function, input_names, ...)

Model built from a dict-based JAX function.

Model(discipline)

Base class of all NOADS models, wrapping a GEMSEO-JAX discipline.