ttnn-visualizer 0.29.0__py3-none-any.whl → 0.30.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/app.py +4 -4
- ttnn_visualizer/csv_queries.py +20 -5
- ttnn_visualizer/decorators.py +0 -7
- ttnn_visualizer/file_uploads.py +5 -7
- ttnn_visualizer/models.py +32 -32
- ttnn_visualizer/queries.py +6 -6
- ttnn_visualizer/sessions.py +78 -69
- ttnn_visualizer/settings.py +4 -1
- ttnn_visualizer/sftp_operations.py +24 -25
- ttnn_visualizer/static/assets/{allPaths-CJHbl9k5.js → allPaths-BFtaymsj.js} +1 -1
- ttnn_visualizer/static/assets/{allPathsLoader-BMROdgRm.js → allPathsLoader-krdfUMe8.js} +2 -2
- ttnn_visualizer/static/assets/{index-CINMcROY.css → index-Bq0nVwFb.css} +2 -2
- ttnn_visualizer/static/assets/{index-DRqEueCH.js → index-BsP_KNDi.js} +246 -246
- ttnn_visualizer/static/assets/{splitPathsBySizeLoader-Bff1kHt3.js → splitPathsBySizeLoader-Exj9Tfv3.js} +1 -1
- ttnn_visualizer/static/index.html +2 -2
- ttnn_visualizer/tests/test_queries.py +4 -4
- ttnn_visualizer/utils.py +17 -29
- ttnn_visualizer/views.py +251 -90
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/METADATA +4 -4
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/RECORD +25 -25
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/LICENSE +0 -0
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/LICENSE_understanding.txt +0 -0
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/WHEEL +0 -0
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/entry_points.txt +0 -0
- {ttnn_visualizer-0.29.0.dist-info → ttnn_visualizer-0.30.0.dist-info}/top_level.txt +0 -0
@@ -31,7 +31,6 @@ logger = logging.getLogger(__name__)
|
|
31
31
|
|
32
32
|
TEST_CONFIG_FILE = "config.json"
|
33
33
|
TEST_PROFILER_FILE = "profile_log_device.csv"
|
34
|
-
PROFILER_DIRECTORY = "profiler"
|
35
34
|
REPORT_DATA_DIRECTORY = Path(__file__).parent.absolute().joinpath("data")
|
36
35
|
|
37
36
|
|
@@ -175,7 +174,7 @@ def is_excluded(file_path, exclude_patterns):
|
|
175
174
|
|
176
175
|
@remote_exception_handler
|
177
176
|
def sync_files_and_directories(
|
178
|
-
client,
|
177
|
+
client, remote_profiler_folder: str, destination_dir: Path, exclude_patterns=None, sid=None
|
179
178
|
):
|
180
179
|
"""Download files and directories sequentially in one unified loop."""
|
181
180
|
exclude_patterns = (
|
@@ -236,7 +235,7 @@ def sync_files_and_directories(
|
|
236
235
|
download_directory_contents(remote_subdir, local_subdir)
|
237
236
|
|
238
237
|
# Start downloading from the root folder
|
239
|
-
download_directory_contents(
|
238
|
+
download_directory_contents(remote_profiler_folder, destination_dir)
|
240
239
|
|
241
240
|
# Create a .last-synced file in directory
|
242
241
|
update_last_synced(destination_dir)
|
@@ -280,7 +279,7 @@ def download_file_with_progress(
|
|
280
279
|
raise
|
281
280
|
|
282
281
|
|
283
|
-
def
|
282
|
+
def get_remote_profiler_folder_from_config_path(
|
284
283
|
sftp: SFTPClient, config_path: str
|
285
284
|
) -> RemoteReportFolder:
|
286
285
|
"""Read a remote config file and return RemoteFolder object."""
|
@@ -289,26 +288,26 @@ def get_remote_report_folder_from_config_path(
|
|
289
288
|
data = json.loads(config_file.read())
|
290
289
|
return RemoteReportFolder(
|
291
290
|
remotePath=str(Path(config_path).parent),
|
292
|
-
testName=data["report_name"],
|
291
|
+
testName=data["report_name"], # Config file includes "report_name"
|
293
292
|
lastModified=(
|
294
293
|
int(attributes.st_mtime) if attributes.st_mtime else int(time.time())
|
295
294
|
),
|
296
295
|
)
|
297
296
|
|
298
297
|
|
299
|
-
def
|
298
|
+
def get_remote_performance_folder(
|
300
299
|
sftp: SFTPClient, profile_folder: str
|
301
300
|
) -> RemoteReportFolder:
|
302
301
|
"""Read a remote config file and return RemoteFolder object."""
|
303
302
|
attributes = sftp.stat(str(profile_folder))
|
304
|
-
|
303
|
+
performance_name = profile_folder.split("/")[-1]
|
305
304
|
remote_path = profile_folder
|
306
305
|
last_modified = (
|
307
306
|
int(attributes.st_mtime) if attributes.st_mtime else int(time.time())
|
308
307
|
)
|
309
308
|
return RemoteReportFolder(
|
310
309
|
remotePath=str(remote_path),
|
311
|
-
testName=str(
|
310
|
+
testName=str(performance_name),
|
312
311
|
lastModified=last_modified,
|
313
312
|
)
|
314
313
|
|
@@ -324,7 +323,7 @@ def read_remote_file(
|
|
324
323
|
if remote_path:
|
325
324
|
path = Path(remote_path)
|
326
325
|
else:
|
327
|
-
path = Path(remote_connection.
|
326
|
+
path = Path(remote_connection.profilerPath)
|
328
327
|
|
329
328
|
logger.info(f"Opening remote file {path}")
|
330
329
|
directory_path = str(path.parent)
|
@@ -348,7 +347,7 @@ def check_remote_path_for_reports(remote_connection):
|
|
348
347
|
"""Check the remote path for config files."""
|
349
348
|
ssh_client = get_client(remote_connection)
|
350
349
|
remote_config_paths = find_folders_by_files(
|
351
|
-
ssh_client, remote_connection.
|
350
|
+
ssh_client, remote_connection.profilerPath, [TEST_CONFIG_FILE]
|
352
351
|
)
|
353
352
|
if not remote_config_paths:
|
354
353
|
raise NoProjectsException(
|
@@ -369,7 +368,7 @@ def check_remote_path_exists(remote_connection: RemoteConnection, path_key: str)
|
|
369
368
|
if path_key == "performancePath":
|
370
369
|
message = "Performance directory does not exist or cannot be accessed"
|
371
370
|
else:
|
372
|
-
message = "
|
371
|
+
message = "Profiler directory does not exist or cannot be accessed"
|
373
372
|
|
374
373
|
logger.error(message)
|
375
374
|
raise RemoteConnectionException(
|
@@ -398,42 +397,42 @@ def find_folders_by_files(
|
|
398
397
|
|
399
398
|
|
400
399
|
@remote_exception_handler
|
401
|
-
def
|
400
|
+
def get_remote_performance_folders(
|
402
401
|
remote_connection: RemoteConnection,
|
403
402
|
) -> List[RemoteReportFolder]:
|
404
403
|
"""Return a list of remote folders containing a profile_log_device file."""
|
405
404
|
client = get_client(remote_connection)
|
406
|
-
|
405
|
+
performance_paths = find_folders_by_files(
|
407
406
|
client, remote_connection.performancePath, [TEST_PROFILER_FILE]
|
408
407
|
)
|
409
|
-
if not
|
408
|
+
if not performance_paths:
|
410
409
|
error = f"No profiler paths found at {remote_connection.performancePath}"
|
411
410
|
logger.info(error)
|
412
411
|
raise NoProjectsException(status=ConnectionTestStates.FAILED, message=error)
|
413
412
|
remote_folder_data = []
|
414
413
|
with client.open_sftp() as sftp:
|
415
|
-
for path in
|
416
|
-
remote_folder_data.append(
|
414
|
+
for path in performance_paths:
|
415
|
+
remote_folder_data.append(get_remote_performance_folder(sftp, path))
|
417
416
|
return remote_folder_data
|
418
417
|
|
419
418
|
|
420
419
|
@remote_exception_handler
|
421
|
-
def
|
420
|
+
def get_remote_profiler_folders(
|
422
421
|
remote_connection: RemoteConnection,
|
423
422
|
) -> List[RemoteReportFolder]:
|
424
423
|
"""Return a list of remote folders containing a config.json file."""
|
425
424
|
client = get_client(remote_connection)
|
426
425
|
remote_config_paths = find_folders_by_files(
|
427
|
-
client, remote_connection.
|
426
|
+
client, remote_connection.profilerPath, [TEST_CONFIG_FILE]
|
428
427
|
)
|
429
428
|
if not remote_config_paths:
|
430
|
-
error = f"No projects found at {remote_connection.
|
429
|
+
error = f"No projects found at {remote_connection.profilerPath}"
|
431
430
|
logger.info(error)
|
432
431
|
raise NoProjectsException(status=ConnectionTestStates.FAILED, message=error)
|
433
432
|
remote_folder_data = []
|
434
433
|
with client.open_sftp() as sftp:
|
435
434
|
for config_path in remote_config_paths:
|
436
|
-
remote_folder =
|
435
|
+
remote_folder = get_remote_profiler_folder_from_config_path(
|
437
436
|
sftp, str(Path(config_path).joinpath(TEST_CONFIG_FILE))
|
438
437
|
)
|
439
438
|
remote_folder_data.append(remote_folder)
|
@@ -441,7 +440,7 @@ def get_remote_report_folders(
|
|
441
440
|
|
442
441
|
|
443
442
|
@remote_exception_handler
|
444
|
-
def
|
443
|
+
def sync_remote_profiler_folders(
|
445
444
|
remote_connection: RemoteConnection,
|
446
445
|
remote_folder_path: str,
|
447
446
|
path_prefix: str,
|
@@ -450,9 +449,9 @@ def sync_remote_folders(
|
|
450
449
|
):
|
451
450
|
"""Main function to sync test folders, handles both compressed and individual syncs."""
|
452
451
|
client = get_client(remote_connection)
|
453
|
-
|
452
|
+
profiler_folder = Path(remote_folder_path).name
|
454
453
|
destination_dir = Path(
|
455
|
-
REPORT_DATA_DIRECTORY, path_prefix, remote_connection.host,
|
454
|
+
REPORT_DATA_DIRECTORY, path_prefix, remote_connection.host, current_app.config["PROFILER_DIRECTORY_NAME"], profiler_folder
|
456
455
|
)
|
457
456
|
destination_dir.mkdir(parents=True, exist_ok=True)
|
458
457
|
|
@@ -462,7 +461,7 @@ def sync_remote_folders(
|
|
462
461
|
|
463
462
|
|
464
463
|
@remote_exception_handler
|
465
|
-
def
|
464
|
+
def sync_remote_performance_folders(
|
466
465
|
remote_connection: RemoteConnection,
|
467
466
|
path_prefix: str,
|
468
467
|
profile: RemoteReportFolder,
|
@@ -476,7 +475,7 @@ def sync_remote_profiler_folders(
|
|
476
475
|
REPORT_DATA_DIRECTORY,
|
477
476
|
path_prefix,
|
478
477
|
remote_connection.host,
|
479
|
-
|
478
|
+
current_app.config["PERFORMANCE_DIRECTORY_NAME"],
|
480
479
|
profile_folder,
|
481
480
|
)
|
482
481
|
destination_dir.mkdir(parents=True, exist_ok=True)
|
@@ -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-BsP_KNDi.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-BFtaymsj.js","assets/index-BVMreIQm.js","assets/index-Do7YB6C4.js","assets/index-BsP_KNDi.js","assets/index-Bq0nVwFb.css"])))=>i.map(i=>d[i]);
|
2
|
+
import{_ as o,a as n,b as i}from"./index-BsP_KNDi.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-BFtaymsj.js"),__vite__mapDeps([0,1,2,3,4]))];case 1:return t=r.sent().getIconPaths,[2,t(e,a)]}})})};export{_ as allPathsLoader};
|