ttnn-visualizer 0.38.2__py3-none-any.whl → 0.39.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 (37) hide show
  1. ttnn_visualizer/__init__.py +1 -1
  2. ttnn_visualizer/app.py +19 -5
  3. ttnn_visualizer/csv_queries.py +1 -1
  4. ttnn_visualizer/decorators.py +16 -2
  5. ttnn_visualizer/enums.py +1 -1
  6. ttnn_visualizer/exceptions.py +1 -1
  7. ttnn_visualizer/extensions.py +1 -1
  8. ttnn_visualizer/file_uploads.py +1 -1
  9. ttnn_visualizer/instances.py +1 -1
  10. ttnn_visualizer/models.py +1 -1
  11. ttnn_visualizer/queries.py +1 -1
  12. ttnn_visualizer/remote_sqlite_setup.py +1 -1
  13. ttnn_visualizer/serializers.py +1 -1
  14. ttnn_visualizer/settings.py +2 -2
  15. ttnn_visualizer/sftp_operations.py +1 -1
  16. ttnn_visualizer/sockets.py +1 -1
  17. ttnn_visualizer/ssh_client.py +1 -1
  18. ttnn_visualizer/static/assets/{allPaths-Bl5zsQD8.js → allPaths-BYcRoLEw.js} +1 -1
  19. ttnn_visualizer/static/assets/{allPathsLoader-62UMr_jj.js → allPathsLoader-CNKgAYcC.js} +2 -2
  20. ttnn_visualizer/static/assets/{index-BJweZJCB.css → index-B9wn2kZo.css} +2 -2
  21. ttnn_visualizer/static/assets/{index-DCEh1A_0.js → index-Ba6DlrXF.js} +233 -233
  22. ttnn_visualizer/static/assets/{splitPathsBySizeLoader-bCoYiAtQ.js → splitPathsBySizeLoader-2S0DVWGR.js} +1 -1
  23. ttnn_visualizer/static/index.html +12 -4
  24. ttnn_visualizer/tests/__init__.py +1 -1
  25. ttnn_visualizer/tests/test_queries.py +1 -1
  26. ttnn_visualizer/tests/test_serializers.py +1 -1
  27. ttnn_visualizer/utils.py +1 -1
  28. ttnn_visualizer/views.py +9 -15
  29. ttnn_visualizer-0.39.0.dist-info/LICENSE +128 -0
  30. {ttnn_visualizer-0.38.2.dist-info → ttnn_visualizer-0.39.0.dist-info}/METADATA +1 -1
  31. ttnn_visualizer-0.39.0.dist-info/RECORD +46 -0
  32. ttnn_visualizer-0.38.2.dist-info/LICENSE +0 -256
  33. ttnn_visualizer-0.38.2.dist-info/RECORD +0 -46
  34. {ttnn_visualizer-0.38.2.dist-info → ttnn_visualizer-0.39.0.dist-info}/LICENSE_understanding.txt +0 -0
  35. {ttnn_visualizer-0.38.2.dist-info → ttnn_visualizer-0.39.0.dist-info}/WHEEL +0 -0
  36. {ttnn_visualizer-0.38.2.dist-info → ttnn_visualizer-0.39.0.dist-info}/entry_points.txt +0 -0
  37. {ttnn_visualizer-0.38.2.dist-info → ttnn_visualizer-0.39.0.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
ttnn_visualizer/app.py CHANGED
@@ -1,8 +1,9 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import argparse
6
+ import json
6
7
  import logging
7
8
  import os
8
9
  import subprocess
@@ -55,16 +56,29 @@ def create_app(settings_override=None):
55
56
 
56
57
  middleware(app)
57
58
 
58
- app.register_blueprint(api)
59
+ app.register_blueprint(api, url_prefix=f"{app.config['BASE_PATH']}/api")
59
60
 
60
61
  extensions(app)
61
62
 
62
63
  if flask_env == "production":
63
-
64
- @app.route("/", defaults={"path": ""})
64
+ @app.route(f"{app.config['BASE_PATH']}/", defaults={"path": ""})
65
65
  @app.route("/<path:path>")
66
66
  def catch_all(path):
67
- return app.send_static_file("index.html")
67
+ js_config = {
68
+ "SERVER_MODE": app.config["SERVER_MODE"],
69
+ "BASE_PATH": app.config["BASE_PATH"],
70
+ }
71
+ js = f"window.TTNN_VISUALIZER_CONFIG = {json.dumps(js_config)};"
72
+
73
+ with open(os.path.join(app.static_folder, "index.html")) as f:
74
+ html = f.read()
75
+
76
+ html_with_config = html.replace(
77
+ "/* SERVER_CONFIG */",
78
+ js,
79
+ )
80
+
81
+ return flask.Response(html_with_config, mimetype="text/html")
68
82
 
69
83
  return app
70
84
 
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent Inc.
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent Inc.
4
4
  import csv
5
5
  import os
6
6
  import tempfile
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import re
6
6
  from ttnn_visualizer.enums import ConnectionTestStates
@@ -42,7 +42,8 @@ def with_instance(func):
42
42
  session['instances'] = []
43
43
 
44
44
  if instance.instance_id not in session['instances']:
45
- session['instances'].append(instance.instance_id)
45
+ session['instances'] = session.get('instances', []) + [instance.instance_id]
46
+
46
47
 
47
48
  return func(*args, **kwargs)
48
49
 
@@ -115,3 +116,16 @@ def remote_exception_handler(func):
115
116
  )
