Skip to content

Commit

Permalink
Commit changes to jupyter-book
Browse files Browse the repository at this point in the history
  • Loading branch information
kithminrw committed May 6, 2024
1 parent 3918f12 commit a780672
Show file tree
Hide file tree
Showing 10 changed files with 318 additions and 114 deletions.
37 changes: 18 additions & 19 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Collection of notes on {ml.nn-zero2hero}
author: Kithmin Wickremasinghe
logo: media/logo.png
exclude_patterns: [.DS_Store, "**.ipynb_checkpoints", "**.pytest_cache", "tools"]

# Launch on Google Colab button
launch_buttons:
notebook_interface: "classic"
colab_url: "https://colab.research.google.com"

# only build files that appear in toc
only_build_toc_files: true
title: My sample book
author: The Jupyter Book Community
logo: logo.png

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: off
execute_notebooks: force

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Information about where it exists on the web
# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# Information about where the book exists on the web
repository:
url: https://github.com/kithminrw/ml-nn-zero2hero/ # Online location
branch: main # Which branch of the repository should be used when creating links (optional)

url: https://github.com/executablebooks/jupyter-book # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root
branch: master # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
use_multitoc_numbering: false
google_analytics_id: G-DVQ7NZ8CYZ
47 changes: 5 additions & 42 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,9 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro.md
root: intro
chapters:
- file: notebooks/01/01.md
sections:
- file: notebooks/01/NB_1_1.ipynb

- file: notebooks/02/02.md
sections:
- file: notebooks/02/NB_2_1.ipynb

- file: notebooks/03/03.md
sections:
- file: notebooks/03/NB_3_1.ipynb

- file: notebooks/04/04.md
sections:
- file: notebooks/04/NB_4_1.ipynb

- file: notebooks/05/05.md
sections:
- file: notebooks/05/NB_5_1.ipynb

- file: notebooks/06/06.md
sections:
- file: notebooks/06/NB_6_1.ipynb

- file: notebooks/07/07.md
sections:
- file: notebooks/07/NB_7_1.ipynb

- file: notebooks/08/08.md
sections:
- file: notebooks/08/NB_8_1.ipynb

- file: notebooks/09/09.md
sections:
- file: notebooks/09/NB_9_1.ipynb

- file: notebooks/10/10.md
sections:
- file: notebooks/10/NB_10_1.ipynb

- file: genindex.md
- file: markdown
- file: notebooks
- file: markdown-notebooks
57 changes: 7 additions & 50 deletions intro.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,11 @@
# Hands-On Mathematical Optimization with Python
# Welcome to your Jupyter Book

