Skip to content

Commit

Permalink
Merge pull request #2 from factryflow/feature/setup-poetry
Browse files Browse the repository at this point in the history
switched to Poetry and big refactor
  • Loading branch information
Yacobolo authored Feb 13, 2024
2 parents e22298e + 4f915ee commit 4cbef43
Show file tree
Hide file tree
Showing 34 changed files with 3,012 additions and 3,726 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push, pull_request, workflow_dispatch]
on: [pull_request]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build distribution

on: [push, pull_request]
on: [pull_request]

jobs:
test:
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test:
poetry run pytest
File renamed without changes.
478 changes: 333 additions & 145 deletions docs/example.ipynb

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ⚙️ factryengine

`factryengine` is a high-speed Python package for effortless and efficient task scheduling, specifically tailored for production scheduling. Built with `numpy`, it ensures tasks are executed in the correct order while considering their priorities, resources, and dependencies.

## 🛠 Installation

Install `factryengine` with a simple pip command:

```bash
pip install factryengine
```

## 🌟 Features

- **Fast Performance**: Built with `numpy` for high-speed task scheduling.
- **Production Scheduling**: Specifically designed for seamless production scheduling.
- **Simple Task Creation**: Easily define tasks with attributes like duration, priority, and resources.
- **Resource Management**: Assign resources with availability windows to tasks.
- **Task Dependencies**: Ensure tasks that depend on others are scheduled in the correct order.
- **Efficient Scheduling**: Automatically schedule tasks while considering their priorities and dependencies.

## 🚀 Quick Start

Get started with `factryengine` with this basic example:

```python
from factryengine import Task, Resource, Scheduler

# Creating a Resource object
resource = Resource(id=1, available_windows=[(0,10)])

# Creating Task objects
task1 = Task(id=1, duration=3, priority=2, resources=[[resource]])
task2 = Task(id=2, duration=5, priority=1, resources=[[resource]], predecessors=[task1])

# Creating a Scheduler object and scheduling the tasks
scheduler = Scheduler(tasks=[task1, task2])
scheduler_result = scheduler.schedule()
```

In this example, `task1` is scheduled before `task2` as `task2` depends on `task1`, despite its lower priority.

## 📖 Documentation

For more detailed information, check out the [documentation](https://yacobolo.github.io/factryengine/).

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

## 📝 License

This project is [MIT](link_to_license) licensed.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repo_url: https://github.com/Yacobolo/factryengine
repo_name: factryengine

nav:
- Home: README.md
- Home: index.md
- Usage: usage.md
- Example: example.ipynb

Expand Down
1,479 changes: 1,479 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tool.poetry]
name = "factryengine"
version = "0.0.0"
description = "production / job shop / resource scheduler for Python"
authors = ["Jacob Østergaard Nielsen <jacob.oestergaard.nielsen@gmail.com>"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
pandas = "^2.1.4"
seaborn = "^0.13.1"
networkx = "^3.2.1"
pydantic = "^2.5.3"


[tool.poetry.group.dev.dependencies]
pytest = "^7.4.4"
ipykernel = "^6.28.0"


[tool.poetry-dynamic-versioning]
enable = true
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.ruff]
ignore-init-module-imports = true
6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

21 changes: 0 additions & 21 deletions setup.cfg

This file was deleted.

35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

13 changes: 8 additions & 5 deletions src/factryengine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from .models.resource import Resource # noqa: F401
from .models.task import Task # noqa: F401
from .scheduler.core import Scheduler # noqa: F401
import warnings

from . import _version
__version__ = _version.get_versions()['version']
import numpy as np

from .models import Assignment, Resource, ResourceGroup, Task
from .scheduler.core import Scheduler

# Ignore numpy's UserWarning
warnings.filterwarnings("ignore", category=UserWarning, module="numpy.*")
Loading

0 comments on commit 4cbef43

Please sign in to comment.