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
Copy file name to clipboardExpand all lines: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,14 @@
7
7
8
8
Mimi is a [Julia](http://julialang.org) package that provides a component model for [integrated assessment models](https://en.wikipedia.org/wiki/Integrated_assessment_modelling), as described in detail on the [Mimi Framework Homepage](https://www.mimiframework.org). The [Documentation](https://www.mimiframework.org/Mimi.jl/stable/) includes information on the installation and use of this package, step-by-step tutorials, how-to guides, and techincal reference. The development team closely monitors the [Mimi Framework forum](https://forum.mimiframework.org) and we suggest this as a starting place for any questions users may have.
9
9
10
+
## NEWS
11
+
12
+
On 7/15/2020 we officially tagged and released Mimi v1.0.0, which has some new features, documentation, and quite a bit of internals work as well. Since this is a major version change, there are some breaking changes that may require you to update your code. We have done the updates for the existing models in the Mimi registry (FUND, DICE, etc.), and will release new major versions of those today as well, so if you are using the latest version of Mimi and the latest version of the packages, all should run smoothly.
13
+
14
+
**Please view the how to guide here: https://www.mimiframework.org/Mimi.jl/stable/howto/howto_6/ for a run-down of how you should update your own code.**
15
+
16
+
In addition please do not hesitate to ask any questions on the forum, we are working hard to keep this transition smooth.
17
+
10
18
## Contributions and Questions
11
19
12
20
You can interact with the Mimi development team via issues and pull requests here on github, and in the [Mimi Framework forum](https://forum.mimiframework.org). Contributions to Mimi are also most welcome, and
Copy file name to clipboardExpand all lines: docs/src/howto/howto_6.md
+33-11Lines changed: 33 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,21 @@ The release of Mimi v1.0.0 is a breaking release, necessitating the adaptation o
4
4
5
5
This guide provides an overview of the steps required to get most models using the v0.9.5 API working with v1.0.0. It is **not** a comprehensive review of all changes and new functionalities, but a guide to the minimum steps required to port old models between versions. For complete information on the new version and its additional functionalities, see the full documentation.
6
6
7
-
To port your model, we recommend you update to **Mimi v0.10.0**, which is identical to Mimi v1.0.0 **except** that it includes deprecation warnings for most breaking changes, instead of errors. This means that models written using Mimi v0.9.5 will, in most cases, run successfully under Mimi v0.10.0 and things that will cause errors in v1.0.0 will throw deprecation warnings. your changes. These can guide Thus a good workflow would be:
7
+
## Workflow Advice
8
+
9
+
To port your model, we recommend you update to **Mimi v0.10.0**, which is identical to Mimi v1.0.0 **except** that it includes deprecation warnings for most breaking changes, instead of errors. This means that models written using Mimi v0.9.5 will, in most cases, run successfully under Mimi v0.10.0 and things that will cause errors in v1.0.0 will throw deprecation warnings. These can guide your changes, and thus a good workflow would be:
8
10
9
11
1) Update your environment to use Mimi v0.10.0 with
10
-
```julia
11
-
pkg> add Mimi#v0.10.0
12
-
```
12
+
```julia
13
+
pkg> add Mimi#v0.10.0
14
+
```
13
15
2) Read through this guide to get a sense for what has changed
14
16
3) Run your code and incrementally update it, using the deprecation warnings as guides for what to change and the instructions in this guide as explanations, until no warnings are thrown and you have changed anything relevant to your code that is explained in this gude.
15
-
5) Update to Mimi v1.0.0 with the following code, which will update Mimi to it's latest version, v1.0.0
16
-
```julia
17
-
pkg> free Mimi
18
-
```
19
-
6) Run your model! Things should run smoothly now. If not double check the guide, and feel free to reach out on the forum with any questions. Also, if you are curious about the reasons behind a change, just ask!
17
+
4) Update to Mimi v1.0.0 with the following code, which will update Mimi to it's latest version, v1.0.0
18
+
```julia
19
+
pkg> free Mimi
20
+
```
21
+
5) Run your model! Things should run smoothly now. If not double check the guide, and feel free to reach out on the forum with any questions. Also, if you are curious about the reasons behind a change, just ask!
20
22
21
23
This guide is organized into a few main sections, each descripting an independent set of changes that can be undertaken in any order desired.
22
24
@@ -33,9 +35,11 @@ This guide is organized into a few main sections, each descripting an independen
33
35
#### Type-parameterization for Parameters
34
36
35
37
*The Mimi Change:*
38
+
36
39
To be consistent with julia syntax, Mimi now uses bracketing syntax to type-parameterize `Parameter`s inside the `@defcomp`macro instead of double-colon syntax. h
37
40
38
41
*The User Change:*
42
+
39
43
Where you previously indicated that the parameter `a` should be an `Int` with
40
44
```julia
41
45
@defcomp my_comp begin
@@ -56,9 +60,11 @@ end
56
60
#### Integer Indexing
57
61
58
62
*The Mimi Change:*
63
+
59
64
For safety, Mimi no longer allows indexing into `Parameter`s or `Varaible`s with the `run_timestep`function of the `@defcomp`macro with integers. Instead, this functionality is supported with two new types:`TimestepIndex` and `TimestepValue`. Complete details on indexing options can be found in How-to Guide 4: Work with Timesteps, Parameters, and Variables, but below we will describe the minimum steps to get your models working.
60
65
61
66
*The User Change:*
67
+
62
68
Where you previously used integers to index into a `Parameter` or `Variable`, you should now use the `TimestepIndex` type. For example, the code
63
69
```julia
64
70
function run_timestep(p, v, d, t)
@@ -84,19 +90,22 @@ function run_timestep(p, v, d, t)
84
90
end
85
91
```
86
92
87
-
#### is_timestep and is_time
93
+
#### `is_timestep` and `is_time`
88
94
89
95
*The Mimi Change:*
96
+
90
97
For simplicity and consistency with the change above, Mimi no longer supports the `is_timestep` or `is_time` functions and has replaced this functionality with comparison operators combined with the afformentioned `TimestepValue` and `TimestepIndex` types.
91
98
92
99
*The User Change:*
100
+
93
101
Any instance of the `is_timestep`function should be replaced with simple comparison with a `TimestepIndex` object ie. replace the logic `if is_timestep(t, 10) ...` with `if t == TimestepIndex(10) ...`.
94
102
95
103
Any instance of the `is_time`function should be repalced with simple comparison with a `TimestepValue` object ie. replace the logic `if is_time(t, 2010) ...` with `if t == TimestepValue(2010) ...`.
96
104
97
105
## The set_param! Function
98
106
99
107
*The Mimi Change:*
108
+
100
109
The `set_param!` method for setting a parameter value in a component now has the following signature:
This method creates a new external parameter called `param_name` in the model `m` (if that already exists, it errors), sets its value to `val`, and then connects the parameter `param_name` in component `comp_name` to this newly created external parameter.
118
127
119
128
*The User Change:*
129
+
120
130
Any old code that uses the `set_param!` method with only 4 arguments (shortcut #2 shown above) will still work for setting parameters **if they are found in only one component** ... but if you have multiple components that have parameters with the same name, using the old 4-argument version of `set_param!` multiple times will cause an error. Instead, you need to determine what behavior you want across multiple components with parameters of the same name:
121
131
- If you want parameters with the same name that are found in multiple components to have the _same_ value, use the 3-argument method: `set_param!(m, :param_name, val)`. You only have to call this once and it will set the same value for all components with an unconnected parameter called `param_name`.
122
132
- If you want different components that have parameters with the same name to have _different_ values, then you need to call the 5-argument version of `set_param!` individually for each parameter value, such as:
@@ -134,9 +144,11 @@ This updates the value of the external parameter called `ext_param_name` in the
134
144
## The replace_comp! Function
135
145
136
146
*The Mimi Change:*
147
+
137
148
For simplicity, the `replace_comp!` function has been replaced with a method augmenting the julia Base `replace!` function.
138
149
139
-
*The User Change:*
150
+
*The User Change:*
151
+
140
152
Where you previously used
141
153
```julia
142
154
replace_comp!(m, new, old)
@@ -149,17 +161,21 @@ replace!(m, old => new)
149
161
## Different-length Components
150
162
151
163
*The Mimi Change:*
164
+
152
165
Through Mimi v0.9.4, the optional keyword arguments `first` and `last` could be used to specify times for components that do not run for the full length of the model, like this: `add_comp!(mymodel, ComponentC; first=2010, last=2100)`. This functionality is still disabled, as it was starting in v0.9.5, and all components must run for the full length of the model's time dimension. This functionality may be re-implemented in a later version of Mimi.
153
166
154
167
*The User Change:*
168
+
155
169
Refactor your model so that all components are the same length. You may use the `run_timestep` function within each component to dictate it's behavior in different timesteps, including doing no calculations for a portion of the full model runtime.
156
170
157
171
## Marginal Models
158
172
159
173
*The Mimi Change:*
174
+
160
175
For clarity, the previously named `marginal` attribute of a Mimi `MarginalModel` has been renamed to `modified`. Hence a `MarginalModel` is now described as a Mimi `Model` whose results are obtained by subtracting results of one `base` Model from those of another `marginal` Model that has a difference of `delta` with the signature:
161
176
162
177
*The User Change:*
178
+
163
179
Any previous access to the `marginal` attribute of a `MarginalModel`, `mm` below, should be changed from
164
180
```julia
165
181
model = mm.marginal
@@ -173,9 +189,11 @@ model = mm.modified
173
189
#### Results Access
174
190
175
191
*The Mimi Change:*
192
+
176
193
For clarity of return types, Mimi no longer supports use of square brackets (a shortcut for julia Base `getindex`) to access the results of a Monte Carlo analysis, which are stored in the `SimulationInstance`. Instead, access to resulst is supported with the `getdataframe` function, which will return the results in the same type and format as the square bracket method used to return.
For consistency with julia syntax rules, the small set of unexported functions available to modify an existing `SimulationDefinition` have been renamed, moving from a camel case format to an underscore-based format as follows.
191
210
192
211
*The User Change:*
212
+
193
213
Replace your functions as follows.
194
214
195
215
-`deleteRV!` --> `delete_RV!`
@@ -203,7 +223,9 @@ Replace your functions as follows.
203
223
## Composite Components (optional)
204
224
205
225
*The Mimi Change:*
226
+
206
227
The biggest functionality **addition** of Mimi v1.0.0 is the inclusion of composite components. Prior versions of Mimi supported only "flat" models, i.e., with one level of components. This new version supports mulitple layers of components, with some components being "final" or leaf components, and others being "composite" components which themselves contain other leaf or composite components. This approach allows for a cleaner organization of complex models, and allows the construction of building blocks that can be re-used in multiple models.
207
228
208
229
*The User Change:*
230
+
209
231
All previous models are considered "flat" models, i.e. they have only one level of components, and do **not** need to be converted into multiple layer models to run. Thus this addition does not mean users need to alter their models, but we encourage you to check out the other documentation on composite components to learn how you can enhance your current models and built better onces in the future!
The following how-to guides provide steps to carry out several common real-world problems that Mimi is targeted at solving. They are a bit less detailed than the tutorials, and are thus targeted at a user with some level of experience with Mimi (likely obtained through moving through some or all of the tutorials).
3
+
The following how-to guides provide steps to work through several common real-world problems that Mimi is targeted at solving. They are a bit less detailed than the tutorials, and are thus targeted at a user with some level of experience with Mimi (likely obtained through moving through some or all of the tutorials).
4
4
5
5
If you find a bug in these guides, or have a clarifying question or suggestion, please reach out via Github Issues or our [Mimi Framework forum](https://forum.mimiframework.org). We welcome your feedback.
6
6
7
7
## Available How-to Guides
8
8
9
-
1.**Construct and Run a Flat Model**
9
+
1.[How-to Guide 1: Construct and Run a Model](@ref)
10
10
11
-
[How-to Guide 1: Construct and Run a Model](@ref)
12
11
12
+
2.[How-to Guide 2: View and Explore Model Results](@ref)
13
13
14
-
2.**View and Explore Model Results**
15
14
16
-
[How-to Guide 2: View and Explore Model Results](@ref)
The following how-to guides provide steps to carry out more specified and advanced real-world problems that Mimi can solve. They are less detailed than the tutorials, and are thus targeted at a user with some level of experience with Mimi (likely obtained through moving through some or all of the tutorials).
3
+
The following how-to guides provide steps to work through more specified and advanced real-world problems that Mimi can solve. They are less detailed than the tutorials, and are thus targeted at a user with some level of experience with Mimi (likely obtained through moving through some or all of the tutorials).
4
4
5
5
If you find a bug in these guides, or have a clarifying question or suggestion, please reach out via Github Issues or our [Mimi Framework forum](https://forum.mimiframework.org). We welcome your feedback.
6
6
7
7
## Available Advanced How-to Guides
8
8
9
-
-**Build and Init Functions**
9
+
-[Advanced How-to Guide: Build and Init Functions](@ref) describes the innerworkings of the `build` and `init` functions which may be useful in special cases.
10
10
11
-
[Advanced How-to Guide: Build and Init Functions](@ref) describes the innerworkings of the `build` and `init` functions which may be useful in special cases.
12
11
13
-
-**Using Datum References**
14
-
15
-
[Advanced How-to Guide: Using Datum References](@ref) describes how to use references to datum, or more specifically components, for scenarios where such use improves code brevity and understandability.
12
+
-[Advanced How-to Guide: Using Datum References](@ref) describes how to use references to datum, or more specifically components, for scenarios where such use improves code brevity and understandability.
Copy file name to clipboardExpand all lines: docs/src/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Mimi is a [Julia](http://julialang.org) package that provides a component model for [integrated assessment models](https://en.wikipedia.org/wiki/Integrated_assessment_modelling), as described in detail on the [Mimi Framework Homepage](https://www.mimiframework.org).
6
6
7
-
The following documentation is organized into the following four sections, roughly adhering to the [Divio documentation system](https://documentation.divio.com) guidelines. For insights into the goals of each of these sections, please refer to the Divio documentation.
7
+
The documentation is organized into the following four sections, roughly adhering to the [Divio documentation system](https://documentation.divio.com) guidelines. For insights into the goals of each of these documentation categories, please refer to the Divio documentation.
8
8
9
9
1. Tutorials
10
10
2. How-to Guides
@@ -13,11 +13,11 @@ The following documentation is organized into the following four sections, rough
13
13
14
14
## Getting started
15
15
16
-
We aim to provide assistance to users of all different experience levels, starting with first-time users. If this is your first time using Mimi, we recommend you begin with the Tutorials. In addition, looking through the code at the links below to various existing models based on Mimi can be instructive.
16
+
We aim to assist users of all different experience levels, starting with first-time users. If this is your first time using Mimi, we recommend you begin with the Tutorials. In addition, looking through the code at the links below to various existing models based on Mimi can be instructive.
17
17
18
18
The first step for any user includes installation of julia and Mimi, as well as optionally adding the Mimi Registry. See the first tutorial for instructions on these tasks.
19
19
20
-
Finally, when in doubt, ask your question on the [Mimi Framework forum](https://forum.mimiframework.org) or post an [Issue](https://github.com/mimiframework/Mimi.jl/issues) to the Github repository if you have a specific request for the development team. Don't be shy about either option, we would much prefer to be inundated with lots of questions and help people out than people give up on Mimi!
20
+
Finally, when in doubt, ask your question on the [Mimi Framework forum](https://forum.mimiframework.org) or post an [Issue](https://github.com/mimiframework/Mimi.jl/issues) to the Github repository, the latter being especially pertintent if you have a specific request for the development team. Don't be shy about either option, we would much prefer to be inundated with lots of questions and help people out than people give up on Mimi!
0 commit comments