From a87700519ff0f640f660ff0f7619874ca431df3d Mon Sep 17 00:00:00 2001 From: Niklas Heim Date: Thu, 21 Oct 2021 11:46:29 +0200 Subject: [PATCH] honza's fixes! :) --- docs/src/lecture_04/hw.md | 16 ++++++++-------- docs/src/lecture_04/lab.md | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/src/lecture_04/hw.md b/docs/src/lecture_04/hw.md index eb8b1a81..8950a32a 100644 --- a/docs/src/lecture_04/hw.md +++ b/docs/src/lecture_04/hw.md @@ -10,14 +10,14 @@ The autoeval system expects you to upload a `.zip` file of your `Ecosystem` with at least the following files ``` . -├── Ecosystem -│   ├── Project.toml -│   ├── src -│   │   └── Ecosystem.jl -│   └── test -│   ├── every_nth.jl -│   ├── mushroom.jl -│   └── runtests.jl +└── Ecosystem +    ├── Project.toml +    ├── src +    │   └── Ecosystem.jl +    └── test +    ├── every_nth.jl +    ├── mushroom.jl +    └── runtests.jl ``` The files `every_nth.jl` and `mushroom.jl` have to contain a single testset, so for example, the `every_nth.jl` file should look like this: diff --git a/docs/src/lecture_04/lab.md b/docs/src/lecture_04/lab.md index a1edf91f..89812370 100644 --- a/docs/src/lecture_04/lab.md +++ b/docs/src/lecture_04/lab.md @@ -98,7 +98,7 @@ world 3. Export all types and functions that should be accessible from outside your package. This should include at least `agent_count`, `simulate!`, - `every_nth`, probably at all species types, and the `World`. + `every_nth`, all species types, and the `World`. ```@raw html
@@ -119,7 +119,10 @@ world = World([...]) simulate!(world,100) ``` You can put your simulation scripts in the same package in a new folder called -`scripts` or `examples` if you like. +`scripts` or `examples` if you like. It often makes sense to have a separate +`Project.toml` in this folder, because it forces you think about which +functions you need to export and which additional packages are necessary e.g. +for visualization of your results. ```@raw html

``` @@ -134,6 +137,8 @@ files. A minimal package structure can look like below. . ├── Project.toml ├── README.md +├── scripts +│   └── run.jl ├── src │   └── Ecosystem.jl └── test @@ -157,7 +162,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] ``` - +Alternatively, you can create another `Project.toml` in your `test` folder. With `Test.jl` as an extra dependency you can start writing your `test/runtests.jl` file. ```@example lab04 using Scientific_Programming_in_Julia # hide @@ -177,6 +182,8 @@ nothing # hide ``` Create a `@testset` and fill it with tests for `agent_count` that cover all of its four methods. + +*Hint*: You can use `isapprox` or `≈` to test equaity of real numbers. ```@raw html
@@ -219,6 +226,10 @@ some of your work. Create a new repository called `Ecosystem.jl` on Github (public or private, however you want). A good repo should also contain a `README.md` file which briefly describes what it is about. + +If you have never used `git` before you can check out the +[tutorial](https://juliateachingctu.github.io/Julia-for-Optimization-and-Learning/stable/installation/tutorial/) +of our Bachelor Course on Julia. ```@raw html