Mathy has several different python projects inside the
Each project contains a
tools folder with a set of bash scripts inside for configuring and executing the tasks related to a specific project.
Each project must have at least the following:
setup.shdoes any setup such as creating virtual-environments or installing node modules
build.shbuilds any output assets such as python
test.shexecutes any tests such as with
pytestfor Python or
Mathy can either build everything or specific sub-projects.
From the root folder, run the
tools/setup.sh script, which will install the pre-requisites for all projects in the
From the root folder, change directories into the desired project folder, e.g.
From the project folder, run the setup script:
Use your local version of Mathy¶
You can install the Mathy python package from the file system:
pip install -e ./libraries/mathy_python
Then use the mathy CLI directly:
mathy simplify "4x + 2y + 6x"
If you know that you want to make a code contribution or make significant changes to the documentation site, there are bash scripts that set up and build the various parts of Mathy.
Untested with Windows.
bash scripts to set up and build its various projects. Running on windows may be complicated by this, but the scripts are simple enough to be ported.
If you are interested in doing this work, open an issue here or submit a PR.
The documentation uses MkDocs.
All the documentation is in Markdown format in the directory
Many of the pages include blocks of code that are complete, runnable applications that live in the
Docs for tests¶
All of the inline python snippets double as tests run with each website build. This helps ensure that:
- The documentation is up to date.
- The documentation examples can be run as-is.
- The documentation examples can be launched in Colab.
After executing the test snippets, we convert each file to an iPython notebook and an "Open in Colab" badge is inserted near the snippet.
Having a one-click option for running code snippets allows users to launch into examples and run them directly from their browser.
During local development, there is a script that builds the site and checks for any changes, live-reloading:
cd libraries/website sh tools/develop.sh
It will serve the documentation on
That way, you can edit the documentation/source files and see the changes live.
There is a script that you can run locally to test all the code and generate coverage reports in HTML.
From the root folder, run:
This command generates a directory
./htmlcov/. If you open the file
./htmlcov/index.html in your browser, you can interactively explore the regions of code covered by test execution.