Skip to content

refactor(scripts): move logic to src and standardize entry points#5

Merged
JacksonFergusonDev merged 6 commits into
mainfrom
refactor
Jan 30, 2026
Merged

refactor(scripts): move logic to src and standardize entry points#5
JacksonFergusonDev merged 6 commits into
mainfrom
refactor

Conversation

@JacksonFergusonDev

Copy link
Copy Markdown
Owner

Summary

This PR refactors the scripts/ directory to adhere to the "scripts as triggers, src as engine" philosophy. Imperative logic (plotting, signal generation, capture loops) has been moved from individual scripts into reusable modules within src/. All scripts have been standardized to use the def main(): pattern.

Key Changes

🏗️ Architecture

  • Scripts: Now strictly CLI wrappers. They parse arguments, load config, call a library function, and exit.
  • Src: Expanded to include all business logic for audio synthesis, plotting, and experiment orchestration.

🔄 Logic Relocation

Original Script Moved To New Function
fun/neon_torus.py src/audio.py generate_drone
fun/record_drone.py src/audio.py generate_pulsing_drone
fun/render_landscape.py src/io.py load_latest_file
viz/joyplot.py src/plots.py plot_joyplot_stacked
fun/neon_torus.py src/plots.py plot_phase_portrait
fun/render_landscape.py src/plots.py plot_spectral_landscape
viz/playback_scope.py src/viz.py run_playback_scope
capture/stream.py src/experiments.py capture_continuous_stream

🧹 Standardization

  • All scripts in scripts/ now use the def main(): ... if __name__ == "__main__": main() pattern to prevent global variable leakage and improve testability.
  • Consolidated duplicate capture logic in master_transfer.py to use src.experiments.

Testing

  • Verified that all visualization scripts (joyplot, render_landscape) can still locate files and generate plots using the new library functions.
  • Verified that capture scripts (stream, record_drone) correctly interface with src.daq.

@JacksonFergusonDev JacksonFergusonDev merged commit 88460eb into main Jan 30, 2026
2 checks passed
@JacksonFergusonDev JacksonFergusonDev deleted the refactor branch January 30, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant