Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Checking Utility #622

Open
bpmweel opened this issue Aug 6, 2021 · 1 comment
Open

Code Checking Utility #622

bpmweel opened this issue Aug 6, 2021 · 1 comment

Comments

@bpmweel
Copy link

bpmweel commented Aug 6, 2021

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

  • 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 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
Copy link
Contributor

zkamvar commented Aug 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants