Skip to content

Reorganize flat-file repo into proper package directory structure#1

Merged
merrypranxter merged 1 commit into
mainfrom
copilot/organize-repo-structure
Apr 9, 2026
Merged

Reorganize flat-file repo into proper package directory structure#1
merrypranxter merged 1 commit into
mainfrom
copilot/organize-repo-structure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

All source files were dumped flat in the repo root with prefixed names (e.g. core_gray_scott.py, gpu_pearson_plot_gpu.py) instead of the intended subdirectory layout already documented in REPO_STRUCTURE.md.

Changes

  • docs/ — 10 numbered theory/reference markdown files
  • core/ — Gray-Scott engine, Laplacian operators, parameters, seeding
  • cpu/ — NumPy, Cython, Fortran backends; benchmarks in cpu/benchmarks/
  • gpu/pytorch/ — PyTorch CUDA impl + Pearson plotter; added missing __init__.py (required by gpu/__init__.py's relative imports)
  • gpu/webgpu/ — WGSL compute shader + JS pipeline
  • gpu/benchmarks/ — speedup results
  • models/ — BZ, FitzHugh-Nagumo, Cahn-Hilliard, Schnakenberg
  • shaders/ — GLSL/FRAG files
  • presets/ — Pearson-types and named-behaviors JSON
  • tests/ — convergence, Laplacian, and preset test suites
  • tools/ — parameter scanner, video generator, profiler CLIs
  • examples/threejs-webgl/ — interactive WebGL demo (index.html)
  • .github/workflows/ — CI workflow

All moves done via git mv to preserve history. No file contents modified except the new gpu/pytorch/__init__.py.

@merrypranxter merrypranxter marked this pull request as ready for review April 9, 2026 15:52
Copilot AI review requested due to automatic review settings April 9, 2026 15:52
@merrypranxter merrypranxter merged commit 49ec41f into main Apr 9, 2026
2 of 14 checks passed
@merrypranxter merrypranxter deleted the copilot/organize-repo-structure branch April 9, 2026 15:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes the repository into a proper Python package/module directory structure (core/cpu/gpu/models/tools/tests/etc.) and adds supporting assets (presets, shaders, docs, examples) plus CI configuration to make the project testable/installable.

Changes:

  • Introduces structured Python packages for core simulation, CPU/GPU backends, models, and tooling (plus __init__.py files).
  • Adds presets, shader sources, documentation notes, and a Three.js WebGL example.
  • Adds a GitHub Actions CI workflow to run formatting/type-check/tests and build wheels.

Reviewed changes

Copilot reviewed 1 out of 49 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/video_generator.py CLI to generate an MP4 from a Gray-Scott run.
tools/profiler.py CLI-ish utility to profile NumPy vs PyTorch implementations and emit a report.
tools/parameter_scanner.py CLI to batch-render Pearson types and sweep (F,k) grids.
tools/init.py Marks tools as a package.
tests/test_presets.py Validates preset JSON structure/content.
tests/test_laplacian.py Laplacian operator unit tests and equivalence checks.
tests/test_convergence.py Numerical stability/pattern/convergence tests for the simulator.
tests/init.py Marks tests as a package.
shaders/gray-scott-sim.frag WebGL fragment shader implementing Gray-Scott step.
shaders/display-munafo.frag WebGL fragment shader for Munafo-style visualization.
shaders/color-ramps.glsl Shared GLSL color ramp utilities.
shaders/init.py Marks shaders as a package.
presets/pearson-types.json Pearson-type parameter presets for Gray-Scott.
presets/named-behaviors.json Named (F,k) behaviors presets.
presets/init.py Marks presets as a package.
models/schnakenberg.py Schnakenberg model implementation.
models/fitzHugh_nagumo.py FitzHugh–Nagumo model implementations (grid + network).
models/cahn_hilliard.py Cahn–Hilliard spectral solver + noisy variant.
models/belousov_zhabotinsky.py BZ/Oregonator and simplified excitable-medium model.
models/init.py Exports models package surface (__all__).
gpu/webgpu/pipeline.js WebGPU compute pipeline orchestration (resources, uniforms, dispatch).
gpu/webgpu/compute.wgsl WebGPU compute shader for Gray-Scott.
gpu/pytorch/pearson_plot_gpu.py PyTorch Pearson-plot (spatial parameter sweep) implementation.
gpu/pytorch/gray_scott_torch.py PyTorch Gray-Scott implementation using conv2d Laplacian.
gpu/pytorch/init.py Exposes PyTorch GPU implementations as a subpackage.
gpu/benchmarks/gpu_speedups.md Documentation of observed GPU speedups.
gpu/init.py Top-level GPU package import shim / optional exports.
cpu/numpy_vectorized.py Vectorized NumPy Gray-Scott baseline implementation.
cpu/cython_accelerated.pyx Cython-accelerated stepping implementation + wrapper class.
cpu/fortran_backend.f90 Fortran backend routines (f2py target).
cpu/benchmarks/benchmark_results.md CPU benchmark result write-up.
cpu/init.py CPU package exports and optional Cython import.
core/seeding.py Seed/initial-condition generators for simulations.
core/parameters.py Dataclasses + canonical parameter presets (Pearson types, named behaviors).
core/laplacian.py Laplacian kernels and implementations (5-pt, 9-pt, convolution).
core/gray_scott.py Core NumPy Gray-Scott simulator + image/state helpers.
core/init.py Core package exports and public API surface.
docs/01-mathematical-foundations.md Theory reference: reaction-diffusion basics, Laplacians, stability.
docs/02-gray-scott-deep-dive.md Theory reference: Gray-Scott equations, seeding, parameters.
docs/03-pearson-classification.md Theory reference: Pearson taxonomy and parameter map.
docs/04-bifurcation-theory.md Theory reference: bifurcation boundaries and implications.
docs/05-topological-defects.md Theory reference: defect types and shader injection ideas.
docs/06-implementation-patterns.md Reference on CPU/GPU implementations and kernels.
docs/07-coloring-strategies.md Reference on visualization/coloring strategies.
docs/08-spatial-parameter-sweeps.md Reference on Pearson plots/spatial parameter sweeps.
docs/09-alternative-models.md Overview of alternative models included in models/.
docs/10-blur-sharpen-equivalence.md Reference on blur+unsharp-mask equivalence to RD.
examples/threejs-webgl/index.html Browser demo: Gray-Scott simulation via Three.js/WebGL.
.github/workflows/ci.yml CI pipeline for lint/typecheck/tests/coverage + wheel builds + benchmarks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants