CentreForDigitalHumanities / CentreForDigitalHumanities/programming-in-python

Single .py file for lesson and solution files

Open
#23 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Jupyter Notebook
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Currently, when I adapt anything in a lesson or solution, I need to change the corresponding lesson/solution as well. This is easy to forget, leads to incongruences and is generally not very dry, especially since the only difference between these files should be the solutions to the answers.

I wonder if there is a way to generate both the lesson notebook and solution notebook from the same `.py` file.

@JeltevanBoheemen: since you are the Keeper of Knowledge when it comes to this `.py -> .ipynb` conversion, is it possible to mark solution blocks with `# %% [solution]` and exclude them in the generation of the lesson notebooks?

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing .py-to-.ipynb conversion process and comparing the lesson and solution notebook pairs. Determine whether solution blocks marked with # %% [solution] can be excluded when generating lesson notebooks; done means one .py source keeps both outputs consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.