Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add first example #28

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
20c9f43
add first example
wardvanbelle Dec 27, 2021
9ed0f2a
added auto static-export
wardvanbelle Jan 6, 2022
6ceb039
added files for fridge optimization project
wardvanbelle Jan 9, 2022
8f40093
added greedy search for fridge
wardvanbelle Jan 12, 2022
0502e0b
added some structure to fridge.jl and started on SA functions
wardvanbelle Jan 13, 2022
26dbf9b
Merge remote-tracking branch 'upstream/master'
wardvanbelle Jan 13, 2022
e99ed05
added objective function for recipe combination
wardvanbelle Jan 13, 2022
f4cf66d
added way to load recipeDB with JLD2
wardvanbelle Jan 13, 2022
c8ed44d
added neighbour function. Overview function is now working.
wardvanbelle Jan 15, 2022
3dec5af
fixed SA function
wardvanbelle Jan 15, 2022
2fb996d
fixed bug in greedy search where too much recipes got removed
wardvanbelle Jan 16, 2022
a7a49d2
added README and added module to Fridge.jl
wardvanbelle Jan 26, 2022
9cbfbac
docs test
wardvanbelle Jan 26, 2022
659408b
added documentation to all functions
wardvanbelle Jan 26, 2022
eac2756
added Documenter documents
wardvanbelle Jan 26, 2022
d888a27
added a logo and initiated notebook
wardvanbelle Jan 27, 2022
33af0ad
updated README
wardvanbelle Jan 27, 2022
254899c
add functions and explanation from src to Fridge notebook
wardvanbelle Jan 27, 2022
cc9be4d
forced push
wardvanbelle Jan 27, 2022
a00bf09
added more clarification to notebook
wardvanbelle Jan 27, 2022
ccbe8a2
finalized fridge notebook
wardvanbelle Jan 27, 2022
1c82da2
fixed bugs with documenter
wardvanbelle Jan 27, 2022
395e438
changed localResource to Resource in fridge notebook
wardvanbelle Jan 28, 2022
1bc0c78
created docs page
wardvanbelle Jan 29, 2022
bec2b9b
add link to documentation to readme
wardvanbelle Jan 29, 2022
cf7fd6e
trying Travis CI
wardvanbelle Jan 29, 2022
44ea75d
added CI
wardvanbelle Jan 30, 2022
5aa4902
further fixing the ci
wardvanbelle Jan 30, 2022
a68e0b3
CI fix part 1
wardvanbelle Jan 30, 2022
facece7
CI fix part 2
wardvanbelle Jan 30, 2022
c04972b
CI fix part 3
wardvanbelle Jan 30, 2022
bcfee5a
removed STMOZOO package and created an independent Fridge Package
wardvanbelle Jan 30, 2022
6472717
further fixing CI
wardvanbelle Jan 30, 2022
5a39f8a
further fixing CI part 20
wardvanbelle Jan 30, 2022
15b8a53
further fixing CI part 21
wardvanbelle Jan 30, 2022
de18a0a
fixing CI maybe
wardvanbelle Jan 30, 2022
af1f988
remove fridge.jl
wardvanbelle Jan 30, 2022
becfe42
add Fridge.jl
wardvanbelle Jan 30, 2022
826fb71
fix CI
wardvanbelle Jan 30, 2022
3817014
hopefully CI
wardvanbelle Jan 30, 2022
df495fb
add coverage to CI
wardvanbelle Jan 30, 2022
7889d07
improve CI
wardvanbelle Jan 30, 2022
39bb706
fix coveralls
wardvanbelle Jan 30, 2022
dcbb463
trying new CI
wardvanbelle Jan 30, 2022
1f54611
add github badges
wardvanbelle Jan 30, 2022
ae1871f
add tests for objective function and greedy search
wardvanbelle Jan 30, 2022
b13e043
added tests for RandomCombo
wardvanbelle Jan 30, 2022
5296c49
added tests for neighbour function
wardvanbelle Jan 30, 2022
e2f7398
greedy now only uses recipes that use fridge items
wardvanbelle Jan 31, 2022
af0fc59
added tests for SAFindCombo
wardvanbelle Jan 31, 2022
16e175c
added tests for the recipe webscraper
wardvanbelle Jan 31, 2022
ef144a2
fixed documentation of Neighbour function and randomCombo function
wardvanbelle Jan 31, 2022
499f940
remove instructions.md file
wardvanbelle Jan 31, 2022
3a7b0a0
fixed bug in notebook
wardvanbelle Jan 31, 2022
a6172b7
removed some small bugs and expanded tests
wardvanbelle Jan 31, 2022
3ce5282
temp
wardvanbelle Jan 31, 2022
3c42359
removed some small bugs and expanded tests
wardvanbelle Jan 31, 2022
c21a360
removed DB file
wardvanbelle Jan 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using Fridge
doctest(Fridge)' # change MYPACKAGE to the name of your package
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

