Skip to content

Commit

Permalink
Expand section "making your project a usable module" (#416)
Browse files Browse the repository at this point in the history
* revise section "making your project a usable module"

* Incorporate suggestions from review (remove package discussion + word change)
  • Loading branch information
abraemer authored Jun 5, 2024
1 parent 3f2a6cf commit c8d7ff1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/src/real_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ save(datadir("sim", "barkley", "astonishing_results.jld2"), data)
```

## Making your project a usable module
For some projects, it is often the case that some packages and files from the source folder are loaded at the beginning of _every file of the project_.
For some projects, it is often the case that some packages and files from the source folder are loaded at the beginning of _every file of the project_.
For example, I have a project that I know that for _any_ script I will write, the first five lines will be:
```julia
using DrWatson
Expand Down Expand Up @@ -66,6 +66,15 @@ using DrWatson
```
which takes advantage of [`@quickactivate`](@ref)'s feature to essentially combine the commands `@quickactivate "AlbedoProperties"` and `using AlbedoProperties` into one.

Please note: In this section, it's assumed that you created the project using [`initialize_project`](@ref) which will put the project's name into the `Project.toml` file. If you created your project in any other way, you need to ensure that the name is set at the top of `Project.toml`, i.e. for the example above there is a line
```toml
name = "AlbedoProperties"
```
If that line is absent, you will get an error like:
```
ERROR: ArgumentError: Package AlbedoProperties not found in current path.
```

## `savename` and tagging
The combination of using [`savename`](@ref) and [`tagsave`](@ref) makes it easy and fast to save output in a way that is consistent, robust and reproducible. Here is an example from a project:
```julia
Expand Down

0 comments on commit c8d7ff1

Please sign in to comment.