ttnn-visualizer 0.33.2__py3-none-any.whl → 0.34.0__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.
- ttnn_visualizer/file_uploads.py +11 -7
- ttnn_visualizer/requirements.txt +1 -0
- ttnn_visualizer/sessions.py +1 -1
- ttnn_visualizer/settings.py +2 -4
- ttnn_visualizer/static/assets/{allPaths-C1NlZ4tc.js → allPaths-D0uOIsnD.js} +1 -1
- ttnn_visualizer/static/assets/{allPathsLoader-B5Ah5bqG.js → allPathsLoader-B1iveKGB.js} +2 -2
- ttnn_visualizer/static/assets/{index-C2xbrqJV.js → index-CHS7htir.js} +209 -209
- ttnn_visualizer/static/assets/{index-Dhl0up3F.css → index-CJJgzCye.css} +2 -2
- ttnn_visualizer/static/assets/{splitPathsBySizeLoader-BHVWfA4U.js → splitPathsBySizeLoader-C1_1pXJQ.js} +1 -1
- ttnn_visualizer/static/index.html +2 -2
- ttnn_visualizer/views.py +40 -41
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/METADATA +2 -1
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/RECORD +18 -18
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/LICENSE +0 -0
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/LICENSE_understanding.txt +0 -0
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/WHEEL +0 -0
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/entry_points.txt +0 -0
- {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.34.0.dist-info}/top_level.txt +0 -0
ttnn_visualizer/file_uploads.py
CHANGED
@@ -4,11 +4,12 @@
|
|
4
4
|
|
5
5
|
from pathlib import Path
|
6
6
|
import logging
|
7
|
+
import re
|
7
8
|
|
8
9
|
logger = logging.getLogger(__name__)
|
9
10
|
|
10
11
|
|
11
|
-
def validate_files(files, required_files, pattern=None):
|
12
|
+
def validate_files(files, required_files, pattern=None, folder_name=None):
|
12
13
|
"""Validate uploaded files against required file names and an optional pattern."""
|
13
14
|
found_files = set()
|
14
15
|
|
@@ -19,7 +20,7 @@ def validate_files(files, required_files, pattern=None):
|
|
19
20
|
pattern and file_path.name.startswith(pattern)
|
20
21
|
):
|
21
22
|
found_files.add(file_path.name)
|
22
|
-
if len(file_path.parents) != 2:
|
23
|
+
if not folder_name and len(file_path.parents) != 2:
|
23
24
|
logger.warning(
|
24
25
|
f"File {file.filename} is not under a single parent folder."
|
25
26
|
)
|
@@ -43,25 +44,25 @@ def extract_profiler_name(files):
|
|
43
44
|
unsplit_profiler_name = str(files[0].filename)
|
44
45
|
return unsplit_profiler_name.split("/")[0]
|
45
46
|
|
47
|
+
|
46
48
|
def extract_npe_name(files):
|
47
49
|
if not files:
|
48
50
|
return None
|
49
51
|
|
50
|
-
|
51
|
-
return file_path.stem
|
52
|
+
return re.sub(r"\.(json|npeviz\.zst)$", "", files[0].filename)
|
52
53
|
|
53
54
|
|
54
55
|
def save_uploaded_files(
|
55
56
|
files,
|
56
57
|
target_directory,
|
57
|
-
|
58
|
+
folder_name=None,
|
58
59
|
):
|
59
60
|
"""
|
60
61
|
Save uploaded files to the target directory.
|
61
62
|
|
62
63
|
:param files: List of files to be saved.
|
63
64
|
:param target_directory: The base directory for saving the files.
|
64
|
-
:param
|
65
|
+
:param folder_name: The name to use for the directory.
|
65
66
|
"""
|
66
67
|
for file in files:
|
67
68
|
current_file_name = str(file.filename)
|
@@ -69,7 +70,10 @@ def save_uploaded_files(
|
|
69
70
|
|
70
71
|
file_path = Path(current_file_name)
|
71
72
|
|
72
|
-
|
73
|
+
if folder_name:
|
74
|
+
destination_file = Path(target_directory) / folder_name / str(file_path)
|
75
|
+
else:
|
76
|
+
destination_file = Path(target_directory) / str(file_path)
|
73
77
|
|
74
78
|
logger.info(f"Writing file to {destination_file}")
|
75
79
|
|
ttnn_visualizer/requirements.txt
CHANGED
ttnn_visualizer/sessions.py
CHANGED
@@ -276,7 +276,7 @@ def init_sessions(app):
|
|
276
276
|
|
277
277
|
|
278
278
|
def create_random_instance_id():
|
279
|
-
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=
|
279
|
+
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=10))
|
280
280
|
|
281
281
|
|
282
282
|
def create_instance_from_local_paths(profiler_path, performance_path):
|
ttnn_visualizer/settings.py
CHANGED
@@ -16,18 +16,16 @@ class DefaultConfig(object):
|
|
16
16
|
DEBUG = bool(str_to_bool(os.getenv("FLASK_DEBUG", "false")))
|
17
17
|
TESTING = False
|
18
18
|
PRINT_ENV = True
|
19
|
-
SERVER_MODE = str_to_bool(os.getenv("SERVER_MODE", "false"))
|
20
19
|
|
21
20
|
# Path Settings
|
22
21
|
DB_VERSION = "0.29.0" # App version when DB schema last changed
|
23
|
-
REPORT_DATA_DIRECTORY =
|
22
|
+
REPORT_DATA_DIRECTORY = Path(__file__).parent.absolute().joinpath("data")
|
24
23
|
LOCAL_DATA_DIRECTORY = Path(REPORT_DATA_DIRECTORY).joinpath("local")
|
25
24
|
REMOTE_DATA_DIRECTORY = Path(REPORT_DATA_DIRECTORY).joinpath("remote")
|
26
25
|
PROFILER_DIRECTORY_NAME = "profiler-reports"
|
27
26
|
PERFORMANCE_DIRECTORY_NAME = "performance-reports"
|
28
27
|
NPE_DIRECTORY_NAME = "npe-reports"
|
29
28
|
APPLICATION_DIR = os.path.abspath(os.path.join(__file__, "..", os.pardir))
|
30
|
-
APP_DATA_DIRECTORY = os.path.join("APP_DATA_DIRECTORY", APPLICATION_DIR)
|
31
29
|
STATIC_ASSETS_DIR = Path(APPLICATION_DIR).joinpath("ttnn_visualizer", "static")
|
32
30
|
SEND_FILE_MAX_AGE_DEFAULT = 0
|
33
31
|
|
@@ -42,7 +40,7 @@ class DefaultConfig(object):
|
|
42
40
|
|
43
41
|
# SQL Alchemy Settings
|
44
42
|
SQLALCHEMY_DATABASE_URI = (
|
45
|
-
f"sqlite:///{os.path.join(
|
43
|
+
f"sqlite:///{os.path.join(APPLICATION_DIR, f'ttnn_{DB_VERSION}.db')}"
|
46
44
|
)
|
47
45
|
SQLALCHEMY_ENGINE_OPTIONS = {
|
48
46
|
"pool_size": 10, # Adjust pool size as needed (default is 5)
|
@@ -1 +1 @@
|
|
1
|
-
import{I as n}from"./index-BVMreIQm.js";import{I as e}from"./index-Do7YB6C4.js";import{p as r,I as s}from"./index-
|
1
|
+
import{I as n}from"./index-BVMreIQm.js";import{I as e}from"./index-Do7YB6C4.js";import{p as r,I as s}from"./index-CHS7htir.js";function I(o,t){var a=r(o);return t===s.STANDARD?n[a]:e[a]}function p(o){return r(o)}export{n as IconSvgPaths16,e as IconSvgPaths20,I as getIconPaths,p as iconNameToPathsRecordKey};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/allPaths-
|
2
|
-
import{_ as o,a as n,b as i}from"./index-
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/allPaths-D0uOIsnD.js","assets/index-BVMreIQm.js","assets/index-Do7YB6C4.js","assets/index-CHS7htir.js","assets/index-CJJgzCye.css"])))=>i.map(i=>d[i]);
|
2
|
+
import{_ as o,a as n,b as i}from"./index-CHS7htir.js";var _=function(e,a){return o(void 0,void 0,void 0,function(){var t;return n(this,function(r){switch(r.label){case 0:return[4,i(()=>import("./allPaths-D0uOIsnD.js"),__vite__mapDeps([0,1,2,3,4]))];case 1:return t=r.sent().getIconPaths,[2,t(e,a)]}})})};export{_ as allPathsLoader};
|