Skip to content

Instantly share code, notes, and snippets.

View Kentakoong's full-sized avatar
🗣️
la lalalala lalalalalala

Wongkraiwich Chuenchomphu Kentakoong

🗣️
la lalalala lalalalalala
View GitHub Profile
@Kentakoong
Kentakoong / scaling-list.py
Created September 25, 2024 09:25
mtnlog - Map State JSON or node out runtime / errors from running to CSV
import json
import os
import pandas as pd
def parse_directory_structure(path):
"""Parse the directory structure and retrieve the train_runtime"""
data = []
unique_jobs = set() # To track already processed jobs
@Kentakoong
Kentakoong / map-max-memory.py
Last active September 30, 2024 02:52
mtnlog - Map Max Memory from PerformanceLogger
import os
import re
import csv
import logging
from multiprocessing import Pool
from tqdm import tqdm
import pandas as pd
# Set up logging
def setup_logging(log_level=logging.INFO):
@Kentakoong
Kentakoong / map-missing.py
Last active September 30, 2024 02:52
mtnlog - Map Missing Graphs from failed runs
"""
This script lists and plots metrics for each CSV file found in the 'metric' directories under the specified base directory.
It supports parallel processing of multiple folders and provides options to regenerate missing or incomplete graphs.
Usage:
python map-missing.py
Author:
Unknown
@Kentakoong
Kentakoong / JSONManager.swift
Last active March 13, 2024 03:18
Encode + Decode JSON Data with Dynamic Types
import Foundation
class JSONManager {
struct DecodeReturn<T: Decodable> {
var value: T
var error: (any Error)?
}
static func encodeJSON<T: Encodable>(_ data: T) throws -> Data? {