Package for converting thermo homework assignments
Project description
thermohw
Homework assignment converter from Jupyter Notebooks to PDF
This package installs a CLI script to convert Jupyter Notebook homework assignments to PDF (with and without solutions) and a set of Notebooks (with and without solutions).
Given a directory structure such as
.
├── homework
| ├── homework-1
│ │ ├── homework-1-1.ipynb
│ │ ├── homework-1-2.ipynb
│ │ ├── homework-1-3.ipynb
│ │ ├── homework-1-4.ipynb
│ │ ├── homework-1-5.ipynb
│ │ ├── homework-1-6.ipynb
| ├── homework-2
│ │ ├── homework-2-1.ipynb
│ │ ├── homework-2-2.ipynb
│ │ ├── homework-2-3.ipynb
│ │ ├── homework-2-4.ipynb
...
running
convert_thermo_hw --hw 1
will convert all of the .ipynb files in the homework-1 directory. You can also specify which
problems should be converted by the problems argument, which takes a list of integers
convert_thermo_hw --hw 2 --problems 1 3 4
would convert problems 1, 3, and 4 in homework-2.
The option --by-hand allows certain problems to be marked as the solution should be done out by
hand
convert_thermo_hw --hw 3 --by-hand 1 2
would mark problems 1 and 2 in homework-3 as to be done by hand instead of with the code.
The output files are placed in a directory called output in the homework-N directory.
Change Log
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
0.7.1 - 2021-JAN-12
Fixed
- IPython package is a dependency for its code lexer
0.7.0 - 2021-JAN-12
Added
- The
SolutionRemoverpreprocessor now uses cell tags to find the solution and its parts - A
legacycommand line argument switches back to the old method of finding the solution based on parsing the source of the cell - A test of the new tag-based
SolutionRemover
Changed
- Highlighted answer cells cannot be deleted in the assignment notebook
- Support for Python 3.6 is dropped
- Moved to
srcdirectory layout and don't include tests with the package
Fixed
- Type hinting for
resourcesdictionaries in some preprocessors
Removed
- Remove exam processing, which didn't work well and wasn't really used
0.6.0 - 2020-SEP-11
Added
- Option to clean the output folder can be specified.
- Test with the latest Python 3.9
Changed
- Change base template for our template to
style_jupyterinstead ofstyle_ipython. Has a number of benefits, most notably, line breaking in code cells.
Fixed
- Fix uploading the Anaconda package
0.5.2 - 2020-SEP-03
Changed
- Switch to GitHub Actions
0.5.1 - 2020-SEP-03
Fixed
- The version number was incorrect for v0.5.0
- Tests!
0.5.0 - 2020-SEP-03
Added
- Add ability to process exam files into assignments and solutions
- Cells that contain the word "Sketch" indicate that they require an image submission
Changed
- Run Black on all the code files
- Delete Pymarkdown variables from the cell metadata to avoid revealing the solutions
- Move
combine_pdf_as_bytes()toutils.py - Only run
xelatexon the converted files once
Fixed
- Files without
### part namenow correctly excludes the solution
Removed
- The
HomeworkPreprocessorclass was no longer useful, because it was removing things it shouldn't have been
0.4.2 - 2018-SEP-03
Added
- Test suite started, with a test of the
ExtractOutputsPreprocessorthat checks pathological filenames - Run test suite on TravisCI
Changed
- Distribute the LICENSE file with built artifacts
Fixed
- Fix pathological image filenames that caused URL escaping errors
0.4.1 - 2018-AUG-30
Fixed
- Fix spaces in attached image names cause LaTeX to fail
0.4.0 - 2018-AUG-26
Added
raw_html_filterto process raw inline HTML to equivalent LaTeX forms- Option to show the solution should be done by hand,
--by-handcommand line option
Changed
- Reset all cell executions to be None when a Notebook is processed
0.3.1 - 2018-AUG-14
Added
- Expose filter functions from
div_filter.pyin__init__.py
0.3.0 - 2018-AUG-14
Added
- Add filter to convert Bootstrap
alert-*classes to LaTeXtcolorboxes
0.2.5 - 2018-AUG-03
Added
setup.cfgfile added to configure some metadata- Add
flake8configuration tosetup.cfg - More keywords to
setupfunction insetup.py - Module docstring for the new
preprocessorsmodule - Export more classes and functions from
__init__.py
Changed
- The
HomeworkPreprocessorandSolnRemoverPreprocessorare moved fromconvert_thermo_hwmodule topreprocessorsmodule
Fixed
- Fix some typing errors
Removed
- Remove the
ExtractOutputsPreprocessorwhich is not needed anymore
0.2.4 - 2018-AUG-03
Fixed
- PyPI deploy password for Travis CI must be encrypted with
--proflag
0.2.3 - 2018-AUG-03
Fixed
- Fix anaconda.org upload token decryption
0.2.2 - 2018-AUG-03
Fixed
- Typo in README.md
- Conda recipe description was not valid YAML
0.2.1 - 2018-AUG-03
Added
- Install
conda-verifyon Travis CI
Changed
- Change Python version dependency in
conda.recipe/meta.yamlto be less the 4.0
Fixed
- Fix accessing Jinja variables in
conda.recipe/meta.yaml
Removed
0.2.0 - 2018-AUG-03
Added
- Add Travis CI configuration
- Include the
homework.tpltemplate file with the distribution - Appropriate classes are now exported in
__init__.py
Changed
- Use
PyMarkdownPreprocessorfrom our own module to avoid havingjupyter_contrib_nbextensionsas a dependency - Set the
build_directoryof thePDFExporterFileWriterinstance to prevent writing intermediate files in the local directory - Sort the list of problems to be processed by problem number
- Automatically write the Notebook outputs to a zip file
- Automatically combine the PDF outputs to a single PDF file
- Refactor the processing loop to avoid creating the
FilesWriteron every iteration
Fixed
- Fix warnings about docstrings
- Fix that paths must be resolved to be processed
- Fix typos in docstrings
- Specify that the
long_descriptioncontent for PyPI is Markdown formatted
0.1.0 - 2018-JUL-29
Added
- Convert Jupyter Notebook to PDF with and without solutions
- Convert Jupyter Notebook to a set of Notebooks, with and without solutions
- README with instructions for use
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thermohw-0.7.1.tar.gz.
File metadata
- Download URL: thermohw-0.7.1.tar.gz
- Upload date:
- Size: 20.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e3fd691177fd0d2fe639b4bafabdaae16c48cfb697b523dcc0dc9a077e721e7
|
|
| MD5 |
1928a78c4e7159dfbaf477698dc29ae4
|
|
| BLAKE2b-256 |
ed2fb010f190d5caee3e3858a4ebf3c9c02f8d9822fccc0bfec8cedb7dde1e0d
|
File details
Details for the file thermohw-0.7.1-py3-none-any.whl.
File metadata
- Download URL: thermohw-0.7.1-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85a4f1bb50ef380072c8481b14303470a419c922ba88337aea98d580b495723f
|
|
| MD5 |
9dc9dc6559066b81bd17666d39a2ac29
|
|
| BLAKE2b-256 |
452c916ca4299cc51aae8422808abbe298294d3246cce0c58e28768db9aac0a5
|