Exploratory research project workflow

An exploratory workflow with a main.jl file which calls different scripts with include is a very good / acceptable workflow.

If you are only working with a single file then you want to use Revise.jl’s includet, which means you dont have to run include all the time.

But you should really be trying to put everything in functions.

Here’s what I do.

  1. Start out with main() at the bottom of your script.
  2. Use includet on that file and call main() when you want to run everywhint
  3. Write everything in main, when it gets too big, break things into smaller functions that are called within main
  4. Use Exfiltrator.jl extensively in debugging, as @exfiltrate; error("") when you want to break and send everything in that function’s local scope to global scope for inspection at the REPL
  5. Use dictionaries, named tuples, and custom structs to store information. Pass large objects to the functions and use @unpack to work with just the things you need. This means you don’t have to agonize about what you are and are not passing to your sub-functions.
  6. Just run main() all the time. If you use includet then everything will always be up to date. It’s very freeing.
2 Likes