Pydpf commands html

Options
Ansyslearner
Ansyslearner Member Posts: 12
First Comment

In some of the pdf docs we received the following images:
How can I get this html documentation with code snippets?

Tagged:

Best Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    Use this code to generate the DPF doc in .html format from Mechanical:

    import mech_dpf
    import Ans.DataProcessing as dpf
    my_output_path = (r"D:\Test\Resources")
    op = dpf.operators.utility.html_doc()
    op.inputs.output_path.Connect(my_output_path)
    op.Run()
    
  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    Indeed this is another place you can get the documentation. However this link is the one to the PyDPF documentation, so you will only see the CPython example of usage.

Answers

  • Ansyslearner
    Ansyslearner Member Posts: 12
    First Comment
    Options

    Thank you for this commands.

  • Ansyslearner
    Ansyslearner Member Posts: 12
    First Comment
    Options

    I see similar code snippets and manual from here:
    https://dpf.docs.pyansys.com/version/stable/operator_reference_load.html

  • Ansyslearner
    Ansyslearner Member Posts: 12
    First Comment
    edited March 18
    Options

    Hi, I am running the equivalent html documentation in Cpython on linux:

    from ansys.dpf import core as dpf
    my_output_path = ('/linux/path/to/my/documentation/')
    op = dpf.operators.utility.html_doc() #operator instantiation
    op.inputs.output_path.connect(my_output_path)
    op.run()
    
    

    I receive the following error (resulting from op.run() line):
    ansys.dpf.gate.errors.DPFServerException: html_doc:0<-basic_string::replace: __pos (which is 18446744073709551615) > this->size() (which is 0)

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    Something could be incorrect in the path definition. Could you try without providing a path ? The default will be working directory.

  • Ansyslearner
    Ansyslearner Member Posts: 12
    First Comment
    Options

    Run from the following lines:
    op = dpf.operators.utility.html_doc() #operator instantiation

    op.inputs.output_path.connect() # Tried with and without commenting this line

    op.run()

    Created the following error message:

    File ".../python3.9/site-packages/ansys/dpf/core/dpf_operator.py", line 645, in run
    self.get_output()
    File ".../python3.9/site-packages/ansys/dpf/core/dpf_operator.py", line 488, in get_output
    return self._api.operator_run(self)
    File ".../python3.9/site-packages/ansys/dpf/gate/generated/operator_capi.py", line 696, in operator_run
    raise errors.DPFServerException(sError.value)
    ansys.dpf.gate.errors.DPFServerException: html_doc:0<-basic_string::replace: __pos (which is 18446744073709551615) > this->size() (which is 0)

    It does create dataProcessingDoc.html with 0 KB.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 804
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Options

    This looks like a bug. Could you please report it by creating an issue here? https://github.com/ansys/pydpf-core/issues Thank you

  • Ansyslearner
    Ansyslearner Member Posts: 12
    First Comment
    edited March 19
    Options

    Noted. Thanks!