Skip to content

Commit 30e4ba6

Browse files
committed
fix init order
1 parent 9feb0e8 commit 30e4ba6

File tree

6 files changed

+17
-249
lines changed

6 files changed

+17
-249
lines changed

taskvine_report/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Visualization and analysis tool for TaskVine execution logs.
55
"""
66

7-
__version__ = "3.2.6.7"
7+
__version__ = "3.2.7.0"
88
__author__ = "Collaborative Computing Lab (CCL), University of Notre Dame"
99
__email__ = "[email protected]"
1010

taskvine_report/routes/task_execution_details.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_task_execution_details():
129129
workers = []
130130

131131
# Process task data
132-
task_rows = df[df['task_type'].isin(['successful', 'unsuccessful'])]
132+
task_rows = df[df['record_type'].isin(['successful_tasks', 'unsuccessful_tasks'])]
133133
for _, row in task_rows.iterrows():
134134
if pd.isna(row['task_id']):
135135
continue
@@ -149,7 +149,7 @@ def get_task_execution_details():
149149
'category': str(row['category']) if pd.notna(row['category']) else '',
150150
}
151151

152-
if row['task_type'] == 'successful':
152+
if row['record_type'] == 'successful_tasks':
153153
base_task_data.update({
154154
'when_ready': float(row['when_ready']) if pd.notna(row['when_ready']) else None,
155155
'when_running': float(row['when_running']) if pd.notna(row['when_running']) else None,
@@ -173,7 +173,7 @@ def get_task_execution_details():
173173
unsuccessful_tasks.append(base_task_data)
174174

175175
# Process worker data
176-
worker_rows = df[df['task_type'] == 'worker']
176+
worker_rows = df[df['record_type'] == 'worker']
177177
for _, row in worker_rows.iterrows():
178178
if pd.isna(row['worker_id']):
179179
continue

taskvine_report/src/data_parser.py

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,7 @@ def _create_progress_bar(self):
133133
)
134134

135135
def write_df_to_csv(self, df, csv_file_path, **kwargs):
136-
import os
137-
import math
138-
139-
total_rows = len(df)
140-
if total_rows == 0:
141-
df.to_csv(csv_file_path, **kwargs)
142-
return
143-
144-
num_chunks = min(100, total_rows)
145-
chunk_size = math.ceil(total_rows / num_chunks)
146-
filename = os.path.basename(csv_file_path)
147-
148-
progress = self._create_progress_bar()
149-
task_id = progress.add_task(f"=== Writing {filename}", total=total_rows)
150-
151-
with progress:
152-
with open(csv_file_path, 'w', newline='') as f:
153-
for i in range(num_chunks):
154-
start = i * chunk_size
155-
end = min((i + 1) * chunk_size, total_rows)
156-
chunk = df.iloc[start:end]
157-
header = (i == 0)
158-
chunk.to_csv(f, header=header, **kwargs)
159-
progress.update(task_id, advance=len(chunk))
136+
df.to_csv(csv_file_path, **kwargs)
160137

161138
def get_current_worker_by_ip_port(self, worker_ip: str, worker_port: int):
162139
connect_id = self.current_worker_connect_id[(worker_ip, worker_port)]
@@ -1701,7 +1678,7 @@ def generate_task_execution_details_metrics(self):
17011678
base_time = self.MIN_TIME
17021679
rows = []
17031680

1704-
# Task status mappings
1681+
# Task status mappings
17051682
TASK_STATUS_NAMES = {
17061683
1: 'unsuccessful-input-missing',
17071684
2: 'unsuccessful-output-missing',
@@ -1768,7 +1745,7 @@ def generate_task_execution_details_metrics(self):
17681745
'when_waiting_retrieval': round(task.when_waiting_retrieval - base_time, 2) if task.when_waiting_retrieval else None,
17691746
'when_retrieved': round(task.when_retrieved - base_time, 2) if task.when_retrieved else None,
17701747
'when_done': round(task.when_done - base_time, 2) if task.when_done else None,
1771-
'task_type': 'successful',
1748+
'record_type': 'successful_tasks',
17721749
'unsuccessful_checkbox_name': '',
17731750
'when_failure_happens': None,
17741751
})
@@ -1781,7 +1758,7 @@ def generate_task_execution_details_metrics(self):
17811758
'when_failure_happens': round(task.when_failure_happens - base_time, 2) if task.when_failure_happens else None,
17821759
'execution_time': round(task.when_failure_happens - task.when_running, 2) if task.when_failure_happens and task.when_running else None,
17831760
'when_done': round(task.when_done - base_time, 2) if task.when_done else None,
1784-
'task_type': 'unsuccessful',
1761+
'record_type': 'unsuccessful_tasks',
17851762
'unsuccessful_checkbox_name': TASK_STATUS_NAMES.get(task.task_status, 'unknown'),
17861763
})
17871764

@@ -1819,7 +1796,7 @@ def generate_task_execution_details_metrics(self):
18191796
'when_retrieved': pd.NA,
18201797
'when_failure_happens': pd.NA,
18211798
'when_done': pd.NA,
1822-
'task_type': 'worker',
1799+
'record_type': 'worker',
18231800
'unsuccessful_checkbox_name': pd.NA,
18241801
'hash': worker.hash,
18251802
'time_connected': [round(max(t - base_time, 0), 2) for t in worker.time_connected],
@@ -1838,7 +1815,7 @@ def generate_task_execution_details_metrics(self):
18381815

18391816
# Define column order
18401817
columns = [
1841-
'task_type', 'task_id', 'task_try_id', 'worker_entry', 'worker_id', 'core_id',
1818+
'record_type', 'task_id', 'task_try_id', 'worker_entry', 'worker_id', 'core_id',
18421819
'is_recovery_task', 'input_files', 'output_files', 'num_input_files', 'num_output_files',
18431820
'task_status', 'category', 'when_ready', 'when_running', 'time_worker_start',
18441821
'time_worker_end', 'execution_time', 'when_waiting_retrieval', 'when_retrieved',

taskvine_report/static/js/modules/base.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,14 +536,16 @@ export class BaseModule {
536536

537537
this._setAxesFromFetchedData();
538538

539-
/* legend and toolbox must be set after data is fetched */
540-
this._initToolbox();
539+
/* we are safe to plot axes after data is fetched */
541540
this._plotAxes();
542-
this._setupZoomAndScroll();
543-
this._initResizeHandler();
544-
545541
/* legend must be set after axes are plotted */
546542
this.initLegend();
543+
/* after the axes are plotted, we can setup zoom and scroll */
544+
this._setupZoomAndScroll();
545+
this._initResizeHandler();
546+
547+
/* toolbox must be set after the legend is set b/c it checks if there are checkboxes */
548+
this._initToolbox();
547549
}
548550

549551
plot() {}

test/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/test_api.py

Lines changed: 0 additions & 210 deletions
This file was deleted.

0 commit comments

Comments
 (0)