Welcome to this repository of companion notebooks for the book *Hands-On Mathematical Optimization with Python*, which will be published by Cambridge University press in 2024. This book introduces the concepts and tools of mathematical optimization with examples from a range of disciplines. The goals of these companion notebooks are to:
This is a small sample book to give you a feel for how book content is
structured.
It shows off a few of the major file types, as well as some sample content.
It does not go in-depth into any particular topic - check out [the Jupyter Book documentation](https://jupyterbook.org) for more information.

* Provide a foundation for hands-on learning of mathematical optimization,
* Demonstrate the tools and concepts of optimization with practical examples,
* Help readers to develop the practical skills needed to build models and solving problem using state-of-the-art modeling languages and solvers.

## Getting started

The notebooks in this repository make extensive use of [Pyomo](https://en.wikipedia.org/wiki/Pyomo) which is a complete and versatile mathematical optimization package for the Python ecosystem. Pyomo provides a means to build models for optimization using the concepts of decision variables, constraints, and objectives from mathematical optimization, then transform and generate solutions using open source or commercial solvers.

All notebooks in this repository can be opened and run in Google Colab. A launch icon appearing at the top of a page (look for the rocket) indicates the notebook can be opened as an executable document. Selecting Colab will reopen the notebook in Google Colab. Cells inside the notebooks will perform any necessary installations of Pyomo and solvers needed to execute the code within the notebook.

Start your journey with the [first chapter](/notebooks/01/01.00.md)!

## Help us!

We seek your feedback! If you encounter an issue or have suggestions on how to make these examples better, please open an issue using the link at the top of every page (look for the Github cat icon).

## About Us

We are a group of researchers and educators who came together with a common purpose of developing materials for use in our classroom teaching. Hopefully, these materials will find use in other classrooms and, most importantly, by those seeking entry into the world of building optimization models for data-rich applications.

* Krzysztof Postek, Boston Consulting Group (formerly TU Delft)
* Alessandro Zocca, VU Amsterdam
* Joaquim Gromicho, ORTEC and the University of Amsterdam
* Jeffrey Kantor, University of Notre Dame

## Citation

If you wish to cite this work, please use

```
@book{PZGK2024book,
author = {Postek, Krzysztof and Zocca, Alessandro and Gromicho, Joaquim and Kantor, Jeffrey},
title = {{Hands-On Mathematical Optimization with Python}},
year = {2024},
publisher = {Cambridge University Press}
}
```

and
Check out the content pages bundled with this sample book to see more.

```{tableofcontents}
```
@online{PZGK2024online,
author = {Postek, Krzysztof and Zocca, Alessandro and Gromicho, Joaquim and Kantor, Jeffrey},
title = {Companion Jupyter Book for {``Hands-On Mathematical Optimization with Python’’}},
year = {2024},
publisher = {GitHub},
howpublished = {\url{https://github.com/mobook/MO-book}},
note = {Textbook to be published by Cambridge University Press},
}
```
53 changes: 53 additions & 0 deletions markdown-notebooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.5
kernelspec:
display_name: Python 3
language: python
name: python3
---

# Notebooks with MyST Markdown

Jupyter Book also lets you write text-based notebooks using MyST Markdown.
See [the Notebooks with MyST Markdown documentation](https://jupyterbook.org/file-types/myst-notebooks.html) for more detailed instructions.
This page shows off a notebook written in MyST Markdown.

## An example cell

With MyST Markdown, you can define code cells with a directive like so:

```{code-cell}
print(2 + 2)
```

When your book is built, the contents of any `{code-cell}` blocks will be
executed with your default Jupyter kernel, and their outputs will be displayed
in-line with the rest of your content.

```{seealso}
Jupyter Book uses [Jupytext](https://jupytext.readthedocs.io/en/latest/) to convert text-based files to notebooks, and can support [many other text-based notebook files](https://jupyterbook.org/file-types/jupytext.html).
```

## Create a notebook with MyST Markdown

MyST Markdown notebooks are defined by two things:

1. YAML metadata that is needed to understand if / how it should convert text files to notebooks (including information about the kernel needed).
See the YAML at the top of this page for example.
2. The presence of `{code-cell}` directives, which will be executed with your book.

That's all that is needed to get started!

## Quickly add YAML metadata for MyST Notebooks

If you have a markdown file and you'd like to quickly add YAML metadata to it, so that Jupyter Book will treat it as a MyST Markdown Notebook, run the following command:

```
jupyter-book myst init path/to/markdownfile.md
```
55 changes: 55 additions & 0 deletions markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Markdown Files

Whether you write your book's content in Jupyter Notebooks (`.ipynb`) or
in regular markdown files (`.md`), you'll write in the same flavor of markdown
called **MyST Markdown**.
This is a simple file to help you get started and show off some syntax.

## What is MyST?

MyST stands for "Markedly Structured Text". It
is a slight variation on a flavor of markdown called "CommonMark" markdown,
with small syntax extensions to allow you to write **roles** and **directives**
in the Sphinx ecosystem.

For more about MyST, see [the MyST Markdown Overview](https://jupyterbook.org/content/myst.html).

## Sample Roles and Directives

Roles and directives are two of the most powerful tools in Jupyter Book. They
are like functions, but written in a markup language. They both
serve a similar purpose, but **roles are written in one line**, whereas
**directives span many lines**. They both accept different kinds of inputs,
and what they do with those inputs depends on the specific role or directive
that is being called.

Here is a "note" directive:

```{note}
Here is a note
```

It will be rendered in a special box when you build your book.

Here is an inline directive to refer to a document: {doc}`markdown-notebooks`.


## Citations

You can also cite references that are stored in a `bibtex` file. For example,
the following syntax: `` {cite}`holdgraf_evidence_2014` `` will render like
this: {cite}`holdgraf_evidence_2014`.

Moreover, you can insert a bibliography into your page with this syntax:
The `{bibliography}` directive must be used for all the `{cite}` roles to
render properly.
For example, if the references for your book are stored in `references.bib`,
then the bibliography is inserted with:

```{bibliography}
```

## Learn more

This is just a simple starter to get you started.
You can learn a lot more at [jupyterbook.org](https://jupyterbook.org).
Binary file modified media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/logo_nn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a780672

Please sign in to comment.