Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation style of hdm parser. #3830

Merged
merged 5 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyaedt/modeler/circuits/PrimitivesEmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def design_type(self):

@pyaedt_function_handler()
def __getitem__(self, compname):
"""
"""Get a component by its name.

Parameters
----------
compname : str
Expand Down
16 changes: 8 additions & 8 deletions pyaedt/sbrplus/hdm_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Parser:
"""

def __init__(self, filename):
"""Initializes parser object with the interpreted header and a pointer to the binary data"""
"""Initialize parser object with the interpreted header and a pointer to the binary data."""
self.parser_types = {}
self.parser_flags = {}
self.parser_enums = {}
Expand All @@ -42,11 +42,11 @@ def __init__(self, filename):
self.binarycontent = binarycontent

def parse_message(self):
"""Parses the binary content of the HDM file"""
"""Parse the binary content of the HDM file."""
return self._parse(self.message["type"])

def _parse(self, type_name):
"""Generic parser method, dispatches to specialized ones"""
"""Use a generic parser method, which dispatches to appropriate and specialized parsers."""
if self.parser_types[type_name]["type"] == "object":
return self._parse_object(type_name)
elif self.parser_types[type_name]["type"] == "internal":
Expand Down Expand Up @@ -86,9 +86,9 @@ def _parse_simple_base_type(self, format="i", size=4, how_many=1, final_type=Non

def _parse_list(self, type=None, base=None, size=1):
"""
Parser for vector or list. 'vector's are to be interpreted in the linear algebra sense,
and converted to numpy.array. 'list's are Python lists. Only simple base types can be
interpreted as a numpy array
Parser for vector or list. A vector is interpreted in the linear algebra sense
and converted to a NumPy array. A list is converted to a Python list. Only simple base types can be
interpreted as a NumPy array.
"""
assert base != None
res = []
Expand All @@ -115,7 +115,7 @@ def _parse_list(self, type=None, base=None, size=1):
return res

def _parse_object(self, name):
"""Parser for an object message"""
"""Parser for an object message."""
namesdict = {}
for l in self.parser_types[name]["layout"]:
type_to_parse = l["type"]
Expand Down Expand Up @@ -163,7 +163,7 @@ def _parse_object(self, name):
return self.objects[name](namesdict)

def _read_header(self):
"""Parses the header and prepares all data structures to interpret the binary content"""
"""Parse the header and prepare all data structures to interpret the binary content."""

def build_type(self, key, val):
type_i = val["type"]
Expand Down
Loading