Skip to content

Commit 3580f8e

Browse files
committed
Fixes on docs
1 parent 7c95e4a commit 3580f8e

4 files changed

Lines changed: 30 additions & 22 deletions

File tree

.github/workflows/Docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches:
55
- master
6-
tags: ['*']
6+
tags: [v*]
77
pull_request:
88
concurrency:
99
# Skip intermediate builds: always.
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v3
2222
- uses: julia-actions/setup-julia@v1
2323
with:
24-
version: '1'
24+
version: '1.9'
2525
- name: Configure doc environment
2626
run: |
2727
julia --project=docs/ -e '
@@ -32,3 +32,4 @@ jobs:
3232
- uses: julia-actions/julia-docdeploy@v1
3333
env:
3434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PlantGeomPrimitives = "0.0.2"
1919
PlantGeomTurtle = "0.0.3"
2020
PlantGraphs = "0.0.2"
2121
PlantRayTracer = "0.0.4"
22-
PlantSimEngine = "^0.8, 0.9"
22+
PlantSimEngine = "0.9"
2323
PlantViz = "0.0.4"
2424
SkyDomes = "0.1.3"
2525
julia = "1.9"

docs/src/VPLVerse/PlantSimEngine/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ Modules = [PlantSimEngine]
2121
Public = false
2222
Private = true
2323
```
24+
25+
## Examples
26+
27+
```@autodocs
28+
Modules = [PlantSimEngine.Examples]
29+
Public = true
30+
Private = false
31+
```

docs/src/developers/use&dev_packages.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Package and Environment Management for VPL
22

3-
Ana Ernst & Alejandro Morales
3+
Ana Ernst & Alejandro Morales
44
Centre for Crop Systems Analysis - Wageningen University
55

66
This guide helps VPL users interested in (1) managing packages within the VPL-verse, (2) managing reproducible environments, and, (3) developing models into VPL-modules, customization, and extending VPL's functionality under their authorship. It equips them with essential Julia tools and functionalities to take control of these aspects, enhancing the VPL experience.
77

8-
The guide introduces the user to the Julia programming language's package management system, [Pkg.jl](https://pkgdocs.julialang.org/v1/), explains its key features, and offers instructions on getting started with Pkg, managing environments, adding, updating, and removing packages. It also delves into the concept of working with different environments and creating your own project environments. Furthermore, the document covers the process of generating files for new packages using [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl/) and demonstrates how to add dependencies and tests to a package. Information about package naming guidelines and VPL styling protocol, you can find it in [VPL styling protocol](). Finally, this guide provides general good practices to develop VPL packages.
8+
The guide introduces the user to the Julia programming language's package management system, [Pkg.jl](https://pkgdocs.julialang.org/v1/), explains its key features, and offers instructions on getting started with Pkg, managing environments, adding, updating, and removing packages. It also delves into the concept of working with different environments and creating your own project environments. Furthermore, the document covers the process of generating files for new packages using [PkgTemplates.jl](https://github.com/JuliaCI/PkgTemplates.jl/) and demonstrates how to add dependencies and tests to a package. Information about package naming guidelines and VPL styling protocol, you can find it in [VPL styling protocol](style.md). Finally, this guide provides general good practices to develop VPL packages.
99

1010
# Introduction to Julia's packages and environments
1111

@@ -16,11 +16,11 @@ In each of these environments, there is a neat list of the packages associated w
1616
So, if you ever want to work on a project from a different computer or share with with someone else, you can just bring back the environment using its manifest file. That way, you're all set with the right packages without any fuss.
1717

1818
Julia environments are *stackable* - you can overlay one environment with another and have access to additional packages outside of the original environment.
19-
20-
This makes it easy to work on a project, which provides the primary environment, while still having access from the REPL to all your usual dev tools like profilers, debuggers, and so on, just by having an environment including these dev tools later in the load path.
21-
22-
So, it's like having your main work area and then, when needed, you can simply add more tools on top of it without disturbing your primary setup. This keeps things organized and makes it easy to switch between different tasks in Julia.
23-
19+
20+
This makes it easy to work on a project, which provides the primary environment, while still having access from the REPL to all your usual dev tools like profilers, debuggers, and so on, just by having an environment including these dev tools later in the load path.
21+
22+
So, it's like having your main work area and then, when needed, you can simply add more tools on top of it without disturbing your primary setup. This keeps things organized and makes it easy to switch between different tasks in Julia.
23+
2424
## Getting started with Pkg.jl and environments
2525

2626
You can use Pkg.jl from the Julia REPL. You can start interfacing with `Pkg` by pressing `]` from the julia REPL. To get back to the julia REPL, press `Ctrl+C` or backspace.
@@ -43,8 +43,8 @@ These types of environments provide reproducibility. By storing a project enviro
4343

4444
* **Package Directory**
4545

46-
It is directory that contains a tree of subdirectories, and forms an implicit environment. Each subdirectory contains a specific package - if the `X` is is a subdirectory of a package directory and `X/src/X.jl` exists, we can access to the package `X` from the package directory.
47-
46+
It is directory that contains a tree of subdirectories, and forms an implicit environment. Each subdirectory contains a specific package - if the `X` is is a subdirectory of a package directory and `X/src/X.jl` exists, we can access to the package `X` from the package directory.
47+
4848
Package directories are useful when you want to put a set of tools (in the format of packages) somewhere and be able to directly use them, without needing to create a project environment for them.
4949

5050
You can overlay these types of environments and obtained a **stacked environment** - an ordered set of project environments and package directories that make a single composite environment. The precedent and visibility rules combined determine which packages are available and where they get loaded from.
@@ -112,7 +112,7 @@ t("MyPkg")
112112
Keyword arguments for `PkgTemplates.Template` object type:
113113

114114
* *User options:*
115-
* Github username: `user::AbstractString="username"`
115+
* Github username: `user::AbstractString="username"`
116116
* Package authors: `authors::Union{AbstractString, Vector{<:AbstractString}} = “name <email> and contributors”`
117117
* *Package options:*
118118
* Directory where packages will be placed: `dir::AbstractString=”~/.julia/dev”`
@@ -150,7 +150,7 @@ Hello world!
150150

151151
## Styling guidelines
152152

153-
Package and function names should be sensible to most Julia users, even to those who are not domain experts. You can find the specifics in the [styling protocol]().
153+
Package and function names should be sensible to most Julia users, even to those who are not domain experts. You can find the specifics in the [styling protocol](style.md).
154154

155155
## Adding package dependencies
156156

@@ -179,7 +179,7 @@ import JSON
179179
#Add functions to the module
180180
greet() = print("Hello World!")
181181
greet_alien() = print("Hello ", Random.randstring(8))
182-
end
182+
end
183183
````
184184

185185
To reload a package in Julia without restarting the Julia session, you can use the [`Revise.jl`](https://timholy.github.io/Revise.jl/stable/) package whenever you want to work interactively and see immediate updates to your code.
@@ -193,15 +193,15 @@ julia> MyPkg.greet_alien()
193193
Hello aT157rHV
194194
````
195195

196-
## Adding tests
196+
## Adding tests
197197

198198
To add tests to a package, we have to (1) create a directory for tests, (2) create and write the script file, (3) execute tests.
199199

200200
````julia
201201
#Create path to test directory
202202
mkpath("MyPkg/test")
203203
#Create simple test script file in MyPkg/test/runtests.jl
204-
write("MyPkg/test/runtests.jl",
204+
write("MyPkg/test/runtests.jl",
205205
"""
206206
#You can add specific tests here or edit seperatly the file itself
207207
println("Testing...")
@@ -229,7 +229,7 @@ Before formally registering your package, there are some more advanced nuanced i
229229
## General good practices
230230

231231
Use [`ArgCheck.jl`](https://github.com/jw3126/ArgCheck.jl) to perform checks on function arguments for public API (one may also use dedicated types to encapsulate these checks). VPL should have a strong preference for defensive programming even if this comes at the expense of runtime performance (but do try to avoid performance hits and repeating assertions).
232-
232+
233233
````julia
234234
#After installing ArgCheck - Pkg.add("ArgCheck")
235235
using ArgCheck
@@ -260,7 +260,7 @@ y => 0
260260
**Testing a package**
261261
---
262262

263-
* Make sure that the tests include [`Aqua`](https://docs.juliahub.com/General/Aqua/0.5.1/).
263+
* Make sure that the tests include [`Aqua`](https://docs.juliahub.com/General/Aqua/0.5.1/).
264264
Type piracy is allowed as long as the type is owned by a package in the VirtualPlantLab organization.
265265
* All documentation should be written as `jldoctests` and the tests should include a call to `doctests`
266266
* All functions in the source code should be tested individually (in many cases through their `jldoctests`)
@@ -300,13 +300,12 @@ All changes to a package should occur in a branch and a pull request should be u
300300
* The changes fix a significant bug
301301
* Significant features have been added
302302

303-
Check that all the tests are successful in a dedicated module. This requires running `Pkg.test(<package>)` rather than running the `runtest.jl` file in Julia. This will tell you if there are any dependencies missing in the Project.toml of the tests.
303+
Check that all the tests are successful in a dedicated module. This requires running `Pkg.test(<package>)` rather than running the `runtest.jl` file in Julia. This will tell you if there are any dependencies missing in the Project.toml of the tests.
304304
You may use the development version of a dependency while testing locally, but CI will fail until the changes in the dependency are registered.
305305

306306
*Increasing version number:*
307307

308308
* Increase the version number in the `Project.toml` file (not in git!)
309-
* Go to the commit on Github with the changes in `Project.toml` file and add comment with `@JuliaRegistrator register`. This will trigger the registration bot which later will trigger the tagbot on Github.
309+
* Go to the commit on Github with the changes in `Project.toml` file and add comment with `@JuliaRegistrator register`. This will trigger the registration bot which later will trigger the tagbot on Github.
310310
* Once the version on Github gets a new tag, synchronize the master branch of the local repository to get the same tag.
311311
* You will need to update the dependencies of all other packages as otherwise the release versions of VPL will not work.
312-

0 commit comments

Comments
 (0)