Skip to content

Commit 833ceca

Browse files
committed
Improve runtime log
1 parent b6c244d commit 833ceca

5 files changed

Lines changed: 417 additions & 267 deletions

File tree

dapi/__init__.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"""
44
from .client import DSClient
55

6-
# Import exceptions from the exceptions module
7-
# Make sure ALL exceptions you want to expose are listed here
6+
# Import exceptions
87
from .exceptions import (
98
DapiException,
109
AuthenticationError,
@@ -14,14 +13,32 @@
1413
JobMonitorError,
1514
)
1615

16+
# Import key classes/functions from jobs module
17+
from .jobs import (
18+
SubmittedJob,
19+
interpret_job_status,
20+
# Import status constants for user access if needed
21+
STATUS_TIMEOUT,
22+
STATUS_INTERRUPTED,
23+
STATUS_MONITOR_ERROR,
24+
STATUS_UNKNOWN,
25+
TAPIS_TERMINAL_STATES,
26+
)
27+
1728

18-
__version__ = "1.0.0"
29+
__version__ = "1.1.0"
1930

20-
# Define what gets imported with 'from dapi import *'
21-
# Also helps linters and clarifies the public API
2231
__all__ = [
2332
"DSClient",
24-
# List ALL exported exceptions here
33+
"SubmittedJob",
34+
"interpret_job_status",
35+
# Export status constants
36+
"STATUS_TIMEOUT",
37+
"STATUS_INTERRUPTED",
38+
"STATUS_MONITOR_ERROR",
39+
"STATUS_UNKNOWN",
40+
"TAPIS_TERMINAL_STATES",
41+
# Export exceptions
2542
"DapiException",
2643
"AuthenticationError",
2744
"FileOperationError",

dapi/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .db.accessor import DatabaseAccessor
88

99
# Import only the necessary classes/functions from jobs
10-
from .jobs import SubmittedJob # JobDefinition is no longer needed
10+
from .jobs import SubmittedJob, interpret_job_status
1111
from typing import List, Optional, Dict, Any
1212

1313

@@ -146,3 +146,7 @@ def get_status(self, job_uuid: str) -> str:
146146
def get_runtime_summary(self, job_uuid: str, verbose: bool = False):
147147
"""Prints the runtime summary for a job by UUID."""
148148
jobs_module.get_runtime_summary(self._tapis, job_uuid, verbose=verbose)
149+
150+
def interpret_status(self, final_status: str, job_uuid: Optional[str] = None):
151+
"""Prints a user-friendly interpretation of the final job status."""
152+
jobs_module.interpret_job_status(final_status, job_uuid)

0 commit comments

Comments
 (0)