You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionality to quickly activate the project you want!!! (#11)
* findproject and quick activate functions
* safety in quick activate
* add tests for quick activate and findproject
* test git=false as well.
* docs for the new functions
Seems like `src` and `scripts` folders have pretty similar functionality. However there is a distinction between these two. You can follow these mental rules to know where to put `file.jl`:
33
30
34
-
1. If upon `include("file.jl")` there is _anything_ being produced, be it data files, plots or even output to the console, then it should be in `scripts`.
35
-
2. If it is functionality used across multiple files or pipelines, it should be in `src`.
36
-
3.`src` should only contain files that define functions or types but not output anything. You can also organize `src` to be a Julia package, or contain multiple Julia packages.
31
+
* If upon `include("file.jl")` there is _anything_ being produced, be it data files, plots or even output to the console, then it should be in `scripts`.
32
+
* If it is functionality used across multiple files or pipelines, it should be in `src`.
33
+
*`src` should only contain files that define functions or types but not output anything. You can also organize `src` to be a Julia package, or contain multiple Julia packages.
37
34
38
35
## Initializing a Project
39
36
@@ -42,7 +39,29 @@ To initialize a project as described in the [Default Project Setup](@ref) sectio
42
39
initialize_project
43
40
```
44
41
45
-
## Navigating the Project
42
+
## Activating a Project
43
+
This part of DrWatson's functionality requires you to have your scientific project (and as a consequence, the Julia project) activated.
2. using the startup flag `--project path` when starting Julia
47
+
3. by setting the [`JULIA_PROJECT`](https://docs.julialang.org/en/latest/manual/environment-variables/#JULIA_PROJECT-1) environment variable
48
+
4. using the functions [`quickctivate`](@ref) and [`findproject`](@ref) offered by DrWatson.
49
+
50
+
We highly recommend the fourth approach. Here is how it works: the function [`quickactivate`](@ref) activates a project given some path by recursively searching the path and its parents for a valid `Project.toml` file. Typically you put this function in your script files like so:
51
+
```julia
52
+
using DrWatson # and any other package you use
53
+
quickactivate(@__DIR__)
54
+
# or
55
+
quickactivate(@__DIR__, "Best project in the WORLLDD")
56
+
```
57
+
where the second optional argument can assert if the activated project matches the name you provided, see below for more.
58
+
59
+
```@docs
60
+
quickactivate
61
+
findproject
62
+
```
63
+
64
+
## Navigating a Project
46
65
To be able to navigate the project consistently, DrWatson provides the following functions:
0 commit comments