Skip to content

Commit 54affa2

Browse files
Add Google-style docstrings to Actor model entity (#311)
This PR expands the Actor class docstring and adds a Google-style docstring to its __init__ method, following the example described in issue #294. No functional changes. The new docstrings are visible via IDE hover (VS Code / PyCharm) and via help(Actor).
1 parent 3ccf460 commit 54affa2

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

pytm/pytm.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,19 @@ def dfd(self, **kwargs):
18171817

18181818

18191819
class Actor(Element):
1820-
"""An entity usually initiating actions"""
1820+
"""An entity usually initiating actions.
1821+
1822+
Actors represent users or external systems that initiate
1823+
interactions with the system being modeled.
1824+
1825+
Attributes:
1826+
port (int): Default TCP port for outgoing data flows.
1827+
protocol (str): Default network protocol for outgoing data flows.
1828+
data (list): pytm.Data objects carried in outgoing data flows.
1829+
inputs (list): Incoming Dataflows.
1830+
outputs (list): Outgoing Dataflows.
1831+
isAdmin (bool): Indicates whether the actor has administrative privileges.
1832+
"""
18211833

18221834
port = varInt(-1, doc="Default TCP port for outgoing data flows")
18231835
protocol = varString("", doc="Default network protocol for outgoing data flows")
@@ -1827,10 +1839,24 @@ class Actor(Element):
18271839
isAdmin = varBool(False)
18281840

18291841
def __init__(self, name, **kwargs):
1842+
"""
1843+
Initialize an Actor.
1844+
1845+
Args:
1846+
name (str): Name of the actor.
1847+
**kwargs: Optional actor properties.
1848+
port (int): Default TCP port for outgoing data flows.
1849+
protocol (str): Default network protocol for outgoing data flows.
1850+
data (list): pytm.Data objects in outgoing data flows.
1851+
inputs (list): Incoming Dataflows.
1852+
outputs (list): Outgoing Dataflows.
1853+
isAdmin (bool): Indicates administrative privileges.
1854+
"""
18301855
super().__init__(name, **kwargs)
18311856
TM._actors.append(self)
18321857

18331858

1859+
18341860
class Process(Asset):
18351861
"""An entity processing data"""
18361862

0 commit comments

Comments
 (0)