116
117
 
117
118
  return remote_handler
119
+
120
+
121
+ def local_only(f):
122
+ from flask import current_app
123
+
124
+ @wraps(f)
125
+ def decorated_function(*args, **kwargs):
126
+ if current_app.config["SERVER_MODE"]:
127
+ abort(403, description="Endpoint not accessible")
128
+
129
+ return f(*args, **kwargs)
130
+
131
+ return decorated_function
ttnn_visualizer/enums.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import enum
6
6
 
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  from http import HTTPStatus
6
6
 
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  from flask_socketio import SocketIO
6
6
  from flask_static_digest import FlaskStaticDigest
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent Inc.
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent Inc.
4
4
 
5
5
  import logging
6
6
  import os
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import json
6
6
  import random
ttnn_visualizer/models.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import dataclasses
6
6
  import enum
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import json
6
6
  from typing import Generator, Dict, Any, Union
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import re
6
6
 
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import dataclasses
6
6
  from collections import defaultdict
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import os
6
6
  from pathlib import Path
@@ -22,7 +22,7 @@ class DefaultConfig(object):
22
22
  o for o in os.getenv("ALLOWED_ORIGINS", "http://localhost:5173,http://localhost:8000").split(",")
23
23
  if o
24
24
  ]
25
- API_PATH = os.getenv("API_PATH", "/")
25
+ BASE_PATH = os.getenv("BASE_PATH", "/")
26
26
 
27
27
  # Path Settings
28
28
  DB_VERSION = "0.29.0" # App version when DB schema last changed
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import json
6
6
  import logging
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import threading
6
6
  import time
@@ -1,6 +1,6 @@
1
1
  # SPDX-License-Identifier: Apache-2.0
2
2
  #
3
- # SPDX-FileCopyrightText: © 2024 Tenstorrent AI ULC
3
+ # SPDX-FileCopyrightText: © 2025 Tenstorrent AI ULC
4
4
 
5
5
  import paramiko
6
6
  import os
@@ -1 +1 @@
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-DCEh1A_0.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-Ba6DlrXF.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-Bl5zsQD8.js","assets/index-BKzgFDAn.js","assets/index-BvSuWPlB.js","assets/index-DCEh1A_0.js","assets/index-BJweZJCB.css"])))=>i.map(i=>d[i]);
2
- import{_ as o,a as n,b as i}from"./index-DCEh1A_0.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-Bl5zsQD8.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-BYcRoLEw.js","assets/index-BKzgFDAn.js","assets/index-BvSuWPlB.js","assets/index-Ba6DlrXF.js","assets/index-B9wn2kZo.css"])))=>i.map(i=>d[i]);
2
+ import{_ as o,a as n,b as i}from"./index-Ba6DlrXF.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-BYcRoLEw.js"),__vite__mapDeps([0,1,2,3,4]))];case 1:return t=r.sent().getIconPaths,[2,t(e,a)]}})})};export{_ as allPathsLoader};