Skip to content

Example Folder Cleanup #351

Open

Description

@jhalpern30

The examples folder is quite messy right now, with what seems to be a variety of both examples and benchmark-like cases. Some also contain their own run/analysis files, but others don't. A specific way I can see to clean this up and ensure a standard moving forward is removing the individual run scripts in each example folder in favor of a master script.

A rough sketch of how I see this working:
We make a master script RunExample.jl:

julia RunExample.jl "DIIID-like_ideal_example"

Within the main function of this file, it then checks the string passed in:

  • If it ends in "example" it basically does the existing run_example.jl few lines
  • If it ends in "scan" it does a generalized version of Daniel's run_scan.jl scripts

This would avoid having to maintain a run file for each example we maintain, and also force all examples conform to be either a "example" or "scan" type (or additional types as needed).

This doesn't account for example analysis scripts. We could add a generalized version of that too if needed

Activity

  1. added this to the GPEC v2.0.0 milestone on Aug 3, 2026
  2. jhalpern30 commented on Oct 6, 2026

    @jhalpern30
    CollaboratorAuthor

    I am actually going to remove GPEC v2.0 from this - I think this should be revisited after @matt-pharr is done their refactoring, since the long term goal is to make GPEC more scriptable which will probably update how we do examples. But I do like the general idea of a more unified examples interface once the refactoring is done
    cc @logan-nc

  3. removed this from the GPEC v2.0.0 milestone on Oct 6, 2026
  4. matt-pharr commented on Oct 7, 2026

    @matt-pharr
    Collaborator

    @jhalpern30 I have one more PR coming in soon and then we should be able to address this! I think that this deserves the v2.0.0 since the examples we want to look good for people trying to understand how to use the code.

  5. added this to the GPEC v2.0.0 milestone on Oct 7, 2026
  6. added theissue type on Oct 7, 2026
  7. logan-nc commented on Oct 27, 2026

    @logan-nc
    Collaborator

    Not opening the master-script PR now. examples/ has 22 entries with 14 per-folder scripts (7 run_example.jl, 4 analyze_example.jl, 2 run_scan.jl, 1 run_imas_example.jl), and three open API PRs still rewrite the decks: #569 deletes keys from every example, #574 edits the regularization lines, #581 moves kinetic_file into [Equilibrium]. A unified runner opened tonight would need re-stamping after each. Matt claimed this after his refactor; suggest doing it immediately after #581 lands, with the example/scan split proposed here.

  8. matt-pharr commented on Oct 27, 2026

    @matt-pharr
    Collaborator

    @logan-nc @jhalpern30 this is scheduled in #602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

refactorBehavior-preserving restructuring

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions