figpack 0.1.4__py3-none-any.whl → 0.1.5__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.
Potentially problematic release.
This version of figpack might be problematic. Click here for more details.
- figpack/__init__.py +1 -5
- figpack/cli.py +8 -7
- figpack/core/_bundle_utils.py +2 -0
- figpack/core/_show_view.py +4 -8
- figpack/core/_upload_bundle.py +13 -11
- figpack/core/figpack_view.py +1 -0
- figpack/figpack-gui-dist/assets/{index-Dw14QqeQ.js → index-DeyVLaXh.js} +91 -91
- figpack/figpack-gui-dist/index.html +1 -1
- figpack/spike_sorting/views/AutocorrelogramItem.py +1 -0
- figpack/spike_sorting/views/Autocorrelograms.py +39 -9
- figpack/spike_sorting/views/CrossCorrelogramItem.py +1 -0
- figpack/spike_sorting/views/CrossCorrelograms.py +45 -7
- figpack/spike_sorting/views/UnitsTable.py +5 -3
- figpack/spike_sorting/views/UnitsTableRow.py +1 -1
- figpack/spike_sorting/views/__init__.py +2 -2
- figpack/views/Box.py +3 -1
- figpack/views/Image.py +4 -2
- figpack/views/LayoutItem.py +1 -0
- figpack/views/Markdown.py +1 -0
- figpack/views/MatplotlibFigure.py +4 -2
- figpack/views/MultiChannelTimeseries.py +226 -0
- figpack/views/PlotlyFigure.py +5 -3
- figpack/views/Splitter.py +3 -1
- figpack/views/TabLayout.py +3 -1
- figpack/views/TabLayoutItem.py +1 -0
- figpack/views/TimeseriesGraph.py +3 -2
- figpack/views/__init__.py +7 -6
- {figpack-0.1.4.dist-info → figpack-0.1.5.dist-info}/METADATA +48 -7
- figpack-0.1.5.dist-info/RECORD +39 -0
- figpack-0.1.4.dist-info/RECORD +0 -38
- {figpack-0.1.4.dist-info → figpack-0.1.5.dist-info}/WHEEL +0 -0
- {figpack-0.1.4.dist-info → figpack-0.1.5.dist-info}/entry_points.txt +0 -0
- {figpack-0.1.4.dist-info → figpack-0.1.5.dist-info}/licenses/LICENSE +0 -0
- {figpack-0.1.4.dist-info → figpack-0.1.5.dist-info}/top_level.txt +0 -0
figpack/__init__.py
CHANGED
figpack/cli.py
CHANGED
|
@@ -3,19 +3,20 @@ Command-line interface for figpack
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
import argparse
|
|
6
|
-
import
|
|
6
|
+
import json
|
|
7
7
|
import pathlib
|
|
8
|
-
import
|
|
8
|
+
import socket
|
|
9
|
+
import sys
|
|
9
10
|
import tarfile
|
|
10
|
-
import
|
|
11
|
-
import requests
|
|
11
|
+
import tempfile
|
|
12
12
|
import threading
|
|
13
13
|
import webbrowser
|
|
14
|
-
import socket
|
|
15
14
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
16
|
-
from urllib.parse import urlparse, urljoin
|
|
17
|
-
from typing import Dict, List, Tuple, Optional, Union
|
|
18
15
|
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
|
16
|
+
from typing import Dict, List, Optional, Tuple, Union
|
|
17
|
+
from urllib.parse import urljoin, urlparse
|
|
18
|
+
|
|
19
|
+
import requests
|
|
19
20
|
|
|
20
21
|
from . import __version__
|
|
21
22
|
from .core._show_view import serve_files
|
figpack/core/_bundle_utils.py
CHANGED
figpack/core/_show_view.py
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import os
|
|
2
|
-
|
|
3
|
-
from typing import Union
|
|
4
|
-
import tempfile
|
|
5
|
-
|
|
6
|
-
import webbrowser
|
|
7
|
-
|
|
8
2
|
import pathlib
|
|
9
|
-
|
|
3
|
+
import tempfile
|
|
10
4
|
import threading
|
|
5
|
+
import webbrowser
|
|
11
6
|
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
|
7
|
+
from typing import Union
|
|
12
8
|
|
|
13
|
-
from .figpack_view import FigpackView
|
|
14
9
|
from ._bundle_utils import prepare_figure_bundle
|
|
15
10
|
from ._upload_bundle import _upload_bundle
|
|
11
|
+
from .figpack_view import FigpackView
|
|
16
12
|
|
|
17
13
|
thisdir = pathlib.Path(__file__).parent.resolve()
|
|
18
14
|
|
figpack/core/_upload_bundle.py
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import hashlib
|
|
2
2
|
import json
|
|
3
|
-
import uuid
|
|
4
3
|
import pathlib
|
|
5
|
-
import requests
|
|
6
4
|
import threading
|
|
7
|
-
import
|
|
8
|
-
|
|
5
|
+
import time
|
|
6
|
+
import uuid
|
|
9
7
|
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
10
8
|
from datetime import datetime, timedelta, timezone
|
|
11
9
|
|
|
10
|
+
import requests
|
|
11
|
+
|
|
12
|
+
from .. import __version__
|
|
13
|
+
|
|
12
14
|
thisdir = pathlib.Path(__file__).parent.resolve()
|
|
13
15
|
|
|
14
16
|
FIGPACK_API_BASE_URL = "https://figpack-api.vercel.app"
|
|
15
|
-
|
|
17
|
+
FIGPACK_FIGURES_BASE_URL = "https://figures.figpack.org/figures/default"
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
def _upload_single_file(
|
|
@@ -78,7 +80,7 @@ def _check_existing_figure(figure_id: str) -> dict:
|
|
|
78
80
|
Returns:
|
|
79
81
|
dict: Contains 'exists' (bool) and 'status' (str) if exists
|
|
80
82
|
"""
|
|
81
|
-
figpack_url = f"{
|
|
83
|
+
figpack_url = f"{FIGPACK_FIGURES_BASE_URL}/{figure_id}/figpack.json"
|
|
82
84
|
|
|
83
85
|
try:
|
|
84
86
|
response = requests.get(figpack_url, timeout=10)
|
|
@@ -148,7 +150,7 @@ def _upload_bundle(tmpdir: str, passcode: str) -> None:
|
|
|
148
150
|
|
|
149
151
|
# If figure_id is None, it means we found a completed upload and should skip
|
|
150
152
|
if figure_id is None:
|
|
151
|
-
figure_url = f"{
|
|
153
|
+
figure_url = f"{FIGPACK_FIGURES_BASE_URL}/{completed_figure_id}/index.html"
|
|
152
154
|
print(f"Figure already exists at: {figure_url}")
|
|
153
155
|
return figure_url
|
|
154
156
|
|
|
@@ -281,7 +283,7 @@ def _upload_bundle(tmpdir: str, passcode: str) -> None:
|
|
|
281
283
|
)
|
|
282
284
|
print("Upload completed successfully")
|
|
283
285
|
|
|
284
|
-
figure_url = f"{
|
|
286
|
+
figure_url = f"{FIGPACK_FIGURES_BASE_URL}/{figure_id}/index.html"
|
|
285
287
|
return figure_url
|
|
286
288
|
|
|
287
289
|
|
|
@@ -352,7 +354,7 @@ def _upload_small_file(
|
|
|
352
354
|
"""
|
|
353
355
|
Upload a small file by sending content directly
|
|
354
356
|
"""
|
|
355
|
-
destination_url = f"{
|
|
357
|
+
destination_url = f"{FIGPACK_FIGURES_BASE_URL}/{figure_id}/{file_path}"
|
|
356
358
|
|
|
357
359
|
try:
|
|
358
360
|
content.encode("utf-8")
|
|
@@ -386,7 +388,7 @@ def _upload_large_file(
|
|
|
386
388
|
"""
|
|
387
389
|
Upload a large file using signed URL
|
|
388
390
|
"""
|
|
389
|
-
destination_url = f"{
|
|
391
|
+
destination_url = f"{FIGPACK_FIGURES_BASE_URL}/{figure_id}/{file_path}"
|
|
390
392
|
file_size = local_file_path.stat().st_size
|
|
391
393
|
|
|
392
394
|
# Get signed URL
|