Skip to content

Commit

Permalink
Added capture_traceback in neptune.init (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Sep 7, 2021
1 parent fadedee commit 9a08513
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## neptune-client 0.10.9 [UNRELEASED]

### Features
- Added capture_traceback in neptune.init() ([#676](https://github.com/neptune-ai/neptune-client/pull/676))

## neptune-client 0.10.8

### Fixes
Expand Down
8 changes: 7 additions & 1 deletion neptune/new/internal/init_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def init(project: Optional[str] = None,
monitoring_namespace: Optional[str] = None,
flush_period: float = 5,
proxies: Optional[dict] = None,
capture_traceback: bool = True,
**kwargs) -> Run:
"""Starts a new tracked run, and append it to the top of the Runs table view.
Expand Down Expand Up @@ -158,6 +159,9 @@ def init(project: Optional[str] = None,
proxies (dict of str, optional): Argument passed to HTTP calls made via the Requests library.
For more information see
`their proxies section <https://2.python-requests.org/en/master/user/advanced/#proxies>`_.
capture_traceback (bool, optional): Whether to send run鈥檚 traceback in case of an exception.
Defaults to `True`.
Tracked metadata will be stored inside `monitoring/traceback`.
Returns:
``Run``: object that is used to manage the tracked run and log metadata to it.
Expand Down Expand Up @@ -218,6 +222,7 @@ def init(project: Optional[str] = None,
verify_type("monitoring_namespace", monitoring_namespace, (str, type(None)))
verify_type("flush_period", flush_period, (int, float))
verify_type("proxies", proxies, (dict, type(None)))
verify_type("capture_traceback", capture_hardware_metrics, bool)
if tags is not None:
if isinstance(tags, str):
tags = [tags]
Expand Down Expand Up @@ -326,7 +331,8 @@ def init(project: Optional[str] = None,
websockets_factory = backend.websockets_factory(project_obj.uuid, api_run.uuid)
if websockets_factory:
background_jobs.append(WebsocketSignalsBackgroundJob(websockets_factory))
background_jobs.append(TracebackJob(traceback_path, fail_on_exception))
if capture_traceback:
background_jobs.append(TracebackJob(traceback_path, fail_on_exception))
background_jobs.append(PingBackgroundJob())

_run = Run(api_run.uuid, backend, operation_processor, BackgroundJobList(background_jobs), run_lock,
Expand Down

0 comments on commit 9a08513

Please sign in to comment.