KULeuven-MICAS / zigzag

HW Architecture-Mapping Design Space Exploration Framework for Deep Learning Accelerators
https://kuleuven-micas.github.io/zigzag/
MIT License
90 stars 31 forks source link

Reworked internals #49

Closed RobinGeens closed 1 month ago

RobinGeens commented 2 months ago

This branch holds many many changes to the internals of Zigzag, though the functionality itself has barely changed. Changes include the following:

The proposed dev setup, to be used by all future contributions, is as follows:

To complete this PR, the following to do's should be completed. Currently, only the test_origin tests pass.

To come to a more uniformly programmed code base, I would like to suggest the following programming principles:

  1. A good function should do one thing and one thing only. As such, a good function cannot reasonably be separated into multiple blocks, as this implies the function does more than one thing.
  2. Function and variable names should be clear enough such that a comment to describe it is redundant. With well-chosen function and variable names, it is easy to follow the programming flow without reading additional comments.
  3. Comments should give a rationale, and not explain the code itself.
  4. Avoid try/except blocks for control flow, these should only be used for error handling and irregular behavior.

Note that after this PR, I will be reworking the user interface.

RobinGeens commented 1 month ago

This is a perfect list of how this PR had to be split up 🥲 . Right now, if someone disagrees with a certain part, it's very hard to filter it out. It is also very difficult to see what diff corresponds to what feature change.

Agreed, will keep this in mind next PR :)

Not everybody uses VSCode :), if you want to enforce type checking, I suggest adding the pyright configuration (which can be detected by VSCode) in the pyproject.toml

Fair point, thanks for the remark!