cubevis 1.0.36__py3-none-any.whl → 1.0.38__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cubevis/__version__.py +1 -1
- cubevis/bokeh/sources/_data_pipe.py +75 -8
- {cubevis-1.0.36.dist-info → cubevis-1.0.38.dist-info}/METADATA +1 -1
- {cubevis-1.0.36.dist-info → cubevis-1.0.38.dist-info}/RECORD +6 -6
- {cubevis-1.0.36.dist-info → cubevis-1.0.38.dist-info}/WHEEL +0 -0
- {cubevis-1.0.36.dist-info → cubevis-1.0.38.dist-info}/licenses/LICENSE +0 -0
cubevis/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.0.
|
|
1
|
+
__version__ = '1.0.38'
|
|
@@ -90,17 +90,84 @@ class DataPipe(DataSource,BokehInit):
|
|
|
90
90
|
"""Expose the WebSocket port through Colab's proxy"""
|
|
91
91
|
try:
|
|
92
92
|
from google.colab import output
|
|
93
|
+
import os
|
|
94
|
+
import json
|
|
93
95
|
port = self.address[1]
|
|
94
96
|
|
|
95
|
-
#
|
|
96
|
-
|
|
97
|
+
# Expose the port
|
|
98
|
+
output.serve_kernel_port_as_iframe(port)
|
|
99
|
+
|
|
100
|
+
# Try to get kernel connection info
|
|
101
|
+
# Colab stores connection info in environment variables or files
|
|
102
|
+
kernel_info = {}
|
|
103
|
+
|
|
104
|
+
# Check various environment variables
|
|
105
|
+
for key in ['COLAB_KERNEL_ID', 'JPY_SESSION_NAME', 'KERNEL_ID',
|
|
106
|
+
'COLAB_GPU', 'COLAB_TPU_ADDR', 'HOSTNAME']:
|
|
107
|
+
value = os.environ.get(key)
|
|
108
|
+
if value:
|
|
109
|
+
kernel_info[key] = value
|
|
110
|
+
|
|
111
|
+
# Try to read kernel connection file
|
|
112
|
+
try:
|
|
113
|
+
# Jupyter/Colab stores connection info in runtime files
|
|
114
|
+
runtime_dir = os.environ.get('JUPYTER_RUNTIME_DIR', '/root/.local/share/jupyter/runtime')
|
|
115
|
+
if os.path.exists(runtime_dir):
|
|
116
|
+
import glob
|
|
117
|
+
connection_files = glob.glob(os.path.join(runtime_dir, 'kernel-*.json'))
|
|
118
|
+
if connection_files:
|
|
119
|
+
with open(connection_files[0], 'r') as f:
|
|
120
|
+
conn_info = json.load(f)
|
|
121
|
+
kernel_info['connection'] = conn_info
|
|
122
|
+
except Exception as e:
|
|
123
|
+
print(f" Could not read kernel connection file: {e}")
|
|
124
|
+
|
|
125
|
+
# Get the actual WebSocket URL by checking where requests go
|
|
126
|
+
# This is hacky but might work
|
|
97
127
|
try:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
128
|
+
import socket
|
|
129
|
+
hostname = socket.gethostname()
|
|
130
|
+
kernel_info['hostname'] = hostname
|
|
131
|
+
|
|
132
|
+
# Try to get external URL
|
|
133
|
+
import requests
|
|
134
|
+
# Colab has an internal metadata service
|
|
135
|
+
try:
|
|
136
|
+
# This might reveal the actual kernel URL
|
|
137
|
+
metadata_url = "http://metadata.google.internal/computeMetadata/v1/instance/"
|
|
138
|
+
headers = {"Metadata-Flavor": "Google"}
|
|
139
|
+
|
|
140
|
+
# Try to get instance info
|
|
141
|
+
instance_info = {}
|
|
142
|
+
for key in ['hostname', 'name', 'zone', 'id']:
|
|
143
|
+
try:
|
|
144
|
+
resp = requests.get(metadata_url + key, headers=headers, timeout=1)
|
|
145
|
+
if resp.status_code == 200:
|
|
146
|
+
instance_info[key] = resp.text
|
|
147
|
+
except:
|
|
148
|
+
pass
|
|
149
|
+
|
|
150
|
+
if instance_info:
|
|
151
|
+
kernel_info['instance'] = instance_info
|
|
152
|
+
except:
|
|
153
|
+
pass
|
|
154
|
+
|
|
155
|
+
except Exception as e:
|
|
156
|
+
print(f" Could not get hostname: {e}")
|
|
157
|
+
|
|
158
|
+
print(f"✓ Colab: Exposed WebSocket port {port} via iframe proxy")
|
|
159
|
+
print(f" Kernel info: {json.dumps(kernel_info, indent=2)}")
|
|
160
|
+
|
|
161
|
+
# Inject whatever we found into JavaScript
|
|
162
|
+
from IPython.display import display, Javascript
|
|
163
|
+
|
|
164
|
+
display(Javascript(f"""
|
|
165
|
+
window.CUBEVIS_COLAB_PORT_{port} = {{
|
|
166
|
+
port: {port},
|
|
167
|
+
kernelInfo: {json.dumps(kernel_info)}
|
|
168
|
+
}};
|
|
169
|
+
console.log('Colab port info injected:', window.CUBEVIS_COLAB_PORT_{port});
|
|
170
|
+
"""))
|
|
104
171
|
|
|
105
172
|
except Exception as e:
|
|
106
173
|
print(f"⚠ Warning: Could not expose port {port} in Colab: {e}")
|
|
@@ -50,7 +50,7 @@ cubevis/bokeh/models/_showable.py,sha256=7BtQgl0tMSqcZrPrH4FnC2ei_FOVnO-SIhBH1_r
|
|
|
50
50
|
cubevis/bokeh/models/_tip.py,sha256=yNoUWods0xxva1WOfh5It_Y8hbpVy8RVXUmm8p7a58M,1431
|
|
51
51
|
cubevis/bokeh/models/_tip_button.py,sha256=mwk1C7BMVlZrAAyQLn45S4Q9GEQfU_wU2MWpO0Gwzj4,1610
|
|
52
52
|
cubevis/bokeh/sources/__init__.py,sha256=4FsudFuVU4o7VG5OG3K1tiMoxIXcJWNz_K9yzMDE8ls,1581
|
|
53
|
-
cubevis/bokeh/sources/_data_pipe.py,sha256=
|
|
53
|
+
cubevis/bokeh/sources/_data_pipe.py,sha256=7M6D5grIVI5iNI-_E3EsCyDGL46hTR93RGGkHqt8t8c,23630
|
|
54
54
|
cubevis/bokeh/sources/_image_data_source.py,sha256=5sEWdfqoMk08HQ0JWg6bHJ34dWmphHm52nOZywSAE5c,3789
|
|
55
55
|
cubevis/bokeh/sources/_image_pipe.py,sha256=pQ05VynLuJbedGja7aXDbVXFkOYbdMceOuOEj-QuluQ,28692
|
|
56
56
|
cubevis/bokeh/sources/_spectra_data_source.py,sha256=qL1IOjSefWlycaqS4Pz5EHwg-1EwCVmNwxysP9lxDeM,2451
|
|
@@ -127,8 +127,8 @@ cubevis/utils/_pkgs.py,sha256=mu2CCzndmJZYP81UkFhxveW_CisWLUvagJVolHOEVgM,2294
|
|
|
127
127
|
cubevis/utils/_regions.py,sha256=TdAg4ZUUyhg3nFmX9_KLboqmc0LkyOdEW8M1WDR5Udk,1669
|
|
128
128
|
cubevis/utils/_static.py,sha256=rN-sqXNqQ5R2M3wmPHU1GPP5OTyyWQlUPRuimCrht-g,2347
|
|
129
129
|
cubevis/utils/_tiles.py,sha256=A9W1X61VOhBMTOKXVajzOIoiV2FBdO5N2SFB9SUpDOo,7336
|
|
130
|
-
cubevis/__version__.py,sha256=
|
|
131
|
-
cubevis-1.0.
|
|
132
|
-
cubevis-1.0.
|
|
133
|
-
cubevis-1.0.
|
|
134
|
-
cubevis-1.0.
|
|
130
|
+
cubevis/__version__.py,sha256=PxK7trj3XRaJAWKdUXKTshZP_6DU3CFjTcHnfhWOFrA,22
|
|
131
|
+
cubevis-1.0.38.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
|
|
132
|
+
cubevis-1.0.38.dist-info/METADATA,sha256=Ug9X2LLzH_zLtIUKbzy2O5Omq5uHNSXxnkbVoEsXlFc,2632
|
|
133
|
+
cubevis-1.0.38.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
|
|
134
|
+
cubevis-1.0.38.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|