Direct entries¶
Direct-entry schemas for parameters whose value is supplied explicitly
instead of fit. Mirrors ionworkspipeline.direct_entries.
Schemas for direct entries.
- class ionworks_schema.direct_entries.DirectEntry(parameters: dict[str, Any] | None = None, source: str | None = None, pipeline_id: str | None = None)¶
Bases:
BaseSchemaDirectly provide parameter values to the pipeline.
Supplies pre-defined parameter values to the pipeline — typically from literature, manufacturer specifications, or manual entry. May alternatively reference a completed Ionworks Studio pipeline via
pipeline_id, in which case the parameter values are fetched from that pipeline’s results at run time.Parameters¶
- parametersdict, optional
Mapping of pybamm parameter names to their values (e.g.
{"Electrode height [m]": 0.1}). Values may be floats, arrays, or pybamm-serialisable symbols. Leave empty when usingpipeline_id.- sourcestr, optional
Free-text reference describing where these parameters came from (e.g. paper citation, datasheet reference). Propagated through to provenance records.
- pipeline_idstr, optional
ID of a completed pipeline on Ionworks Studio. When set, the parameter values are fetched from that pipeline’s results instead of from
parameters. The referenced pipeline must be in thecompletedstate.
Examples¶
>>> known = iws.direct_entries.DirectEntry( ... parameters={ ... "Ambient temperature [K]": 298.15, ... "Nominal cell capacity [A.h]": 3.0, ... }, ... source="datasheet", ... ) >>> config = iws.Pipeline({"known": known}).to_config()
Extends:
ionworks_schema.base.BaseSchema- to_config() dict¶
Build the dict you submit through
ionworks-api.Carries either the parameter values you supplied (under
"values") or a reference to a completed Studio pipeline (under"pipeline_id") plus an optional provenance"source". Tagged as"element_type": "entry"so the API knows where to slot it in the pipeline.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.DirectEntryFunctionSchema¶
Bases:
BaseSchemaBase wrapper for named
iwp.direct_entrieshelper functions.Subclasses set
__function_name__(the snake_case pipeline function name) and declareFieldattributes matching that function’s signature.to_configserialises to{"name": <function_name>, **kwargs}so the pipeline parser can reconstruct the corresponding DirectEntry at run time.Examples¶
>>> # every concrete subclass follows the same construction pattern; >>> # exposed under its snake_case name in ``iws.direct_entries`` >>> entry = iws.direct_entries.bruggeman(electrode=1.5, electrolyte=1.5) >>> config = iws.Pipeline({"bruggeman": entry}).to_config() >>> # then submit `config` via ionworks-api
Extends:
ionworks_schema.base.BaseSchema- to_config() dict¶
Build the dict you submit through
ionworks-api.The output is
{"name": "<function_name>", **kwargs}where<function_name>is the snake_case name of the helper this wraps ("average_ocp","bruggeman", …) and**kwargsare the arguments you set on this schema. Default and empty values are omitted to keep the payload minimal.
- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.InitialStateOfCharge(value)¶
Bases:
DirectEntrySet the initial state of charge.
Parameters¶
- valuefloat
Initial state of charge as a percentage (0 to 100).
Examples¶
>>> entry = iws.direct_entries.InitialStateOfCharge(50.0) >>> config = iws.Pipeline({"soc": entry}).to_config()
Extends:
ionworks_schema.direct_entries.direct_entries.DirectEntry- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.InitialTemperature(value)¶
Bases:
DirectEntrySet the initial and ambient temperatures.
Parameters¶
- valuefloat
Initial and ambient temperatures in Kelvin.
Examples¶
>>> entry = iws.direct_entries.InitialTemperature(298.15) >>> config = iws.Pipeline({"temp": entry}).to_config()
Extends:
ionworks_schema.direct_entries.direct_entries.DirectEntry- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.InitialVoltage(value)¶
Bases:
DirectEntrySet the initial voltage.
Parameters¶
- valuefloat
Initial voltage in volts.
Examples¶
>>> entry = iws.direct_entries.InitialVoltage(3.7) >>> config = iws.Pipeline({"voltage": entry}).to_config()
Extends:
ionworks_schema.direct_entries.direct_entries.DirectEntry- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.PiecewiseInterpolation1D(base_parameter_name: str, breakpoint_values: list[float], breakpoint_parameter_name: str, smoothing: float = 0.0001, formulation: str = 'knots', source: str | None = None, parameters: dict[str, Any] | None = None, *, pipeline_id: str | None = None)¶
Bases:
BaseInterpolationPiecewise linear interpolation (1D) direct entry.
Creates a smooth piecewise linear function for a parameter that varies with respect to a single breakpoint parameter (e.g. SOC, temperature, voltage). Smooth heaviside transitions keep the interpolation continuous and differentiable for use in pybamm models.
Examples¶
>>> entry = iws.direct_entries.PiecewiseInterpolation1D( ... base_parameter_name="Particle diffusion time [s]", ... breakpoint_values=[0.0, 0.5, 1.0], ... breakpoint_parameter_name="SOC", ... ) >>> config = iws.Pipeline({"diffusion": entry}).to_config()
Extends:
ionworks_schema.direct_entries.direct_entries.BaseInterpolation- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ionworks_schema.direct_entries.PiecewiseInterpolation2D(base_parameter_name: str, breakpoint1_values: list[float], breakpoint1_parameter_name: str, breakpoint2_values: list[float], breakpoint2_parameter_name: str, smoothing1: float = 0.0001, smoothing2: float = 0.0001, formulation: str = 'knots', source: str | None = None, parameters: dict[str, Any] | None = None, *, pipeline_id: str | None = None)¶
Bases:
BaseInterpolationPiecewise bilinear interpolation (2D) direct entry.
Creates a smooth piecewise bilinear function for a parameter that varies with respect to two breakpoint parameters (e.g. SOC and temperature). Smooth heaviside transitions keep the interpolation continuous and differentiable for use in pybamm models.
Examples¶
>>> entry = iws.direct_entries.PiecewiseInterpolation2D( ... base_parameter_name="Diffusivity [m2.s-1]", ... breakpoint1_values=[0.0, 0.5, 1.0], ... breakpoint1_parameter_name="SOC", ... breakpoint2_values=[273.15, 298.15, 323.15], ... breakpoint2_parameter_name="Temperature [K]", ... ) >>> config = iws.Pipeline({"diffusivity": entry}).to_config()
Extends:
ionworks_schema.direct_entries.direct_entries.BaseInterpolation- model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- ionworks_schema.direct_entries.arrhenius_butler_volmer_exchange_current_density¶
alias of
ArrheniusButlerVolmerExchangeCurrentDensity
- ionworks_schema.direct_entries.arrhenius_electrolyte_conductivity¶
alias of
ArrheniusElectrolyteConductivity
- ionworks_schema.direct_entries.arrhenius_electrolyte_diffusivity¶
alias of
ArrheniusElectrolyteDiffusivity
- ionworks_schema.direct_entries.arrhenius_particle_diffusivity¶
alias of
ArrheniusParticleDiffusivity
- ionworks_schema.direct_entries.average_ocp¶
alias of
AverageOCP
- ionworks_schema.direct_entries.bruggeman¶
alias of
Bruggeman
- ionworks_schema.direct_entries.constant_electrolyte¶
alias of
ConstantElectrolyte
- ionworks_schema.direct_entries.from_json¶
alias of
FromJson
- ionworks_schema.direct_entries.landesfeind_electrolyte¶
alias of
LandesfeindElectrolyte
- ionworks_schema.direct_entries.li_plating_defaults¶
alias of
LiPlatingDefaults
- ionworks_schema.direct_entries.lithium_metal_anode¶
alias of
LithiumMetalAnode
- ionworks_schema.direct_entries.mechanical_degradation_defaults¶
alias of
MechanicalDegradationDefaults
- ionworks_schema.direct_entries.nyman_electrolyte¶
alias of
NymanElectrolyte
- ionworks_schema.direct_entries.one_cm2_cell¶
alias of
OneCm2Cell
- ionworks_schema.direct_entries.sei_defaults¶
alias of
SeiDefaults
- ionworks_schema.direct_entries.spm_defaults¶
alias of
SpmDefaults
- ionworks_schema.direct_entries.standard_defaults¶
alias of
StandardDefaults
- ionworks_schema.direct_entries.temperatures¶
alias of
Temperatures
- ionworks_schema.direct_entries.zero_activation_energy¶
alias of
ZeroActivationEnergy
- ionworks_schema.direct_entries.zero_entropic_change¶
alias of
ZeroEntropicChange