Flatter module hierarchy #549
Replies: 8 comments
-
This flatter directory structure looks extremely cluttered to me. |
Beta Was this translation helpful? Give feedback.
-
We can achieve something like this with init files, but it's incompatible to the implicit namespace we are using as the implicit namespace is implemented by the absence of init files. I would be in favor to move to a normal namespace. Then we could make the hierarchy look flatter and also create "module docstrings" in the init files which would improve our API reference. |
Beta Was this translation helpful? Give feedback.
-
With normal namespaces, will we be able to bring together the directory structures from our separate repositories (lava-nc, lava-loihi, libraries) into a single, coherent structure? I believe this is why we are using implicit namespaces. |
Beta Was this translation helpful? Give feedback.
-
What makes it look cluttered to you? Is it that the content of the directories is sometimes Processes and sometimes other APIs? |
Beta Was this translation helpful? Give feedback.
-
Well, the purpose of a hierarchy is that related things are grouped together in a logical way. This makes it at least easier for me to navigate a directory structure and recognize what is what and how things are related. |
Beta Was this translation helpful? Give feedback.
-
Unrelated note:
This is Loihi internals leaking to the top level. |
Beta Was this translation helpful? Give feedback.
-
My idea was to pull up all user-facing APIs to the top layer and put them into modules with descriptive names right under lava. All of the top-level directories have in common that they are elements that users would use or instantiate in an application. I felt it would be easier for users to find elements they can use just by looking at the code. They would not have to understand what I agree with your comment on learning - that was an error on my part. I have now changed it in my proposal, hiding internals in I understand that the different nature of the APIs (some being Processes, others not) may seem confusing. It does not bother me that much personally. I thought I would just start this discussion and others could integrate their thoughts. |
Beta Was this translation helpful? Give feedback.
-
What about the alternative idea of having a single top level init file that pulls everything a user commonly uses together? Would give you the same look and feel but not clutter the directory structure. Again... works well for TF: I'm not insisting on the name 'magma'. It could be just 'core'. But then we are also not really consistent, as 'core' would combine stuff the user needs and that the user doesn't need on a daily basis. I'm just concerned with the top-level directory just growing arbitrarily as time moves on. If we don't impose any basic structure where utils, procs, and other stuff that people might invent go, then people will just throw everything at the top level as new utils, backends, peripherals, etc. are added. I'm the least active developer right now, so maybe my opinion does not count much. I just feel (a) it would already be messy and (b) can only get messier over time. |
Beta Was this translation helpful? Give feedback.
-
I would like to suggest a new module hierarchy to
We currently have this:
This is not fully thought through but maybe something like this:
Beta Was this translation helpful? Give feedback.
All reactions