This repository holds sample Jupyter notebooks and associated data for the Rexl project.
We will publish releases of the Rexl sample notebooks (and data) here in GitHub.
A release consists of a .zip file containing the notebooks and data. To use:
- Ensure that a release of the
RexlKernelhas been properly installed, as described in the Rexl README. - Download the
RexlSampleNotebooks.zipfile. - Extract the contents of the
.zipto a folder. - Open a command line shell and
cdinto the extracted folder. - Run
jupyter lab. - In Jupyter Lab, you should see directories named
notebooksanddata, containing the sample notebooks and data. You should also see an icon for creating a newRexlnotebook.
The samples directory contains the directories
The notebooks directory contains Jupyter notebook files. To run the notebooks, ensure that Jupyter is properly installed and that the Rexl kernel is built and registered.
The Jupyter notebook files include:
- NFL.ipynb: demonstrates some tabular data manipulation using NFL game data.
- Comma.ipynb: discusses the implicit lambda pattern and why Rexl doesn't
need an analog of Excel's
SUMPRODUCTfunction. - ImageAsTensor.ipynb: Illustrates representing images as tensors and performing some basic transformation.
- ImageClassification.ipynb: Illustrates using some ONNX models from Rexl to classify images.
- ProteinFolding.ipynb: Illustrates a protein folding optimization problem formulated as a Rexl module. Solves using three integrated MIP solvers, Gurobi (requires license), HiGHS, and GLPK.
- EssentialMedicines.ipynb: Uses Rexl module functionality to formulate an essential medicines optimization problem. Rexl dispatches to the Gurobi solver (requires license from Gurobi) to perfom the optimization.
- HoneycombPuzzleSat.ipynb: Illustrates using the SAT (boolean satisfiability) solver to find solutions to a tricky geometric puzzle.
- SudokuSat.ipynb: Uses the Rexl SAT solver to solve Sudoku puzzles.
- SudokuMip.ipynb and SudokuMipEq.ipynb: These use Rexl module functionality and MIP solver integration to solve Sudoku puzzles.
The data directory contains data files of various forms used in the sample notebooks. Some of the files are Rexl scripts that define one or more global symbols. Other files may be binary data files (such as parquet or rbin files) or images (jpg, png) or just about anything.
The data files include:
- NFL-2010-Games.rexl:
A RexlScript file that defines a global named
Gamescontaining data for the NFL games played during the 2010 regular season. - Orders.rexl: A RexlScript file
that defines a global named
Orderscontaining (fictitious) data for customer orders. - ChemNodes.rbin and ReacNodes.rbin: These are the tables needed for the EssentialMedicines.ipynb notebook.
- HoneycombPuzzlePieces.jpeg and HoneycombPuzzleSolution.jpeg: These are images used in the HoneycombPuzzleSat.ipynb notebook.
- HoneycombPuzzleSlns.rbin: This contains the solutions generated by the HoneycombPuzzleSat.ipynb notebook.
Note: when adding a new kind of data file that should use LFS (large file storage), ensure that the
.gitattributes file has an entry for the extension.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.