From d102b5ae654301a9b5e08a18279341e29001d2eb Mon Sep 17 00:00:00 2001 From: Tom Schierenbeck Date: Tue, 18 Jun 2024 15:17:01 +0200 Subject: [PATCH] Somehow thje code in quickstart.md is not working :( --- book/_config.yml | 4 ++-- book/quickstart.md | 36 ++++++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/book/_config.yml b/book/_config.yml index dea80da..06e951f 100644 --- a/book/_config.yml +++ b/book/_config.yml @@ -26,8 +26,8 @@ bibtex_bibfiles: # Information about where the book exists on the web repository: - url: https://github.com/tomsch420/Random Events # Online location of your book - path_to_book: docs # Optional path to your book, relative to the repository root + url: https://github.com/tomsch420/random_events/ # Online location of your book + path_to_book: book # Optional path to your book, relative to the repository root branch: main # Which branch of the repository should be used when creating links (optional) # Add GitHub buttons to your book diff --git a/book/quickstart.md b/book/quickstart.md index 732207f..682dfce 100644 --- a/book/quickstart.md +++ b/book/quickstart.md @@ -3,46 +3,66 @@ This is a quickstart guide to get you up and running with the `random_events` li ## Installation -To install the library, run the following command: +To install the library, run the following command -[//]: # (```bash) - -[//]: # (pip install random_events) - -[//]: # (```) Next, import the necessary functionality: ```{code-cell} ipython3 + :tags: [] + + from random_events.variable import Symbolic, Continuous + from random_events.product_algebra import SimpleEvent, Event + from random_events.interval import SimpleInterval, Interval, closed, closed_open + from random_events.set import SetElement, Set + import plotly + import plotly.graph_objects as go + plotly.offline.init_notebook_mode() -```` + +``` + ## Intervals + Intervals are a fundamental concept in the `random_events` library. + They are used to represent the range of possible values that a variable can take. + There are two classes to interact with intervals: `SimpleInterval` and `Interval`. + However, it is **strongly recommended** to use the `Interval` class, + as it provides an API implementing all set operations. + First, create two simple intervals: + ```{code-cell} ipython3 + :tags: [] + + si1 = SimpleInterval(0, 1) + si2 = SimpleInterval(0.5, 1.5) + si1, si2 -```` + +``` + ## Sets