Direct Entries

The base class for all direct entries is DirectEntry.

class ionworkspipeline.direct_entries.DirectEntry(parameters: ParameterValues, source)

Directly provide parameters without calculation or fitting.

DirectEntry elements supply pre-defined parameter values to the pipeline, typically from literature, manufacturer specifications, or manual entry.

Parameters

parametersiwp.ParameterValues

Dictionary of parameter names and values to provide.

sourcestr

Reference or description of where these parameters came from (e.g., paper citation, datasheet reference).

Examples

Provide geometric parameters:

>>> from ionworkspipeline.direct_entries import DirectEntry
>>> params = iwp.ParameterValues({
...     "Electrode height [m]": 0.1,
...     "Electrode width [m]": 0.08,
...     "Negative electrode thickness [m]": 100e-6,
... })
>>> entry = DirectEntry(params, source="Cell datasheet v2.1")
>>> result = entry.run(iwp.ParameterValues({}))
>>> result["Electrode height [m]"]
0.1

Extends: ionworkspipeline.pipeline.PipelineElement

classmethod from_db(pipeline_id)

Create a DirectEntry that will load results from an Ionworks Studio pipeline.

The actual API call is deferred to run(), which validates that the pipeline is completed before fetching results.

Parameters

pipeline_idstr

The ID of the pipeline job on Ionworks Studio.

Returns

DirectEntry

A DirectEntry that will fetch results on first run().

run(parameter_values: ParameterValues) ParameterValues

Return the stored parameters. If this entry was created with a pipeline_id, fetches the results from Ionworks Studio on first run.

Parameters

parameter_valuesiwp.ParameterValues

Input parameters (ignored by DirectEntry but required for interface consistency).

Returns

iwp.ParameterValues

Copy of stored parameters.

Examples

>>> from ionworkspipeline.direct_entries import DirectEntry
>>> params = iwp.ParameterValues({"Electrode height [m]": 0.1})
>>> entry = DirectEntry(params, source="Manual entry")
>>> result = entry.run(iwp.ParameterValues({}))
>>> "Electrode height [m]" in result
True
to_config() dict

Convert the DirectEntry back to parser configuration format.

Returns

dict

Configuration dictionary that can be passed to parse_entry

A useful function for creating direct entries from values stored in JSON format is:

ionworkspipeline.direct_entries.from_json(file_path)

Reads parameters from a JSON file and returns a DirectEntry object.

Parameters

file_pathstr

The path to the JSON file.

Returns

DirectEntry

The DirectEntry object with parameters read from the JSON file.

The following direct entries are available: