38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
|
|
"""
|
||
|
|
Reset the UAV arm AtomizerField test study
|
||
|
|
|
||
|
|
Clears all optimization results and logs to start fresh.
|
||
|
|
Preserves the setup and model files.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from pathlib import Path
|
||
|
|
import shutil
|
||
|
|
|
||
|
|
def reset_study():
|
||
|
|
"""Reset study to clean state."""
|
||
|
|
|
||
|
|
study_dir = Path(__file__).parent
|
||
|
|
|
||
|
|
# Remove results directory
|
||
|
|
results_dir = study_dir / "2_results"
|
||
|
|
if results_dir.exists():
|
||
|
|
print(f"Removing {results_dir}...")
|
||
|
|
shutil.rmtree(results_dir)
|
||
|
|
|
||
|
|
# Remove training data export directory if exists
|
||
|
|
training_data_dir = Path("atomizer_field_training_data/uav_arm_test")
|
||
|
|
if training_data_dir.exists():
|
||
|
|
print(f"Removing {training_data_dir}...")
|
||
|
|
shutil.rmtree(training_data_dir)
|
||
|
|
|
||
|
|
# Remove any Python cache
|
||
|
|
pycache = study_dir / "__pycache__"
|
||
|
|
if pycache.exists():
|
||
|
|
print(f"Removing {pycache}...")
|
||
|
|
shutil.rmtree(pycache)
|
||
|
|
|
||
|
|
print("Study reset complete!")
|
||
|
|
print("You can now run: python run_optimization.py")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
reset_study()
|