diff --git a/src/ansys/dpf/core/operators/__init__.py b/src/ansys/dpf/core/operators/__init__.py index 42ff1927792..d6cc6da1f45 100644 --- a/src/ansys/dpf/core/operators/__init__.py +++ b/src/ansys/dpf/core/operators/__init__.py @@ -2,6 +2,7 @@ from . import compression from . import filter from . import geo +from . import info from . import invariant from . import logic from . import mapping diff --git a/src/ansys/dpf/core/operators/info/__init__.py b/src/ansys/dpf/core/operators/info/__init__.py new file mode 100644 index 00000000000..c48c735b3a9 --- /dev/null +++ b/src/ansys/dpf/core/operators/info/__init__.py @@ -0,0 +1 @@ +from .markdown_latex_example import markdown_latex_example diff --git a/src/ansys/dpf/core/operators/info/markdown_latex_example.py b/src/ansys/dpf/core/operators/info/markdown_latex_example.py new file mode 100644 index 00000000000..3d56c3b6c8e --- /dev/null +++ b/src/ansys/dpf/core/operators/info/markdown_latex_example.py @@ -0,0 +1,952 @@ +""" +markdown_latex_example + +Autogenerated DPF operator classes. +""" + +from __future__ import annotations + +from warnings import warn +from ansys.dpf.core.dpf_operator import Operator +from ansys.dpf.core.inputs import Input, _Inputs +from ansys.dpf.core.outputs import Output, _Outputs +from ansys.dpf.core.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class markdown_latex_example(Operator): + r"""This operator showcases the use of Markdown and LaTeX in operator and + pin descriptions: # Headings ## h2 ### h3 #### h4 ##### h5 + + Text + ==== + + This should result in a paragraph it’s that simple. + + *italic*, **bold** + + Lists + ===== + + - an *unordered list* + + - with **some hierarchy** + + 1. and an ordered + 2. mixed + + - list + - directly + + - inside + + Code + ==== + + Code block + ---------- + + .. code:: c + + std::string a = 'test'; + + .. code:: js + + var a = 'test'; + + .. code:: python + + a: str = 'test' + + Inline code + ----------- + + And well ``inline code`` should also work. + + Quotes + ====== + + A Quote + + With *some text* **blocks inside** + + - even a list + - should be + - possible + + Links + ----- + + Links such as `link `__. + + Images + ------ + + .. figure:: + https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png + :alt: an image + + an image + + Separations + ----------- + + -------------- + + Checklists + ---------- + + - ☐ how + - ☐ about + + - ☐ a + - ☒ nice + + - ☒ check + - ☐ list + + Tables + ------ + + =========== ============= =========== + Left header middle header last header + =========== ============= =========== + cell 1 cell **2** cell 3 + cell 4 cell 5 cell 6 + =========== ============= =========== + + LaTeX + ----- + + An inline equation :math:`x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.` using + LaTeX dollar delimiters. + + An inline equation (x = :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.) + using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + + .. math:: x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}. + + An equation on its own using square bracket delimiters: [x = + :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.] + + + Inputs + ------ + bogus_input: str, optional + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Outputs + ------- + bogus_output: + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.info.markdown_latex_example() + + >>> # Make input connections + >>> my_bogus_input = str() + >>> op.inputs.bogus_input.connect(my_bogus_input) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.info.markdown_latex_example( + ... bogus_input=my_bogus_input, + ... ) + + >>> # Get output data + >>> result_bogus_output = op.outputs.bogus_output() + """ + + _inputs: InputsMarkdownLatexExample + _outputs: OutputsMarkdownLatexExample + + def __init__(self, bogus_input=None, config=None, server=None): + super().__init__(name="markdown_latex_example", config=config, server=server) + self._inputs = InputsMarkdownLatexExample(self) + self._outputs = OutputsMarkdownLatexExample(self) + if bogus_input is not None: + self.inputs.bogus_input.connect(bogus_input) + + @staticmethod + def _spec() -> Specification: + description = r"""This operator showcases the use of Markdown and LaTeX in operator and +pin descriptions: # Headings ## h2 ### h3 #### h4 ##### h5 + +Text +==== + +This should result in a paragraph it’s that simple. + +*italic*, **bold** + +Lists +===== + +- an *unordered list* + + - with **some hierarchy** + + 1. and an ordered + 2. mixed + + - list + - directly + + - inside + +Code +==== + +Code block +---------- + +.. code:: c + + std::string a = 'test'; + +.. code:: js + + var a = 'test'; + +.. code:: python + + a: str = 'test' + +Inline code +----------- + +And well ``inline code`` should also work. + +Quotes +====== + + A Quote + + With *some text* **blocks inside** + + - even a list + - should be + - possible + +Links +----- + +Links such as `link `__. + +Images +------ + +.. figure:: + https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png + :alt: an image + + an image + +Separations +----------- + +-------------- + +Checklists +---------- + +- ☐ how +- ☐ about + + - ☐ a + - ☒ nice + +- ☒ check +- ☐ list + +Tables +------ + +=========== ============= =========== +Left header middle header last header +=========== ============= =========== +cell 1 cell **2** cell 3 +cell 4 cell 5 cell 6 +=========== ============= =========== + +LaTeX +----- + +An inline equation :math:`x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.` using +LaTeX dollar delimiters. + +An inline equation (x = :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.) +using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: + +.. math:: x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}. + +An equation on its own using square bracket delimiters: [x = +:raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.] +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="bogus_input", + type_names=["string"], + optional=True, + document=r"""This pin showcases the use of Markdown and LaTeX in pin descriptions: +# Headings +## h2 +### h3 +#### h4 +##### h5 + +# Text +This should result in a paragraph +it's that simple. + + +*italic*, **bold** + +# Lists +* an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + +# Code +## Code block +```c +std::string a = 'test'; +``` +```js +var a = 'test'; +``` +```python +a: str = 'test' +``` +## Inline code +And well `inline code` should also work. + +# Quotes + +> A Quote +> +> With *some text* **blocks inside** +> +> * even a list +> * should be +> * possible + +## Links +Links such as [link](https://docs.pyansys.com/). + +## Images +![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + +## Separations + +--- + +## Checklists + +- [ ] how +- [ ] about + - [ ] a + - [x] nice +- [x] check +- [ ] list + +## Tables + +| Left header | middle header | last header | +|-------------|---------------|-------------| +| cell 1 | cell **2** | cell 3 | +| cell 4 | cell 5 | cell 6 | + + +## LaTeX + +An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + +An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + +An equation on its own using square bracket delimiters: +\[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] +""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="bogus_output", + optional=False, + document=r"""This pin showcases the use of Markdown and LaTeX in pin descriptions: +# Headings +## h2 +### h3 +#### h4 +##### h5 + +# Text +This should result in a paragraph +it's that simple. + + +*italic*, **bold** + +# Lists +* an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + +# Code +## Code block +```c +std::string a = 'test'; +``` +```js +var a = 'test'; +``` +```python +a: str = 'test' +``` +## Inline code +And well `inline code` should also work. + +# Quotes + +> A Quote +> +> With *some text* **blocks inside** +> +> * even a list +> * should be +> * possible + +## Links +Links such as [link](https://docs.pyansys.com/). + +## Images +![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + +## Separations + +--- + +## Checklists + +- [ ] how +- [ ] about + - [ ] a + - [x] nice +- [x] check +- [ ] list + +## Tables + +| Left header | middle header | last header | +|-------------|---------------|-------------| +| cell 1 | cell **2** | cell 3 | +| cell 4 | cell 5 | cell 6 | + + +## LaTeX + +An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + +An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + +An equation on its own using square bracket delimiters: +\[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] +""", + ), + }, + ) + return spec + + @staticmethod + def default_config(server: AnyServerType = None) -> Config: + """Returns the default config of the operator. + + This config can then be changed to the user needs and be used to + instantiate the operator. The Configuration allows to customize + how the operation will be processed by the operator. + + Parameters + ---------- + server: + Server with channel connected to the remote or local instance. When + ``None``, attempts to use the global server. + + Returns + ------- + config: + A new Config instance equivalent to the default config for this operator. + """ + return Operator.default_config(name="markdown_latex_example", server=server) + + @property + def inputs(self) -> InputsMarkdownLatexExample: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsMarkdownLatexExample. + """ + return self._inputs + + @property + def outputs(self) -> OutputsMarkdownLatexExample: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsMarkdownLatexExample. + """ + return self._outputs + + +class InputsMarkdownLatexExample(_Inputs): + """Intermediate class used to connect user inputs to + markdown_latex_example operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> my_bogus_input = str() + >>> op.inputs.bogus_input.connect(my_bogus_input) + """ + + def __init__(self, op: Operator): + super().__init__(markdown_latex_example._spec().inputs, op) + self._bogus_input: Input[str] = Input( + markdown_latex_example._spec().input_pin(0), 0, op, -1 + ) + self._inputs.append(self._bogus_input) + + @property + def bogus_input(self) -> Input[str]: + r"""Allows to connect bogus_input input to the operator. + + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> op.inputs.bogus_input.connect(my_bogus_input) + >>> # or + >>> op.inputs.bogus_input(my_bogus_input) + """ + return self._bogus_input + + +class OutputsMarkdownLatexExample(_Outputs): + """Intermediate class used to get outputs from + markdown_latex_example operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> # Connect inputs : op.inputs. ... + >>> result_bogus_output = op.outputs.bogus_output() + """ + + def __init__(self, op: Operator): + super().__init__(markdown_latex_example._spec().outputs, op) + self._bogus_output: Output = Output( + markdown_latex_example._spec().output_pin(0), 0, op + ) + self._outputs.append(self._bogus_output) + + @property + def bogus_output(self) -> Output: + r"""Allows to get bogus_output output of the operator + + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> # Get the output from op.outputs. ... + >>> result_bogus_output = op.outputs.bogus_output() + """ + return self._bogus_output diff --git a/src/ansys/dpf/core/operators/result/__init__.py b/src/ansys/dpf/core/operators/result/__init__.py index 90cd25dd985..5cae26b6e05 100644 --- a/src/ansys/dpf/core/operators/result/__init__.py +++ b/src/ansys/dpf/core/operators/result/__init__.py @@ -189,6 +189,7 @@ from .joint_relative_rotation import joint_relative_rotation from .joint_relative_velocity import joint_relative_velocity from .kinetic_energy import kinetic_energy +from .layer_orientation_provider import layer_orientation_provider from .mach_number import mach_number from .magnetic_field import magnetic_field from .magnetic_field_X import magnetic_field_X diff --git a/src/ansys/dpf/core/operators/result/layer_orientation_provider.py b/src/ansys/dpf/core/operators/result/layer_orientation_provider.py new file mode 100644 index 00000000000..129c3c0b317 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/layer_orientation_provider.py @@ -0,0 +1,257 @@ +""" +layer_orientation_provider + +Autogenerated DPF operator classes. +""" + +from __future__ import annotations +from typing import TYPE_CHECKING + +from warnings import warn +from ansys.dpf.core.dpf_operator import Operator +from ansys.dpf.core.inputs import Input, _Inputs +from ansys.dpf.core.outputs import Output, _Outputs +from ansys.dpf.core.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + +if TYPE_CHECKING: + from ansys.dpf.core.data_sources import DataSources + from ansys.dpf.core.fields_container import FieldsContainer + from ansys.dpf.core.streams_container import StreamsContainer + + +class layer_orientation_provider(Operator): + r"""Read the layer orientations. + + + Inputs + ------ + streams: StreamsContainer, optional + Result file container allowed to be kept open to cache data. + data_sources: DataSources + Result file path container, used if no streams are set. + + Outputs + ------- + layer_orientation_data: FieldsContainer + Requested data as FieldsContainer. + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.layer_orientation_provider() + + >>> # Make input connections + >>> my_streams = dpf.StreamsContainer() + >>> op.inputs.streams.connect(my_streams) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.layer_orientation_provider( + ... streams=my_streams, + ... data_sources=my_data_sources, + ... ) + + >>> # Get output data + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + + _inputs: InputsLayerOrientationProvider + _outputs: OutputsLayerOrientationProvider + + def __init__(self, streams=None, data_sources=None, config=None, server=None): + super().__init__( + name="layer_orientation_provider", config=config, server=server + ) + self._inputs = InputsLayerOrientationProvider(self) + self._outputs = OutputsLayerOrientationProvider(self) + if streams is not None: + self.inputs.streams.connect(streams) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + + @staticmethod + def _spec() -> Specification: + description = r"""Read the layer orientations. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 3: PinSpecification( + name="streams", + type_names=["streams_container"], + optional=True, + document=r"""Result file container allowed to be kept open to cache data.""", + ), + 4: PinSpecification( + name="data_sources", + type_names=["data_sources"], + optional=False, + document=r"""Result file path container, used if no streams are set.""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="layer_orientation_data", + type_names=["fields_container"], + optional=False, + document=r"""Requested data as FieldsContainer.""", + ), + }, + ) + return spec + + @staticmethod + def default_config(server: AnyServerType = None) -> Config: + """Returns the default config of the operator. + + This config can then be changed to the user needs and be used to + instantiate the operator. The Configuration allows to customize + how the operation will be processed by the operator. + + Parameters + ---------- + server: + Server with channel connected to the remote or local instance. When + ``None``, attempts to use the global server. + + Returns + ------- + config: + A new Config instance equivalent to the default config for this operator. + """ + return Operator.default_config(name="layer_orientation_provider", server=server) + + @property + def inputs(self) -> InputsLayerOrientationProvider: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsLayerOrientationProvider. + """ + return self._inputs + + @property + def outputs(self) -> OutputsLayerOrientationProvider: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsLayerOrientationProvider. + """ + return self._outputs + + +class InputsLayerOrientationProvider(_Inputs): + """Intermediate class used to connect user inputs to + layer_orientation_provider operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> my_streams = dpf.StreamsContainer() + >>> op.inputs.streams.connect(my_streams) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + """ + + def __init__(self, op: Operator): + super().__init__(layer_orientation_provider._spec().inputs, op) + self._streams: Input[StreamsContainer] = Input( + layer_orientation_provider._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams) + self._data_sources: Input[DataSources] = Input( + layer_orientation_provider._spec().input_pin(4), 4, op, -1 + ) + self._inputs.append(self._data_sources) + + @property + def streams(self) -> Input[StreamsContainer]: + r"""Allows to connect streams input to the operator. + + Result file container allowed to be kept open to cache data. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> op.inputs.streams.connect(my_streams) + >>> # or + >>> op.inputs.streams(my_streams) + """ + return self._streams + + @property + def data_sources(self) -> Input[DataSources]: + r"""Allows to connect data_sources input to the operator. + + Result file path container, used if no streams are set. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + +class OutputsLayerOrientationProvider(_Outputs): + """Intermediate class used to get outputs from + layer_orientation_provider operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> # Connect inputs : op.inputs. ... + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + + def __init__(self, op: Operator): + super().__init__(layer_orientation_provider._spec().outputs, op) + self._layer_orientation_data: Output[FieldsContainer] = Output( + layer_orientation_provider._spec().output_pin(0), 0, op + ) + self._outputs.append(self._layer_orientation_data) + + @property + def layer_orientation_data(self) -> Output[FieldsContainer]: + r"""Allows to get layer_orientation_data output of the operator + + Requested data as FieldsContainer. + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> # Get the output from op.outputs. ... + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + return self._layer_orientation_data