Resolve the list in jupyter
@@ -18,6 +18,7 @@ from importlib import import_module
logger = logging.getLogger(__name__)
+
@magics_class
class WandBMagics(Magics):
def __init__(self, shell, require_interaction=False):
@@ -41,6 +42,7 @@ class WandBMagics(Magics):
if cell is not None:
get_ipython().run_cell(cell)
+
def attempt_colab_login(app_url):
"""This renders an iframe to wandb in the hopes it posts back an api key"""
from google.colab import output
@@ -81,6 +83,7 @@ def attempt_colab_login(app_url):
except MessageError:
return None
+
def notebook_metadata():
"""Attempts to query jupyter for the path and name of the notebook file"""
error_message = "Failed to query for notebook name, you can set it manually with the WANDB_NOTEBOOK_NAME environment variable"
@@ -88,7 +91,7 @@ def notebook_metadata():
import ipykernel
from notebook.notebookapp import list_running_servers
kernel_id = re.search('kernel-(.*).json', ipykernel.connect.get_connection_file()).group(1)
- servers = list_running_servers()
+ servers = list(list_running_servers())
except Exception:
logger.error(error_message)
return {}
@@ -107,6 +110,7 @@ def notebook_metadata():
return {"root": s['notebook_dir'], "path": nn['notebook']['path'], "name": nn['notebook']['name']}
return {}
+
class JupyterAgent(object):
"""A class that only logs metrics after `wandb.log` has been called and stops logging at cell completion"""
