Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## v0.9.0

* Set status to `failed` or `terminated` if the context manager is used and there is an exception.

## v0.8.0

* Support NumPy arrays, PyTorch tensors, Matplotlib and Plotly plots and picklable Python objects as artifacts.
Expand Down
2 changes: 1 addition & 1 deletion simvue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from simvue.client import Client
from simvue.handler import Handler
from simvue.models import RunInput
__version__ = '0.8.0'
__version__ = '0.9.0'
13 changes: 11 additions & 2 deletions simvue/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,18 @@ def __init__(self, mode='online'):
def __enter__(self):
return self

def __exit__(self, type, value, tb):
def __exit__(self, type, value, traceback):
if self._name and self._status == 'running':
self.set_status('completed')
if not type:
self.set_status('completed')
else:
self.log_event(f"{type.__name__}: {value}")
if type.__name__ in ('KeyboardInterrupt'):
self.set_status('terminated')
else:
if traceback:
self.log_event(f"Traceback: {traceback}")
self.set_status('failed')

def _check_token(self):
"""
Expand Down