carpentries / styles

Styles for The Carpentries lessons. No README to avoid merge conflicts with lessons. Demo 👇
https://carpentries.github.io/lesson-example
Other
84 stars 94 forks source link

Code Checking Utility #622

Open bpmweel opened 2 years ago

bpmweel commented 2 years ago

Salutation!

While working on the deep-learning-intro we noticed that we needed to check whether the code we have in our lesson actually works. For this I made a small utility that we use in a github action to check this, you can see it here: https://github.com/bpmweel/cce.

Given a markdown file with the carpentries template the tool

You can see how it works in our deep-learning-intro repository here: https://github.com/carpentries-incubator/deep-learning-intro/actions/workflows/inline-code.yml

I think this would be a nice addition for the lesson template. Would you be interested in using this? If so it would be really good to find some people who are willing to help develop the tool so it can be used with more languages and perhaps also check whether the output makes sense.

zkamvar commented 2 years ago

While working on the deep-learning-intro we noticed that we needed to check whether the code we have in our lesson actually works. For this I made a small utility that we use in a github action to check this, you can see it here: https://github.com/bpmweel/cce.

Given a markdown file with the carpentries template the tool

* It extracts any code block marked with {:.language-python}

* Puts it in a python file

* Executes the python file

* Captures any exceptions and outputs these to the stdout

You can see how it works in our deep-learning-intro repository here: https://github.com/carpentries-incubator/deep-learning-intro/actions/workflows/inline-code.yml

I like your solution to this problem! It's non-invasive towards the rest of the styles repository and it provides good feedback for python lessons.

I think this would be a nice addition for the lesson template. Would you be interested in using this? If so it would be really good to find some people who are willing to help develop the tool so it can be used with more languages and perhaps also check whether the output makes sense.

I also agree that this would be a nice addition, but, because of changes we are planning for the future, it would be best to hold off on it.

Here's the rub: We are currently working on the next iteration of the lesson infrastructure that is going to have an improved workflow, which means that the styles repository will have an end of life in 2022 or 2023. Adding large new features to the lesson at this time will be ultimately a sunk cost in terms of not only implementation to make it portable, but also for maintenance.

In the future, we are going to include processes that will auto-generate the output in a lesson (much like we do with the R lessons at the moment) so that the code and output will be guaranteed to be reproducible.