Skip to content

Improve Thermal API method Docstrings #520

Open
@JackB-Ansys

Description

@JackB-Ansys

Description of the modifications

Expand docstrings for thermal API methods such as set_resistance_value in rpc_methods_thermal.py.

The docstrings should:

  • Specify the accepted data types (int, float, string etc.) for arguments.
  • Provide a description of the arguments.
  • In some cases, provide a better explanation of what the method does. (For the example below, "Set or create a thermal resistance in the Motor-CAD thermal circuit.")

For example:

def set_resistance_value(self, name, node1, node2, value, description):
    """Set or create a resistance."""

This method docstring should specify that the node1 and node2 arguments must be an integer. Otherwise, the resulting error message can be confusing to the user. For example, if an integer number is provided as a float type, we get the following error:

MotorCADError: SetResistanceValue: One or more parameter types were invalid. HINT [: Cannot map all parameters to remote method. Invalid
Request. The JSON sent is not a valid Request object. [HINT] node1: Integer]

This error is not concise or clear in this case.

Useful links and references

No response

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions