(Kind of personal notes) Brainstorm on documentation/developer project mantainability #1220
Replies: 5 comments 1 reply
-
However, judging by #1068 it sounds like we don't want to use the Let's see this functionally. We have conceptually the same project, with the source code and the related documentation. The state of the documentation and the codebase are linked based on the corresponding versions. However, if we break it down, we kind of have two separate build flows. The main If we were to think of the documentation and main code integrated together, then it would be easier to perform the standard development design flow. Let's say, we write a This does not yet fully solve the I think a good approach is this: we have a |
Beta Was this translation helpful? Give feedback.
-
Thanks Dario, your insights are super appreciated so thank you for writing them down like this. It's invaluable to us. As you can imagine, a lot of the way things are structured at this point have more to do with maintaining legacy code and decisions made a while ago when we had different problems than we do now. So a big way you can help us out is to take a fresh look at our development process and come up with better ways to do things so that we can be more efficient and scale as things get even more complex in the coming months. The docs / frontend integration is one major painpoint that I think we need to figure out so it's great that we're starting with this. Note also that we have various private repos that are similarly integrated with the front end, so there's a lot of interdependency that makes development a bit tricky. For example, if I introduce a new feature, often times I need to have 3 PRs (docs, frontend, backend) that are all linked through submodules and need to be merged one by one, it's a bit of a mess to be honest so having things integrated would really help. For a bit of context, we decided to split tidy3d-docs and tidy3d to avoid notebook and docs commits cluttering the tidy3d git history and bloating the package. This was before we introduced About your individual comments, I'll try to answer a bit / give some more context: virtual environments / requirements.We want to really simplify and modernize this and avoid messing with parsing Notebook diffs@lucas-flexcompute originally suggested frontend / docs integration
I think this sounds good to me, again, assuming that regular users wouldn't have to install or worry about docs at all. So would we just move An important note, |
Beta Was this translation helpful? Give feedback.
-
Hi Tyler, I am very grateful for taking the time to write your valuable insight. I have been thinking about it since yesterday.
What do you think? |
Beta Was this translation helpful? Give feedback.
-
Hey @daquintero, thanks for the discussion points! I just wanted to share my thoughts from when I looked into the notebooks issue. I was also looking into jupytext when trying to improve our workflow, but I could not find ans easy way to have the run results also cached in the repo. The discussion I had with Tyler and Momchil at the time was that having the cell outputs in the repository is very desirable, because PR reviews are much easier when we can compare plots side-by-side, for example, straight in github. It's also convenient to have the notebook results ready when we're making any changes without having to run them before we start (some notebooks can be very long). My ideal solution would be to have the jupytext version of each notebook in the repository history and the ipynb versions only for the branch tip, but I don't know if that's viable. If jupytext and ipynb are kept in sync, we might be able to set up a git hook that removes old versions of the ipynb when we commit, but both working with synced files and using commit hooks are prone to error. |
Beta Was this translation helpful? Give feedback.
-
Sounds good to me, then!
I think something along these lines could be useful, I think the locking between backend and front end is not so difficult at the moment but might be good to standardize. I'd say this is a lower priority than merging front end and docs though. Once you join, it would be useful to talk with some of the backend-focused developers to get a feeling for what their pain points are regarding this, I'm less informed on that end.
Something like this could work, yea. I think the main thing that would be nice is if the new feature PR could be contained entirely in the frontend repo
Yea I'll have to refer to you on the person on our other team who directed me to use
That sounds fine, I think Lucas' comment on this explains the situation quite well: we generally want the notebook diffs to be quite small to not bloat the repo, but also it is useful to have the outputs when reviewing. maybe you and Lucas can work out a good solution for that.
I would say that it's very rare for any external users to compile the docs themselves, so I am less concerned generally about how we install the docs requirements, but want to keep the Let's schedule a time to talk tomorrow, maybe my morning (EST)? after you are set up with onboarding and we can discuss some more over zoom. Maybe just email me tomorrow once you're set up. |
Beta Was this translation helpful? Give feedback.
-
Hi guys,
I thought to write this as a personal notebook of thoughts when looking at the documentation/developer structure but realized this is an open-source section of the project, and what makes it powerful is our ability to collaborate so I've decided to write my notes here.
I'm going through the code in detail. Even though I'm just a humble developer, I am freshly looking at the code and I wanted to write down the ideas of ways that maybe the development structure can be made easier - even if my ideas may be not necessarily useful. The current structure is good, and am happy to start developing with it. This discussion contains some proposals/personal notes of potential maintainability ideas that are really my brainstorm or self-explanation of the structure of the current development flow.
pandoc
recepies properly install the toolset in the corresponding windows/linux/mac way as it can run mamba installation scripts which include shell scripts, and distribute environments in a more common methodology. It could also be integrated onto amambaforge
distribution likegdsfactory
do. How different is this from providing installation shell scripts for each platform? Maybe this guarantees that the right section of the script gets run for the corresponding platform, and is distributable to users as part of amamba
orconda
installation. However, I am not personally super convinced of my proposed approach. This is because having the currentrequirements.txt
installation means that the tool is more generic for people developing in raw python and also more easily distributed between platforms. However, it would be nicer if we could package up the developer installation within a script.gdsfactory
install have apip install gdsfactory[develop]
which installs all the developer requirements, and is part of thepyproject.toml
but this may not necessarily apply to us since we want to keep the documentation separately from the other repo due to the size of the project. Having a distributed virtualenvironment guarantees the sphinx compilation should work well too. Hmm I have only just begun thinking about this so I'm sure some other approaches will come to mind later.nbdime
to perform notebook collaboration and merges which is a great tool for the job.gdsfactory
has all their examples injupytext
which makes collaboration and upgrade tracking work as python text file line tracking which is native to GitHub for example, rather than the binary changes tracking whichnbdime
makes easier to manage. This also means you can use standard file extensions such asblack
and others without depending on jupyter notebook specific tools. The drawback is thatjupytext
becomes essential to everyone. However, it also creates a level of standardization with thegdsfactory
documentation so that people using both tools use the same example documentation flow. I have personally usedjupytext
extensively and have found that for most applications of jupyter notebooks, it is an equivalent tool. However, the problem with it is that it does not maintain a cache, which is great for tracking changes, but less useful if we want to save notebooks in a particular state.Beta Was this translation helpful? Give feedback.
All reactions