Skip to content

Commit

Permalink
DOC: Update the documentation for nx.Pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Apr 14, 2024
1 parent 2e7e9cc commit 7f55c61
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
97 changes: 97 additions & 0 deletions wrapping/python/docs/source/DataObjects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,100 @@ Geometry
----------

Please see the :ref:`Geometry<Geometry Descriptions>` documentation.

Pipeline
--------

The Pipeline object holds a collections of filters. This collection can come from loading a .d3dpipeline file,
or from programmatically appending filters into a `nx.Pipeline` object.

.. attention::

This API is still in development so expect some changes


.. py:class:: Pipeline
This class holds a DREAM3D-NX pipeline which consists of a number of Filter instances.

:ivar dtype: The type of Data stored in the DataStore

.. py:method:: from_file(file_path)
:ivar file_path: PathLike: The filepath to the input pipeline file

.. py:method:: to_file(name, output_file_path)
:ivar name: str: The name of the pipeline. Can be different from the file name
:ivar output_file_path: PathLike: The filepath to the output pipeline file

.. py:method:: execute(data_structure)
:ivar data_structure: nx.DataStructure:
:return: The result of executing the pipeline
:rtype: nx.IFilter.ExecuteResult

.. py:method:: size()
:return: The number of filters in the pipeline

.. py:method:: insert(index, filter, parameters)
Inserts a new filter at the index specified with the specified argument dictionary

:ivar index: The index to insert the filter at. (Zero based indexing)
:ivar filter: The filter to insert
:ivar parameters: Dictionary: The dictionary of arguments (parameters) that the filter will use when it is executed.

.. py:method:: append(filter, parameters)
:ivar filter: nx.IFilter: The filter to append to the pipeline
:ivar parameters: Dictionary: The dictionary of arguments (parameters) that the filter will use when it is executed.

.. py:method:: clear()
Removes all filters from the pipeline

.. py:method:: remove(index)
Removes a filter at the given index (Zero based indexing)

.. code:: python
# Shows modifying a pipeline that is read in from disk
# Create the DataStructure instance
data_structure = nx.DataStructure()
# Read the pipeline file
pipeline = nx.Pipeline().from_file( 'Pipelines/lesson_2.d3dpipeline')
create_data_array_args:dict = {
"data_format": "",
"component_count":1,
"initialization_value":"0",
"numeric_type":nx.NumericType.int8,
"output_data_array":nx.DataPath("Geometry/Cell Data/data"),
"advanced_options": False,
"tuple_dimensions": [[10,20,30]]
}
pipeline[1].set_args(create_data_array_args)
# Execute the modified pipeline
result = pipeline.execute(data_structure)
nxutility.check_pipeline_result(result=result)
# Save the modified pipeline to a file.
pipeline.to_file( "Modified Pipeline", "Output/lesson_2b_modified_pipeline.d3dpipeline")
.. py:class:: PipelineFilter
This class represents a filter in a Pipeline object.

.. py:method:: get_args()
Returns the dictionary of parameters for a filter

.. py:method:: set_args(args)
Sets the dictionary of parameters that a filter will use.

.. py:method:: get_filter()
Returns the nx.IFilter object
1 change: 1 addition & 0 deletions wrapping/python/docs/source/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ scales, allowing for connections and correlations to be assessed.
:target: path

Mapping between AttributeMatrix using **Cell Data** "FeatureIds" to link to the feature data and **Cell Data** "Phases" to link to the Ensemble Data

--------------

.. figure:: Images/Elements_Features_Ensembles.png
Expand Down

0 comments on commit 7f55c61

Please sign in to comment.