Skip to content

Commit d351a58

Browse files
authored
Merge pull request #429 from mimiframework/registry
Update tutorials using Mimi registry syntax
2 parents f0338bc + 224e3e8 commit d351a58

File tree

6 files changed

+71
-44
lines changed

6 files changed

+71
-44
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ Mimi is an installable package. To install Mimi, use the following:
3131
Pkg.add("Mimi")
3232
````
3333

34+
## Mimi Registry
35+
36+
Several models currently use the Mimi framework, as listed in the section below. For convenience, several models are registered in the [MimiRegistry](https://github.com/anthofflab/Mimi.jl), and operate as julia packages. To use this feature, you first need to connect your julia installation with the central Mimi registry of Mimi models. This central registry is like a catalogue of models that use Mimi that is maintained by the Mimi project. To add this registry, run the following command at the julia package REPL:
37+
38+
```julia
39+
pkg> registry add https://github.com/mimiframework/MimiRegistry.git
40+
```
41+
42+
You only need to run this command once on a computer.
43+
44+
From there you may add any of the registered packages, such as MimiRICE2010.jl by running the following command at the julia package REPL:
45+
46+
```julia
47+
pkg> add MimiRICE2010
48+
```
3449
## Models using Mimi
3550

3651
* [FUND.jl](https://github.com/davidanthoff/fund.jl) (currently in beta)

docs/src/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ Pkg.add("Mimi")
1414

1515
For more complete setup instructions, follow the [Installation Guide](@ref).
1616

17+
18+
## Mimi Registry
19+
20+
Several models currently use the Mimi framework, as listed in the section below. For convenience, several models are registered in the [MimiRegistry](https://github.com/anthofflab/Mimi.jl), and operate as julia packages. To use this feature, you first need to connect your julia installation with the central Mimi registry of Mimi models. This central registry is like a catalogue of models that use Mimi that is maintained by the Mimi project. To add this registry, run the following command at the julia package REPL:
21+
22+
```julia
23+
pkg> registry add https://github.com/mimiframework/MimiRegistry.git
24+
```
25+
26+
You only need to run this command once on a computer.
27+
28+
From there you may add any of the registered packages, such as MimiRICE2010.jl by running the following command at the julia package REPL:
29+
30+
```julia
31+
pkg> add MimiRICE2010
32+
```
33+
1734
## Models using Mimi
1835

1936
* [FUND.jl](https://github.com/davidanthoff/fund.jl) (currently in beta)

docs/src/tutorials/tutorial_1.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,39 @@ This tutorial walks through the steps to download, run, and view the output of a
44

55
Working through the following tutorial will require:
66

7-
- [Julia v1.0.0](https://julialang.org/downloads/) or higher
8-
- [Mimi v0.6.0](https://github.com/mimiframework/Mimi.jl)
7+
- [Julia v1.1.0](https://julialang.org/downloads/) or higher
8+
- [Mimi v0.8.0](https://github.com/mimiframework/Mimi.jl)
99
- [Git](https://git-scm.com/downloads) and [Github](https://github.com)
1010

1111
If you have not yet prepared these, go back to the main tutorial page and follow the instructions for their download.
1212

1313
### Step 1. Download FUND
1414

15-
The first step in this process is downloading the FUND model. First, open your command line interface and navigate to the folder where you would like to download FUND.
15+
The first step in this process is downloading the FUND model, which is now made easy with the Mimi registry. Assuming you have already done the one-time run of the following to connect your julia installation with the central Mimi registry of Mimi models
1616

17-
```
18-
cd(<directory-path>) # directory-path is a placeholder for the string describing your desired file path
17+
```julia
18+
pkg> registry add https://github.com/mimiframework/MimiRegistry.git
1919
```
2020

21-
Next, clone the FUND repository from Github, enter the repository, and checkout the `next` branch, which holds the Julia version of FUND.
22-
21+
You simply need to add the FUND model with
2322
```
24-
git clone https://github.com/fund-model/fund.git
25-
cd("fund")
26-
git checkout next
23+
add MimiFUND
2724
```
28-
You have now successfully downloaded FUND to your local machine.
2925

3026
### Step 2. Run FUND
3127

3228
The next step is to run FUND. If you wish to first get more aquainted with the model itself, take a look at the provided online documentation.
3329

34-
In order to run FUND, you will need to open a Julia REPL (here done with the alias `julia`) and navigate to the source code folder, labeled `src`.
30+
In order to run FUND, you will need to have the packages `Distributions` and `StatsBase` installed, and if not do so by entering [Pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/index.html) by typing `]`, and then `add StatsBase` and `add Distributions`.
31+
32+
Now open a julia REPL and type
3533

3634
```
37-
Julia
38-
cd(<fund-directory-path>) # fund-directory-path is a placeholder for the string describing your the file path of the downloaded `fund` folder from Step 1.
35+
using MimiFUND
3936
```
40-
41-
Next, run the main fund file `fund.jl` (make sure to have the packages `Distributions` and `StatsBase` installed, and if not do so by entering [Pkg mode](https://docs.julialang.org/en/v1/stdlib/Pkg/index.html) by typing `]`, and then `add StatsBase` and `add Distributions`. This file defines a new [module](https://docs.julialang.org/en/v1/manual/modules/index.html) called `Fund`, which exports the function `getfund`, a function that returns a version of fund allowing for different user specifications. Note that in order to allow access to the module, we must call `using .Fund`, where `.Fund` is a shortcut for `Main.Fund`, since the `Fund` module is nested inside the `Main` module. After creating the model `m`, simply run the model using the `run` function.
37+
to access the public API to FUND, which currently includes the function `getfund`, a function that returns a version of fund allowing for different user specifications.
4238

4339
```
44-
include("src/fund.jl")
45-
using .Fund
4640
m = getfund()
4741
run(m)
4842
```

docs/src/tutorials/tutorial_2.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This tutorial walks through the steps to modify an existing model. There are se
66

77
Working through the following tutorial will require:
88

9-
- [Julia v1.0.0](https://julialang.org/downloads/) or higher
10-
- [Mimi v0.6.0](https://github.com/mimiframework/Mimi.jl)
9+
- [Julia v1.1.0](https://julialang.org/downloads/) or higher
10+
- [Mimi v0.8.0](https://github.com/mimiframework/Mimi.jl)
1111
- [Git](https://git-scm.com/downloads) and [Github](https://github.com)
1212

1313
If you have not yet prepared these, go back to the main tutorial page and follow the instructions for their download.
1414

15-
Futhermore, this tutorial uses the [DICE](https://github.com/anthofflab/mimi-dice-2010.jl) model as an example. Downloading `DICE` uses similar steps to those described for `FUND` in Tutorial 1 Steps 1 and 2, but are repeated in in Step 1 for clarity.
15+
Futhermore, this tutorial uses the [DICE](https://github.com/anthofflab/mimi-dice-2010.jl) model as an example. Downloading `DICE` uses similar steps to those described for `FUND` in Tutorial 1 Steps 1 and 2.
1616

1717
## Introduction
1818

@@ -40,37 +40,24 @@ If you wish to alter connections within an existing model, [`disconnect_param!`]
4040

4141
### Step 1. Download DICE
4242

43-
The first step in this process is downloading the DICE model. First, open your command line interface and navigate to the folder where you would like to download DICE.
43+
The first step in this process is downloading the FUND model, which is now made easy with the Mimi registry. Assuming you have already done the one-time run of the following to connect your julia installation with the central Mimi registry of Mimi models
4444

45+
```julia
46+
pkg> registry add https://github.com/mimiframework/MimiRegistry.git
4547
```
46-
cd(<directory-path>) # directory-path is a placeholder for the string describing your desired file path
47-
```
48-
49-
Next, clone the DICE repository from Github, and enter the repository.
5048

49+
You simply need to add the DICE2010 model with
5150
```
52-
git clone https://github.com/anthofflab/mimi-dice-2010.jl.git
53-
cd("mimi-dice-2010.jl")
54-
51+
add MimiDICE2010
5552
```
5653
You have now successfully downloaded DICE to your local machine.
5754

5855
### Step 2. Run DICE
5956

60-
The next step is to run DICE. If you wish to first get more aquainted with the model itself, take a look at the provided online documentation.
61-
62-
In order to run DICE, you will need to open a Julia REPL (here done witht the alias `julia`) and navigate to the source code folder, labeled `src`.
63-
64-
```
65-
Julia
66-
cd(<dice-directory-path>) # <dice-directory-path> is a placeholder for the string describing your the file path of the downloaded `dice-2010` folder from Step 1.
67-
```
68-
69-
Next, run the main fund file `dice2010.jl`. This file defines a new [module](https://docs.julialang.org/en/v1/manual/modules/index.html) called `Dice2010`, which exports the function `construct_dice`, a function that returns a version of dice allowing for user specification of parameters. Note that in order to allow access to the module, we must call `using .Dice2010`, where `.Dice2010` is a shortcut for `Main.Dice2010`, since the `Dice2010` module is nested inside the `Main` module. After creating the model `m`, simply run the model using the `run` function.
57+
The next step is to run DICE. If you wish to first get more aquainted with the model itself, take a look at the provided online documentation. Now run DICE using the provided API for the package:
7058

7159
```
72-
include("src/dice2010.jl")
73-
using .Dice2010
60+
using MimiDICE2010
7461
m = construct_dice()
7562
run(m)
7663
```

docs/src/tutorials/tutorial_3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ While we will walk through the code step by step below, the full code for implem
66

77
Working through the following tutorial will require:
88

9-
- [Julia v1.0.0](https://julialang.org/downloads/) or higher
10-
- [Mimi v0.6.0](https://github.com/mimiframework/Mimi.jl)
9+
- [Julia v1.1.0](https://julialang.org/downloads/) or higher
10+
- [Mimi v0.8.0](https://github.com/mimiframework/Mimi.jl)
1111
- [Git](https://git-scm.com/downloads) and [Github](https://github.com)
1212

1313
If you have not yet prepared these, go back to the main tutorial page and follow the instructions for their download.

docs/src/tutorials/tutorial_main.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,21 @@ To use the following tutorials, follow the steps below.
4747
pkg> add Mimi
4848
```
4949

50-
We also recommend that you frequently update your packages and requirements using the `update` command, which can be abbreviated `up`:
50+
4. To access the models in the [MimiRegistry](https://github.com/anthofflab/Mimi.jl), you first need to connect your julia installation with the central Mimi registry of Mimi models. This central registry is like a catalogue of models that use Mimi that is maintained by the Mimi project. To add this registry, run the following command at the julia package REPL:
51+
52+
```julia
53+
pkg> registry add https://github.com/mimiframework/MimiRegistry.git
54+
```
55+
56+
You only need to run this command once on a computer.
57+
58+
From there you will be add any of the registered packages, such as MimiRICE2010.jl by running the following command at the julia package REPL:
59+
60+
```julia
61+
pkg> add MimiRICE2010
62+
```
63+
64+
5. We also recommend that you frequently update your packages and requirements using the `update` command, which can be abbreviated `up`:
5165
```
5266
pkg> up
5367
```

0 commit comments

Comments
 (0)