Skip to content

Commit 24551da

Browse files
committed
add doc strings for method implementations
1 parent b6cd2c2 commit 24551da

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/access/parsers/payujson_profiling.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,26 @@ def __init__(self):
3535

3636
@property
3737
def metrics(self) -> list:
38+
"""Implements "metrics" abstract method/property.
39+
40+
Returns:
41+
list: the metric names captured by this parser.
42+
"""
3843
return self._metrics
3944

4045
def read(self, stream: str) -> dict:
46+
"""Implements "read" abstract method to parse a JSON file generated by Payu.
47+
48+
Args:
49+
stream (str): String containing valid JSON to be parsed.
50+
51+
Returns:
52+
dict: Parsed timing information.
53+
54+
Raises:
55+
KeyError: when "timings" key is missing in input JSON.
56+
ValueError: if stream is not a string with valid JSON.
57+
"""
4158

4259
try:
4360
timings = json.loads(stream)["timings"]

0 commit comments

Comments
 (0)