PyPSA/pypsa-eur

Refactor scripts to follow concept of "one level of abstraction per function"?

fhg-isi opened this issue · 0 comments

Instead of the flat structure of the scripts folder and the huge script files I suggest to:

  • group files in subfolders, e.g. "add,", "build", "plot", "prepare" etc. => scripts/build/shapes.py instead of scripts/build_shapes.py
  • extract parts of the huge files to extra files => less scrolling, use IDE navigation features, one level of abstraction per function
  • use function calls instead of block comments => one level of abstraction per function, easier to test, workflow is easier to grasp and not mixed with minor information/lower abstraction levels

Possible drawbacks of nested structure:

  • might break downward compatibility when merging from older forks
  • people not familiar with IDE navigation features might have a harder time to find stuff
  • if files are moved around a lot, they would not come with the context of their original folder structure any more.

What do you think?