Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
Bancie committed Aug 28, 2024
2 parents 3fe2d7d + e24729c commit 03a6eb3
Show file tree
Hide file tree
Showing 591 changed files with 570 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ hide:
- navigation
- toc
---
# About us
# About me
102 changes: 102 additions & 0 deletions docs/api-reference/in-job/i-job.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
hide:
- navigation
---
# tilearn.show_mytime

!!! info
For a more in-depth understanding of the concept, you can check [here](../../user-guide/single-machine/completion/index.md#the-total-weighted-completion-time--show_mytime).

## tilearn.<span style="color:#ffde59;">show_mytime</span>(*list, due date*)

- **Paramenter:**

- **list: list or an array, that holds the job table data.**

Each element in this collection should represent a job name, including relevant attributes such as job ID, quantity, release time, due date, and priority. These attributes are necessary for scheduling the jobs. See [notes](#notes) for a more detailed explanation of which elements in the array need to be used.

- **due date : deadline by which all jobs in the provided list need to be completed.**

It represents a specific date and time and is crucial for scheduling purposes. The function will use this date to determine whether each job can be completed on time or if adjustments need to be made to meet this deadline. The due date should be formatted correctly to ensure accurate comparisons and calculations within the function.

### Notes

The list is a key function that displays your job data.

See the example below for more details:

<figure markdown="span">
![alt text](job-light.png#only-dark){ width="400" }
![alt text](job-dark.png#only-light){ width="400" }
<figcaption>List example.</figcaption>
</figure>

Explanation:

<table>
<thead>
<tr>
<th style="width: 200px; text-align: center;">Column position</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">The first column</td>
<td>Indicates the job name.</td>
</tr>
<tr>
<td style="text-align: center;">The second column</td>
<td>Displays the quantity required to complete each job. For example, Job 1 requires 12 units to be finished. The unit type is not crucial; it is up to your discretion and it simply serves as a value for determining how weighty the job is. (e.g. 12 <em>minutes</em>, 12 <em>pages</em> for reading,...)</td>
</tr>
<tr>
<td style="text-align: center;">The third column</td>
<td>Details the release time of each job. For example, Job 1 is released on day 0.</td>
</tr>
<tr>
<td style="text-align: center;">The fourth column</td>
<td>Specifies the due date of each job. For example, Job 1 is due on day 30.</td>
</tr>
<tr>
<td style="text-align: center;">The last column</td>
<td>Exhibits the job’s weight (representing job’s priority value, you can assign weight values from 1 to 3 or 1 to 10, based on your judgment). The higher the priority value, the more important it is, if all jobs have equal priority, their weights would be 1. For example, the priority of Job 1 is 2.</td>
</tr>
</tbody>
</table>

### Examples
Code Implementation:

```py
import tilearn as tl

data = [['Job 1', 4, 0, 10, 1], ['Job 2', 9, 0, 10, 3], ['Job 3', 6, 0, 10, 2], ['Job 4', 7, 0, 10, 3], ['Job 5', 4, 0, 10, 2], ['Job 6', 5, 0, 10, 1], ['Job 7', 8, 0, 10, 3], ['Job 8', 3, 0, 10, 1], ['Job 9', 2, 0, 10, 1], ['Job 10', 6, 0, 10, 2]]

print(tl.show_mytime(data, 10))
```
*Output:*
```output
[['Job 5', 4, 0, 10, 2, 0.7407407407407407, 2.7], ['Job 9', 2, 0, 10, 1, 0.37037037037037035, 2.7], ['Job 4', 7, 0, 10, 3, 1.2962962962962963, 2.3142857142857145], ['Job 7', 8, 0, 10, 3, 1.4814814814814814, 2.025], ['Job 2', 9, 0, 10, 3, 1.6666666666666667, 1.7999999999999998], ['Job 3', 6, 0, 10, 2, 1.1111111111111112, 1.7999999999999998], ['Job 8', 3, 0, 10, 1, 0.5555555555555556, 1.7999999999999998], ['Job 10', 6, 0, 10, 2, 1.1111111111111112, 1.7999999999999998], ['Job 1', 4, 0, 10, 1, 0.7407407407407407, 1.35], ['Job 6', 5, 0, 10, 1, 0.9259259259259259, 1.08]]
```

To make the output more readable, you can adjust your code as shown below:

```py
schedule = tl.show_mytime(data, 10)

for row in schedule:
print(row)
```
*Output:*
```output
['Job 5', 4, 0, 10, 2, 0.7407407407407407, 2.7]
['Job 9', 2, 0, 10, 1, 0.37037037037037035, 2.7]
['Job 4', 7, 0, 10, 3, 1.2962962962962963, 2.3142857142857145]
['Job 7', 8, 0, 10, 3, 1.4814814814814814, 2.025]
['Job 2', 9, 0, 10, 3, 1.6666666666666667, 1.7999999999999998]
['Job 3', 6, 0, 10, 2, 1.1111111111111112, 1.7999999999999998]
['Job 8', 3, 0, 10, 1, 0.5555555555555556, 1.7999999999999998]
['Job 10', 6, 0, 10, 2, 1.1111111111111112, 1.7999999999999998]
['Job 1', 4, 0, 10, 1, 0.7407407407407407, 1.35]
['Job 6', 5, 0, 10, 1, 0.9259259259259259, 1.08]
```
Binary file added docs/api-reference/in-job/job-dark.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 docs/api-reference/in-job/job-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
hide:
- navigation
- toc
---
# TiLearn reference

!!! info
- Release: 0.0.12
- Date: August 27, 2024

This reference manual offers an extensive overview of the functions, modules, and objects available in TiLearn. Each section thoroughly explains the components, including their definitions, functionalities, and practical applications within the library.

By exploring this manual, users can gain a clear understanding of how to utilize these elements effectively in their projects. For a more in-depth exploration of the underlying concepts and advanced usage examples, please refer to the [full tutorial](../user-guide/index.md).

## Python API
- [The Total (Weighted) Completion Time](#python-api)
- [Independence jobs (``show_mytime``)](in-job/i-job.md#tilearnshow_mytimelist-due-date)

## Acknowledgements

Significant portions of this manual are based on foundational texts in the field, including "Single Machine Scheduling" by Le Minh Huy and "Scheduling: Theory, Algorithms, and Systems" by Michael Pinedo. These sources provide the theoretical background and algorithms that underpin many of the scheduling concepts presented here.

The reference documentation within this manual, detailing the various functions, modules, and objects available in TiLearn, has been meticulously developed by the contributors and developers of TiLearn. Each entry has been carefully written to provide [comprehensive explanations](../user-guide/index.md), practical examples, and insights into how to effectively utilize these components within scheduling and optimization projects. For more advanced topics and extended examples, users are encouraged to consult the [full references](../getting-started/index.md#references).
6 changes: 0 additions & 6 deletions docs/api/index.md

This file was deleted.

File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ hide:

<ol class="circle-list">
<li>
<strong><a href="start/">Getting started</a></strong><br>
<strong><a href="getting-started/">Getting started</a></strong><br>
<p class="list-item-content">This document provides an overview of project content and the generalization of the various problems it addresses.</p>
</li>
<br>
<li>
<strong><a href="how/">Tutorials</a></strong><br>
<strong><a href="user-guide/">User Guide</a></strong><br>
<p class="list-item-content">This document categorizes all the problems, detailing their foundational concepts, relevant materials, and solutions.</p>
</li>
<br>
<li>
<!-- <li>
<strong><a href="run/">Building from source</a></strong><br>
<p class="list-item-content">This document offers a concise guide to running the code from the source, explaining its core functionality and how it can be applied to solve various problems.</p>
</li>
<br>
<br> -->
<li>
<strong><a href="api/">API reference</a></strong><br>
<strong><a href="api-reference/">API reference</a></strong><br>
<p class="list-item-content">This section details API endpoints, usage, parameters, and responses for effective integration.</p>
</li>
</ol>
Expand Down
8 changes: 8 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,12 @@ ol.circle-list.alternating-colors li:nth-child(even)::before {
background: linear-gradient(to right, #4050b5, #448ba2); /* Blue to Cyan gradient */
margin: 45px auto; /* Space around the separator */
width: 100%; /* Full width */
}

pre {
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Firefox */
white-space: -pre-wrap; /* Opera <7 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE */
}
2 changes: 1 addition & 1 deletion docs/how/index.md → docs/user-guide/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How it works
# User Guide
- The Maximum Lateness $\big(L_{\max}\big)$
- Independence jobs $\big(1 \: | \: \: | \: L_{\max}\big)$
- Release jobs $\big(1 \: | \: r_j \: | \: L_{\max}\big)$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# The Total Weighted Completion Time $\big(\sum w_j C_j\big)$
# The Total Weighted Completion Time $\big(\sum w_j C_j\big)$ [(``show_mytime``)](../../../api-reference/in-job/i-job.md)

## What is the main goal?

- Another optimal approach in single machine scheduling is the **Shortest Process Time (SPT)** algorithm and the **Weighted Shortest Process Time (WSPT)** algorithm.
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 14 additions & 10 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ site_author: Bancie

nav:
- Home: index.md
- Getting started: start/index.md
- Tutorials:
- how/index.md
- Getting started: getting-started/index.md
- User Guide:
- user-guide/index.md
- Single Machine:
- Maximum Lateness:
- how/single-machine/lateness/index.md
- Release jobs: how/single-machine/lateness/release.md
- user-guide/single-machine/lateness/index.md
- Release jobs: user-guide/single-machine/lateness/release.md
- Total Completion Time:
- how/single-machine/completion/index.md
- Sequence jobs: how/single-machine/completion/sequence.md
- Release jobs: how/single-machine/completion/release.md
- Building from source: run/index.md
- API reference: api/index.md
- user-guide/single-machine/completion/index.md
- Sequence jobs: user-guide/single-machine/completion/sequence.md
- Release jobs: user-guide/single-machine/completion/release.md
#- Building from source: run/index.md
- API reference:
- api-reference/index.md
- tilearn.show_mytime: api-reference/in-job/i-job.md
- About: about.md

plugins:
- glightbox
- search: {}
- encryptcontent:
title_prefix: ''
Expand Down Expand Up @@ -84,6 +87,7 @@ theme:
quote: fontawesome/solid/quote-left

markdown_extensions:
- md_in_html
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ setuptools
twine
mkdocs
mkdocs-material
mkdocs-encryptcontent-plugin
mkdocs-encryptcontent-plugin
mkdocs-glightbox
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Blueswen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Metadata-Version: 2.1
Name: mkdocs-glightbox
Version: 0.4.0
Summary: MkDocs plugin supports image lightbox with GLightbox.
Home-page: https://blueswen.github.io/mkdocs-glightbox
Author: Blueswen
Author-email: [email protected]
License: MIT
Project-URL: Source, https://github.com/Blueswen/mkdocs-glightbox
Keywords: mkdocs,plugin,lightbox
Platform: UNKNOWN
Description-Content-Type: text/markdown
License-File: LICENSE

# MkDocs GLightbox

<p align="center">
<a target="_blank" href="https://pypi.org/project/mkdocs-glightbox"><img src="https://img.shields.io/pypi/v/mkdocs-glightbox.svg" alt="PyPI version"/></a>
<a target="_blank" href="https://pypi.org/project/mkdocs-glightbox"><img src="https://img.shields.io/pypi/dm/mkdocs-glightbox.svg" alt="PyPI downloads"/></a>
<a target="_blank" href="https://codecov.io/gh/blueswen/mkdocs-glightbox"><img src="https://codecov.io/gh/blueswen/mkdocs-glightbox/branch/main/graph/badge.svg?token=KAJS3NU81H" alt="Codecov"/></a>
</p>

A MkDocs plugin supports image lightbox with [GLightbox](https://github.com/biati-digital/glightbox).

GLightbox is a pure javascript lightbox library with mobile support.

[Live demo](https://blueswen.github.io/mkdocs-glightbox/) with [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).

## Dependency

1. GLightbox javascript file and CSS file
1. GLightbox==3.2.0

## Usage

1. Install the plugin from PyPI

```bash
pip install mkdocs-glightbox
```

2. Add ```glightbox``` plugin to your mkdocs.yml plugins sections:

```yaml
plugins:
- glightbox
```

3. All images will be added to the lightbox effect automatically, except images in an anchor tag and emoji images from [pymdown-extensions](https://facelessuser.github.io/pymdown-extensions/extensions/emoji/).

4. You may customize the plugin by passing options in mkdocs.yml:

```yaml
plugins:
- glightbox:
touchNavigation: true
loop: false
effect: zoom
slide_effect: slide
width: 100%
height: auto
zoomable: true
draggable: true
skip_classes:
- custom-skip-class-name
auto_caption: false
caption_position: bottom
background: white
shadow: true
manual: false
```

| Option | Default | Description |
|---|---|---|
| touchNavigation | true | Enable or disable the touch navigation (swipe). |
| loop | false | Loop slides on end. |
| effect | zoom | Name of the effect on lightbox open. (zoom, fade, none) |
| slide_effect | slide | Name of the effect on lightbox slide. (slide, zoom, fade, none) |
| width | auto | Width for inline elements and iframes. You can use any unit for example 90% or 100vw for full width. |
| height | auto | Height for inline elements and iframes. You can use any unit for example 90%, 100vh or auto. |
| zoomable | true | Enable or disable zoomable images. |
| draggable | true | Enable or disable mouse drag to go prev and next slide. |
| skip_classes | [ ] | Disable lightbox of those image with specific custom class name. |
| auto_caption | false | Enable or disable using alt of image as caption title automatically. |
| caption_position | bottom | Default captions position. (bottom, top, left, right) |
| background | white | The background CSS of lightbox image. The background will shown when the image is transparent. You can use any CSS value for the background for example `#74b9ff` or `Gainsboro` or `none` for nothing. |
| shadow | true | Enable or disable the shadow of lightbox image. Disable it when the background is `none` to prevent shadow around the transparent image. |
| manual | false | When true, lightbox has to be enabled for each image manually by adding `on-glb` class to it or adding `glightbox: true` meta on page. |

Check more options information on [GLightbox Docs](https://github.com/biati-digital/glightbox#lightbox-options).

5. For more flexibility:
1. [Disable by image](https://blueswen.github.io/mkdocs-glightbox/flexibility/disable-by-image.md): Disable the lightbox for specific images. Suitable for a few amount of images that don't need the lightbox effect.
2. [Disable by page](https://blueswen.github.io/mkdocs-glightbox/flexibility/disable-by-page.md): Disable the lightbox for specific pages. Suitable for a few amount of pages that don't need the lightbox effect.
3. [Enable by image](https://blueswen.github.io/mkdocs-glightbox/flexibility/disable-by-page-enable-by-image.md): Disable the lightbox for specific pages but enable some images on those pages. Suitable for a few amount of images that need the lightbox effect.
4. [Disable globally but enable by image or page](https://blueswen.github.io/mkdocs-glightbox/flexibility/enable-by-image-or-page.md): Disable the lightbox globally but enable specific images or specific pages. Suitable for a large number of images or pages that don't need the lightbox effect.
6. Support lightbox image caption, check more details on [Caption](https://blueswen.github.io/mkdocs-glightbox/caption/caption/).
7. Support grouping images as galleries, check more details on [Gallery](https://blueswen.github.io/mkdocs-glightbox/gallery/gallery/).

> [!NOTE]
> If this is your first time using the MkDocs plugin feature, you should know that MkDocs includes a default plugin named `search`. If you want to keep the search feature, you need to add the `search` plugin back to the `plugins` list.

## How it works

1. Copy GLightbox script file into `site/assets/javascripts/` directory and CSS file into `site/assets/stylesheets/` directory
2. Import GLightbox script and CSS file and add javascript code on each page excluded disabled pages
3. Search all image tags and warp with an anchor tag for GLightbox excluded images with skip class or already warped with an anchor tag

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/Blueswen/mkdocs-glightbox/blob/main/LICENSE) file for details.


Loading

0 comments on commit 03a6eb3

Please sign in to comment.