Skip to content

Commit 2007507

Browse files
committed
Improve Sphere regression tests
Ensure filename consistency etc across tests Migrated eta import test but still need to fix an error with this test.
1 parent c98c7a0 commit 2007507

12 files changed

Lines changed: 108946 additions & 47 deletions

File tree

tests/regression/sphere/compare.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pathlib import Path
1616

1717
# Import the comparison template
18-
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
18+
sys.path.append(os.path.join(os.path.dirname(__file__), '../utilities'))
1919
from compare_template import run_comparison
2020

2121
if __name__ == '__main__':
@@ -38,10 +38,12 @@
3838
# Ensure the plots directory exists
3939
plots_dir.mkdir(parents=True, exist_ok=True)
4040
print(f"Plot will be saved to: {plots_dir}")
41-
print(f"Plot filename: {plots_dir}/Sphere Decay Test_comparison.png")
4241

4342
# Sphere-specific configuration
4443
test_name = "Sphere Decay Test"
44+
# Convert test_name to lowercase with underscores for filename
45+
safe_test_name = test_name.lower().replace(' ', '_').replace('-', '_')
46+
print(f"Plot filename: {plots_dir}/{safe_test_name}_comparison.png")
4547
y_label = "Heave (m)"
4648
executable_patterns = ["sphere_decay_test", "sphere_decay"]
4749
pass_criteria = (1e-4, 0.02) # (L2 threshold, L-infinity threshold)

tests/regression/sphere/demo_sphere_decay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ int main(int argc, char* argv[]) {
136136
ensure_directory_exists(results_dir);
137137

138138
if (profilingOn) {
139-
std::ofstream profilingFile(results_dir / "sphere_decay_duration.txt");
139+
std::ofstream profilingFile(results_dir / "CHRONO_SPHERE_DECAY_HEAVE_DURATION.txt");
140140
if (profilingFile.is_open()) {
141141
profilingFile << duration << " ms\n";
142142
profilingFile.close();
@@ -146,7 +146,7 @@ int main(int argc, char* argv[]) {
146146
}
147147

148148
if (saveDataOn) {
149-
std::ofstream outputFile(results_dir / "sphere_decay.txt");
149+
std::ofstream outputFile(results_dir / "CHRONO_SPHERE_DECAY_HEAVE.txt");
150150
if (outputFile.is_open()) {
151151
outputFile << std::left << std::setw(10) << "Time (s)" << std::right << std::setw(12)
152152
<< "Heave (m)"

0 commit comments

Comments
 (0)