diff --git a/4-Infrastructure/hardware/test_fpga.py b/4-Infrastructure/hardware/test_fpga.py index cd2a55a2..74324e0f 100644 --- a/4-Infrastructure/hardware/test_fpga.py +++ b/4-Infrastructure/hardware/test_fpga.py @@ -11,6 +11,7 @@ import serial import struct import time import sys +from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_ONE, Q16_SCALE, to_q16 diff --git a/4-Infrastructure/lib/q16.py b/4-Infrastructure/lib/q16.py index 651ab4a7..e38ad388 100644 --- a/4-Infrastructure/lib/q16.py +++ b/4-Infrastructure/lib/q16.py @@ -9,7 +9,7 @@ from __future__ import annotations Q16_ONE: int = 0x00010000 # 65536 Q16_HALF: int = 0x00008000 -Q16_SCALE: float = 65536.0 +Q16_SCALE: int = 65536 def to_q16(value: float) -> int: diff --git a/4-Infrastructure/shim/compare_tier1_vs_tier2.py b/4-Infrastructure/shim/compare_tier1_vs_tier2.py index f896e920..9546bf3e 100644 --- a/4-Infrastructure/shim/compare_tier1_vs_tier2.py +++ b/4-Infrastructure/shim/compare_tier1_vs_tier2.py @@ -6,6 +6,7 @@ import os import sys from collections import Counter, defaultdict from math import sqrt +from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.jsonl import load_jsonl diff --git a/4-Infrastructure/shim/qr_spatial_hash.py b/4-Infrastructure/shim/qr_spatial_hash.py index c1c1530e..fdfb4f71 100644 --- a/4-Infrastructure/shim/qr_spatial_hash.py +++ b/4-Infrastructure/shim/qr_spatial_hash.py @@ -17,7 +17,7 @@ from pathlib import Path import sys as _sys _sys.path.insert(0, str(Path(__file__).resolve().parent)) -sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) +_sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_SCALE, to_q16 diff --git a/5-Applications/scripts/generate_avm_gold_trace.py b/5-Applications/scripts/generate_avm_gold_trace.py index c916e074..3f53fdf5 100644 --- a/5-Applications/scripts/generate_avm_gold_trace.py +++ b/5-Applications/scripts/generate_avm_gold_trace.py @@ -1,6 +1,7 @@ import json - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import to_q16 diff --git a/5-Applications/scripts/gsp/burgers_triad_core.py b/5-Applications/scripts/gsp/burgers_triad_core.py index a924330a..d35b5d27 100644 --- a/5-Applications/scripts/gsp/burgers_triad_core.py +++ b/5-Applications/scripts/gsp/burgers_triad_core.py @@ -1,6 +1,7 @@ import numpy as np - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "4-Infrastructure")) from lib.q16 import Q16_ONE, q16_mul diff --git a/5-Applications/scripts/hot_path_cold_path.py b/5-Applications/scripts/hot_path_cold_path.py index 0bb4de69..6f3d88ef 100644 --- a/5-Applications/scripts/hot_path_cold_path.py +++ b/5-Applications/scripts/hot_path_cold_path.py @@ -25,6 +25,9 @@ from dataclasses import dataclass from enum import Enum from collections import deque +import sys +from pathlib import Path + try: from sluq_triage import SLUQTriageSystem, StochasticTrajectory, TriageDecision _HAS_SLUQ_TRIAGE = True diff --git a/5-Applications/scripts/sabotage_prevention.py b/5-Applications/scripts/sabotage_prevention.py index d8d988f9..492a3cff 100644 --- a/5-Applications/scripts/sabotage_prevention.py +++ b/5-Applications/scripts/sabotage_prevention.py @@ -28,6 +28,8 @@ from enum import Enum from collections import defaultdict, deque import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "4-Infrastructure")) from lib.q16 import Q16_ONE, Q16_SCALE, from_q16, q16_add, q16_ge, q16_gt, q16_sub, to_q16 diff --git a/5-Applications/tools-scripts/utils/generate_diat_tables.py b/5-Applications/tools-scripts/utils/generate_diat_tables.py index ded62f19..8d9fb4e5 100644 --- a/5-Applications/tools-scripts/utils/generate_diat_tables.py +++ b/5-Applications/tools-scripts/utils/generate_diat_tables.py @@ -1,6 +1,7 @@ import math - import sys +from pathlib import Path + sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "4-Infrastructure")) from lib.q16 import to_q16