#+Title: Best practices - MESA Summer School 2025
#+date: <2025-07-24 Thu>

This repository was used to develop the materials for the Thursday
morning lab at the [[https://mesa-leuven.4d-star.org/][MESA summer school 2025]] in KU Leuven.

The official online tutorial is available [[https://mesa-leuven.4d-star.org/tutorials/thursday/morning-session/][here]], and the associated
lecture was given by [[https://sites.google.com/view/aldanagrichener][@AldanaGrichener]].

The local copy of the instructions for the lab are at
[[./Instructions.org]] exported in =markdown= format at [[./Instructions.md]].

** Tentative lecture plan
*** Best Practices
**** Debugging

Loosely based on [[https://docs.mesastar.org/en/latest/developing/debugging.html][this documentation]].

**** Open science & reproducibility
Maybe make checklist to consult
- e.g., [[https://ui.adsabs.harvard.edu/abs/2020ApJ...902L..36F/abstract][Farmer et al. 2020]] \rightarrow [[https://ui.adsabs.harvard.edu/abs/2022ApJ...924...39M/abstract][Mehta et al. 2022]]
- zenodo (refer to [[https://zenodo.org/communities/mesa/curation-policy][guidelines]]):
  - minimal work examples (\rightarrow how to ask a good question on the mailing
    list)
  - data: profiles and history
  - postprocessing scripts
  - README mapping figure/result \leftrightarrow scripts \leftrightarrow data \leftrightarrow code
- [[https://docs.mesastar.org/en/latest/using_mesa/best_practices.html#in-the-article][give proper credits in your citation]]
  - input physics
  - algorithmic implementation
  - /all/ code papers
- consider "donating time" to help others:
  - reply to mailing list
  - open an issue on [[https://github.com/MESAHub/mesa][gitHub]]
  - open a PR on [[https://github.com/MESAHub/mesa][gitHub]]
  - share your custom tools, make your science reproducible!
- *Bonus*: [[https://github.com/MESAHub/mesa-contrib][MESA contrib]]

**** Developing

- [[https://github.com/mathren/compare_workdir_MESA][compare inlist ignoring order, comments, nesting, and defaults]]

*** Requirements

 [[https://docs.mesastar.org/en/24.08.1/installation.html][MESA 24.08.1]] (tested with [[http://user.astro.wisc.edu/~townsend/static.php?ref=mesasdk][MESA SDK]] "x86_64-linux-24.7.1")

*** How to test

Use one core by running

#+begin_src sh
export OMP_NUM_THREADS=1
#+end_src

*** Useful references
Relevant MESA documentation pages:
- [[https://docs.mesastar.org/en/latest/using_mesa/best_practices.html][Best practices]]
- [[https://docs.mesastar.org/en/latest/developing/debugging.html][Debugging]]
Contribute back ready-to-use routines:
- [[https://github.com/MESAHub/mesa-contrib][MESA contrib]]
Tooling:
- [[https://github.com/mathren/compare_workdir_MESA][compare MESA inlist]]
