ttnn-visualizer 0.33.2__py3-none-any.whl → 0.35.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.
Files changed (22) hide show
  1. ttnn_visualizer/file_uploads.py +11 -7
  2. ttnn_visualizer/requirements.txt +1 -0
  3. ttnn_visualizer/sessions.py +1 -1
  4. ttnn_visualizer/settings.py +2 -4
  5. ttnn_visualizer/static/assets/{allPaths-C1NlZ4tc.js → allPaths-DMKN6R3O.js} +1 -1
  6. ttnn_visualizer/static/assets/{allPathsLoader-B5Ah5bqG.js → allPathsLoader-Cdkhl3-B.js} +2 -2
  7. ttnn_visualizer/static/assets/{index-Dhl0up3F.css → index-BJh9qYdM.css} +2 -2
  8. ttnn_visualizer/static/assets/index-BKzgFDAn.js +1 -0
  9. ttnn_visualizer/static/assets/index-BvSuWPlB.js +1 -0
  10. ttnn_visualizer/static/assets/{index-C2xbrqJV.js → index-WJTj4dxk.js} +220 -220
  11. ttnn_visualizer/static/assets/{splitPathsBySizeLoader-BHVWfA4U.js → splitPathsBySizeLoader-B15vqwb9.js} +1 -1
  12. ttnn_visualizer/static/index.html +2 -2
  13. ttnn_visualizer/views.py +40 -41
  14. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/METADATA +2 -1
  15. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/RECORD +20 -20
  16. ttnn_visualizer/static/assets/index-BVMreIQm.js +0 -1
  17. ttnn_visualizer/static/assets/index-Do7YB6C4.js +0 -1
  18. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/LICENSE +0 -0
  19. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/LICENSE_understanding.txt +0 -0
  20. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/WHEEL +0 -0
  21. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/entry_points.txt +0 -0
  22. {ttnn_visualizer-0.33.2.dist-info → ttnn_visualizer-0.35.0.dist-info}/top_level.txt +0 -0
@@ -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
- file_path = Path(files[0].filename)
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
- profiler_name=None,
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 profiler_name: The report name to use for the directory.
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
- destination_file = Path(target_directory).joinpath(str(file_path))
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
 
@@ -18,6 +18,7 @@ build
18
18
  PyYAML==6.0.2
19
19
  python-dotenv==1.0.1
20
20
  tt-perf-report==1.0.6
21
+ zstd==1.5.7.0
21
22
 
22
23
  # Dev dependencies
23
24
  mypy
@@ -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=45))
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):
@@ -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 = os.getenv("REPORT_DATA_DIRECTORY", Path(__file__).parent.absolute().joinpath("data"))
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(APP_DATA_DIRECTORY, f'ttnn_{DB_VERSION}.db')}"
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-C2xbrqJV.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
+ import{I as n}from"./index-BKzgFDAn.js";import{I as e}from"./index-BvSuWPlB.js";import{p as r,I as s}from"./index-WJTj4dxk.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-C1NlZ4tc.js","assets/index-BVMreIQm.js","assets/index-Do7YB6C4.js","assets/index-C2xbrqJV.js","assets/index-Dhl0up3F.css"])))=>i.map(i=>d[i]);
2
- import{_ as o,a as n,b as i}from"./index-C2xbrqJV.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-C1NlZ4tc.js"),__vite__mapDeps([0,1,2,3,4]))];case 1:return t=r.sent().getIconPaths,[2,t(e,a)]}})})};export{_ as allPathsLoader};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/allPaths-DMKN6R3O.js","assets/index-BKzgFDAn.js","assets/index-BvSuWPlB.js","assets/index-WJTj4dxk.js","assets/index-BJh9qYdM.css"])))=>i.map(i=>d[i]);
2
+ import{_ as o,a as n,b as i}from"./index-WJTj4dxk.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-DMKN6R3O.js"),__vite__mapDeps([0,1,2,3,4]))];case 1:return t=r.sent().getIconPaths,[2,t(e,a)]}})})};export{_ as allPathsLoader};