Skip to content

Commit

Permalink
update generated code (#1646)
Browse files Browse the repository at this point in the history
Co-authored-by: rlagha <[email protected]>
  • Loading branch information
pyansys-ci-bot and rlagha authored Jul 2, 2024
1 parent bd80f7a commit 59f26bf
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 229 deletions.
10 changes: 5 additions & 5 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/ansys/dpf/core/operators/mesh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from .mesh_to_graphics_edges import mesh_to_graphics_edges
from .mesh_to_pyvista import mesh_to_pyvista
from .mesh_to_tetra import mesh_to_tetra
from .meshed_edges_extractors import meshed_edges_extractors
from .meshes_provider import meshes_provider
from .node_coordinates import node_coordinates
from .points_from_coordinates import points_from_coordinates
Expand Down
220 changes: 0 additions & 220 deletions src/ansys/dpf/core/operators/mesh/meshed_edges_extractors.py

This file was deleted.

39 changes: 38 additions & 1 deletion src/ansys/dpf/core/operators/result/pres_to_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class pres_to_field(Operator):
----------
filepath : str
Filepath
columns_to_read : int, optional
Columns_to_read
Examples
Expand All @@ -30,22 +32,27 @@ class pres_to_field(Operator):
>>> # Make input connections
>>> my_filepath = str()
>>> op.inputs.filepath.connect(my_filepath)
>>> my_columns_to_read = int()
>>> op.inputs.columns_to_read.connect(my_columns_to_read)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.result.pres_to_field(
... filepath=my_filepath,
... columns_to_read=my_columns_to_read,
... )
>>> # Get output data
>>> result_field = op.outputs.field()
"""

def __init__(self, filepath=None, config=None, server=None):
def __init__(self, filepath=None, columns_to_read=None, config=None, server=None):
super().__init__(name="PRES_Reader", config=config, server=server)
self._inputs = InputsPresToField(self)
self._outputs = OutputsPresToField(self)
if filepath is not None:
self.inputs.filepath.connect(filepath)
if columns_to_read is not None:
self.inputs.columns_to_read.connect(columns_to_read)

@staticmethod
def _spec():
Expand All @@ -59,6 +66,12 @@ def _spec():
optional=False,
document="""Filepath""",
),
1: PinSpecification(
name="columns_to_read",
type_names=["int32"],
optional=True,
document="""Columns_to_read""",
),
},
map_output_pin_spec={
0: PinSpecification(
Expand Down Expand Up @@ -118,12 +131,16 @@ class InputsPresToField(_Inputs):
>>> op = dpf.operators.result.pres_to_field()
>>> my_filepath = str()
>>> op.inputs.filepath.connect(my_filepath)
>>> my_columns_to_read = int()
>>> op.inputs.columns_to_read.connect(my_columns_to_read)
"""

def __init__(self, op: Operator):
super().__init__(pres_to_field._spec().inputs, op)
self._filepath = Input(pres_to_field._spec().input_pin(0), 0, op, -1)
self._inputs.append(self._filepath)
self._columns_to_read = Input(pres_to_field._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._columns_to_read)

@property
def filepath(self):
Expand All @@ -145,6 +162,26 @@ def filepath(self):
"""
return self._filepath

@property
def columns_to_read(self):
"""Allows to connect columns_to_read input to the operator.
Columns_to_read
Parameters
----------
my_columns_to_read : int
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.pres_to_field()
>>> op.inputs.columns_to_read.connect(my_columns_to_read)
>>> # or
>>> op.inputs.columns_to_read(my_columns_to_read)
"""
return self._columns_to_read


class OutputsPresToField(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
Loading

0 comments on commit 59f26bf

Please sign in to comment.