# Large Data Files
data/*
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

Binary file added FridgeLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name = "STMOZOO"
uuid = "8e7dc78f-7190-4116-bf88-3d148ae9f088"
authors = ["michielstock <michielfmstock@gmail.com>"]
name = "Fridge"
uuid = "673b17d6-c7db-4caa-9a54-38a02eba0033"
authors = ["warvbell <wardvanbelle@gmail.com>"]
version = "0.1.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Cascadia = "54eefc05-d75b-58de-a785-1a3403f0919f"
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
# STMO-ZOO

Welcome to the STMO zoo! This is your final assignment for the course Selected Topics in Mathematical Optimization. Your goal is to implement an optimization method in Julia and contribute this to this repository. To pass, you have to:
# Fridge.jl
[![](https://img.shields.io/badge/docs-dev-blue)](https://wardvanbelle.github.io/Fridge.jl/dev) [![codecov](https://codecov.io/gh/wardvanbelle/Fridge.jl/branch/master/graph/badge.svg?token=GJ8JXBG5M1)](https://codecov.io/gh/wardvanbelle/Fridge.jl)\
\
<img align="right" width="150" height="150" src="FridgeLogo.png">
by <i>Ward Van Belle</i>

- fork this repo and create a pull request;
- add a module to `src` with **at least one function**
- add at least one unit test to the folder `test`;
- document all your functions and add a page to the documentation page;
- make a notebook in [Pluto](https://github.com/fonsp/Pluto.jl) and add it to `notebooks`;
- perform a small code review of two other students.
A package that optimizes your fridge use while reducing your waste pile!!

This package tries to find the best recipes for you based on a recipe database. In our eyes (and the eyes of the objective function), the best recipes are the ones that use as much ingredients from your fridge as possible and that don't need extra ingredients from the grocery store.

## How to use this package?
There are several ways for you to use this package.

1. First and foremost you should have a **recipe database**. This database should be a .csv file or a .jld2 file containing the recipe names in one column and a list containing the ingredient names in the next column. For instance:

| recipeName | Ingredients |
|:----------:|:-----------:|
| french fries| potatoes, salt|
| boiled eggs | eggs, salt|

2. If you just want to find an approximation of the best recipe combo. Then you can use the `greedyFindCombo` function. This performs a greedy search to find a quick solution. However, if you want a chance for a better solution, then you can use the `findBestRecipe` function. This function checks if your ingredients are in the database, and if not it offers possible alternatives. Next it uses **simulated annealing** to find a better recipe combination.

## Help I don't have a database (recipeWebscraper.jl)

Don't worry, we got you covered with `recipeWebscraper.jl`. This module includes a function that downloads recipes from [the cosylab recipe database](https://cosylab.iiitd.edu.in/recipedb/) based on their recipe number and exports them to a **.csv** file.

You can use the `scrapeRecipe` function for this. Using this method it is possible to download around 16 000 recipes before you get kicked from the site. Therefore it is recommended to look at the cuisine you would like to download and start from the earliest recipe number in this cuisine. Recipe numbers can be found by looking at the end of the url of a recipe page eg. [Belgian Chocolate Mousse](https://cosylab.iiitd.edu.in/recipedb/search_recipeInfo/106541) is the first Belgian recipe and has the recipe number **106541**.

Depending on the project you choose some of these individual assignments might be really minimalistic, with other parts larger. For example, if you want to develop an application, say solving the graph coloring problem with Tabu Search, you might have only a single function in the source code (e.g., generating an instance) but have a fairly large notebook with a tutorial. On the other hand, if you work on a method, e.g., implementing Bee Colony Optimization, you might have many functions in the source code, while your notebook is only a demonstration on the test functions.

[![Build Status](https://travis-ci.org/MichielStock/STMOZOO.svg?branch=master)](https://travis-ci.org/MichielStock/STMOZOO)[![Coverage Status](https://coveralls.io/repos/github/MichielStock/STMOZOO/badge.svg?branch=master)](https://coveralls.io/github/MichielStock/STMOZOO?branch=master)
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
STMOZOO = "8e7dc78f-7190-4116-bf88-3d148ae9f088"
20 changes: 10 additions & 10 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using Documenter

using STMOZOO
using STMOZOO.Example
using Fridge

makedocs(sitename="STMO ZOO",
makedocs(sitename="Fridge.jl",
format = Documenter.HTML(),
modules=[Example], # add your module
pages=Any[
"Example"=> "man/example.md", # add the page to your documentation
modules=[Fridge], # add your module
pages=[
"index.md",
"main function" => "mainFunction.md",
"search algorithms" => "searchAlgorithms.md",
"recipe webscraper"=> "recipeWebscraper.md",
])

#=
deploydocs(
repo = "github.com/michielstock/STMOZOO.jl.git",
)
=#
repo = "github.com/wardvanbelle/Fridge.jl",
)
Binary file added docs/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STMO ZOO documentation
# Fridge
by *Ward Van Belle*

This is the documentation page for the STMO ZOO packages (edition 2020-2021). This is the place for the **documentation**
of your function. So explain the main functionality of your module and list the documentation of your funtions.
This package tries to find the best recipes for you based on a recipe database. In our eyes (and the eyes of the objective function), the best recipes are the ones that use as much ingredients from your fridge as possible and that don't need extra ingredients from the grocery store.

```@contents
```
11 changes: 11 additions & 0 deletions docs/src/mainFunction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Overview Function

```@docs
findBestRecipe
```

This function checks the ingredients by using the `checkIngredients` function:

```@docs
checkIngredients
```
14 changes: 0 additions & 14 deletions docs/src/man/example.md

This file was deleted.

14 changes: 14 additions & 0 deletions docs/src/recipeWebscraper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```@docs

```


# recipeWebscraper

This is a supporting module that allows the user to download recipes from [the cosylab recipe database](https://cosylab.iiitd.edu.in/recipedb/) based on their recipe number and exports them to a **.csv** file.

## scrapeRecipe

```@docs
scrapeRecipe
```
22 changes: 22 additions & 0 deletions docs/src/searchAlgorithms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Search Algorithms

This page includes some more information on the two search methods used.

### Greedy Search

```@docs
greedyFindCombo
```

### Simulated Annealing

```@docs
SAFindCombo
```

### Neighbour Functions

```@docs
randomCombo
Neighbour
```
100 changes: 0 additions & 100 deletions instructions.md

This file was deleted.

Loading