Skip to content

Commit

Permalink
Clean README, NEWS and docs
Browse files Browse the repository at this point in the history
Fixed a few typos.

Co-Authored-By: Claudio Moroni <[email protected]>
  • Loading branch information
pitmonticone and ClaudMor committed Aug 2, 2022
1 parent 2698a61 commit 987fdb1
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Mimi.jl v0.8.0 Release Notes
* Generalize mcs functionality to support other sensitivity analysis methods
* Update and augment documentation for sensitvity analysis
* Update and augment documentation for sensitivity analysis

# Mimi.jl v0.7.0 Release Notes
* Drop julia 1.0 support
Expand All @@ -28,7 +28,7 @@
- Fixed uses of eval

# Mimi.jl v0.6.4 Release Notes
* Documentation udpates
* Documentation updates
* Tutorials bug and consistency updates
* Update the way to add models to mcs
* Add methods and docstrings for dimension-related functions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Check out the new [MimiSSPs.jl](https://github.com/anthofflab/MimiSSPs.jl) compo

6/14/2021

We recently tagged and released a feature relese revamping the API surrounding parameters, please see https://www.mimiframework.org/Mimi.jl/dev/howto/howto_5/ and https://www.mimiframework.org/Mimi.jl/dev/howto/howto_9/.
We recently tagged and released a feature release revamping the API surrounding parameters, please see https://www.mimiframework.org/Mimi.jl/dev/howto/howto_5/ and https://www.mimiframework.org/Mimi.jl/dev/howto/howto_9/.

5/3/2021

Expand Down
2 changes: 1 addition & 1 deletion docs/src/explanations/exp_pkgs.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ run(m)

Packages can be registered in a [Registry](https://julialang.github.io/Pkg.jl/v1/registries/), and "registries contain information about packages, such as available releases and dependencies, and where they can be downloaded. The [General registry](https://github.com/JuliaRegistries/General) is the default one, and is installed automatically".

The Mimi registry is a custom registry maintained by the Mimi development team that colocates several Mimi models in one central registry in the same way julia colates packages in the General registry, where `Mimi` and other packages you commonly may use are located. While the development team maintains this registry and has some basic requirements such as continuous integration tesing (CI) and proper package structure as dictated by julia, they do not claim responsibility or knowledge of the content or quality of the models themselves.
The Mimi registry is a custom registry maintained by the Mimi development team that collects several Mimi models in one central registry in the same way julia collects packages in the General registry, where `Mimi` and other packages you commonly may use are located. While the development team maintains this registry and has some basic requirements such as continuous integration testing (CI) and proper package structure as dictated by julia, they do not claim responsibility or knowledge of the content or quality of the models themselves.

If you are interested in adding a model to the Mimi Registry, please be in touch with the Mimi development team by opening an [Issue on the Registry](https://github.com/mimiframework/MimiRegistry/issues) and/or a question on the [Mimi forum](https://forum.mimiframework.org) if you do not receive a timely response. We will aim to create a standard guide for this process soon.

Expand Down
4 changes: 2 additions & 2 deletions docs/src/howto/howto_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ add_comp!(m, ComponentA, :GDP)

The first argument to [`add_comp!`](@ref) is the model, the second is the name of the ComponentId defined by [`@defcomp`](@ref). If an optional third symbol is provided (as in the second line above), this will be used as the name of the component in this model. This allows you to add multiple versions of the same component to a model, with different names.

The [`add_comp!`](@ref) function has two more optional keyword arguments, `first` and `last`, which can be used to indicate a fixed start and/or end time (year in this case) that the compnonent should run for (within the bounds of the model's time dimension). For example, the following indicates that `ComponentA` should only run from 1900 to 2000.
The [`add_comp!`](@ref) function has two more optional keyword arguments, `first` and `last`, which can be used to indicate a fixed start and/or end time (year in this case) that the component should run for (within the bounds of the model's time dimension). For example, the following indicates that `ComponentA` should only run from 1900 to 2000.

```julia
add_comp!(m, ComponentA; first = 1900, last = 2000)
```

The next step is to set the values for all the parameters in the components. Parameters can either have their values assigned from external data, or they can internally connect to the values from variables in other components of the model. When assigned from external data, parameters are externally connected to a model parameter, which can be a shared model parameter with its own name and connected to more than one component-parameter pair, or an unshared model paarameter accessible only through the component-parameter pair names and connected solely to that parameter.
The next step is to set the values for all the parameters in the components. Parameters can either have their values assigned from external data, or they can internally connect to the values from variables in other components of the model. When assigned from external data, parameters are externally connected to a model parameter, which can be a shared model parameter with its own name and connected to more than one component-parameter pair, or an unshared model parameter accessible only through the component-parameter pair names and connected solely to that parameter.

To make an external connection to an unshared model parameter, the syntax is as follows:

Expand Down
6 changes: 3 additions & 3 deletions docs/src/howto/howto_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ As previously mentioned and included in the tutorial, the [`@defsim`](@ref) macr
*Latin Hypercube sampling divides the distribution into equally-spaced quantiles, obtains values at those quantiles, and then shuffles the values. The result is better representation of the tails of the distribution with fewer samples than would be required for purely random sampling.*

3. Sobol sampling and analysis (`SobolData`)
4. Delta samping and analysis (`DeltaData`) - **Beta**, we don't recommend use yet
4. Delta sampling and analysis (`DeltaData`) - **Beta**, we don't recommend use yet

### Include Sampling Strategy-specifc Parameters
### Include Sampling Strategy-specific Parameters

Certain sampling strategies support (or necessitate) further customization. These may include:

Expand Down Expand Up @@ -320,7 +320,7 @@ By default, all defined models are run. In some cases, you may want to run some

## 3. The `analyze` function

The `analyze` function takes a simulation instance, runs a sensitivity analysis method as determined by the type of simulation instance, and returns the results. It is currenlty defined for a `SobolSimulationInstance` and the `DeltaSimulationInstance` (**Beta**) subtypes of `SimulationInstance`.
The `analyze` function takes a simulation instance, runs a sensitivity analysis method as determined by the type of simulation instance, and returns the results. It is currently defined for a `SobolSimulationInstance` and the `DeltaSimulationInstance` (**Beta**) subtypes of `SimulationInstance`.

This function wraps the `analyze` function in the [GlobalSensitivityAnalysis.jl](https://github.com/lrennels/GlobalSensitivityAnalysis.jl) package, so please view the README of this package for the most up to date information.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/howto/howto_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Parameters

Component parameters in Mimi obtain values either (1) from a variable calculated by another component and passed through an internal connection or (2) from an externally set value stored in a model parameter. For the latter case, model parameters can be unshared, such that they can only connect to one component/parameter pair and must be accessed by specifying both the component and component's parameter name, or shared, such that they can connect to mulitple component/parameter pairs and have a unique name they can be referenced with.
Component parameters in Mimi obtain values either (1) from a variable calculated by another component and passed through an internal connection or (2) from an externally set value stored in a model parameter. For the latter case, model parameters can be unshared, such that they can only connect to one component/parameter pair and must be accessed by specifying both the component and component's parameter name, or shared, such that they can connect to multiple component/parameter pairs and have a unique name they can be referenced with.

In the next few subsections we will present the API for setting, connecting, and updating parameters as presented by different potential use cases. The API consistes of only a few primary functions:
In the next few subsections we will present the API for setting, connecting, and updating parameters as presented by different potential use cases. The API consists of only a few primary functions:

- [`update_param!`](@ref)
- [`add_shared_param!`](@ref)
Expand Down Expand Up @@ -173,7 +173,7 @@ update_leftover_params!(m::Model, parameters::Dict)
For example, given a model `m` with with component `A`'s parameters `p1` and `p2` which have not been updated from `nothing`, along with component `B`'s parameter `p1` that has not been updated. In this case the following will update those parameters and make the model runnable:
```
parameters = Dict((:A, :p1) => 1, (:A, :p2) => :foo, (:B, :p1) => 100)
update_leftover_params!(m, parameeters)
update_leftover_params!(m, parameters)
```
Note that your dictionary `parameters` **must include all leftover parameters that need to be set**, not just a subset of them, or it will error when it cannot find a desired key.

Expand All @@ -187,7 +187,7 @@ For each (k, v) pair in the provided `parameters` dictionary, [`update_param!`](

For example, given a model `m` with a shared model parameter `shared_param` connected to several component parameters, and two unshared model parameters `p1` and `p2` in a component `A`:
```julia
# update shared model parameters and unshared model parameters seprately
# update shared model parameters and unshared model parameters separately
shared_dict = Dict(:shared_param => 1)
unshared_dict = Dict((:A, :p5) => 2, (:A, :p6) => 3)
update_params!(m, shared_dict)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/howto/howto_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ add_comp!(m, FAIR_component) # will run from 1765 to 1950
```
----
#### The following options are now available for further modifcations if this end state is not desireable:
#### The following options are now available for further modifications if this end state is not desireable:
- If you want to update a component's run period, you may use the function `Mimi.set_first_last!(m, :ComponentName, first = new_first, last = new_last)` to specify when you want the component to run.
- You can update shared model parameters to have values in place of the assumed `missing`s using the [`update_param!`](@ref) function
6 changes: 3 additions & 3 deletions docs/src/howto/howto_7.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The release of Mimi v0.5.0 is a breaking release, necessitating the adaptation of existing models' syntax and structure in order for those models to run on this new version. This guide provides an overview of the steps required to get most models using the v0.4.0 API working with v0.5.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 functionalities, see the full documentation.

This guide is organized into six main sections, each descripting an independent set of changes that can be undertaken in any order desired.
This guide is organized into six main sections, each describing an independent set of changes that can be undertaken in any order desired.

1) Defining components
2) Constructing a model
Expand All @@ -11,7 +11,7 @@ This guide is organized into six main sections, each descripting an independent
5) Plotting
6) Advanced topics

**A Note on Function Naming**: There has been a general overhaul on function names, especially those in the explicity user-facing API, to be consistent with Julia conventions and the conventions of this Package. These can be briefly summarized as follows:
**A Note on Function Naming**: There has been a general overhaul on function names, especially those in the explicitly user-facing API, to be consistent with Julia conventions and the conventions of this Package. These can be briefly summarized as follows:

- use `_` for readability
- append all functions with side-effects, i.e., non-pure functions that return a value but leave all else unchanged with a `!`
Expand All @@ -22,7 +22,7 @@ This guide is organized into six main sections, each descripting an independent

The `run_timestep` function is now contained by the `@defcomp` macro, and takes the parameters `p, v, d, t`, referring to Parameters, Variables, and Dimensions of the component you defined. The fourth argument is an `AbstractTimestep`, i.e., either a `FixedTimestep` or a `VariableTimestep`. Similarly, the optional `init` function is also contained by `@defcomp`, and takes the parameters `p, v, d`. Thus, as described in the user guide, defining a single component is now done as follows:

In this version, the fourth argument (`t` below) can no longer always be used simply as an `Int`. Indexing with `t` is still permitted, but special care must be taken when comparing `t` with conditionals or using it in arithmatic expressions. The full API as described later in this document in **Advanced Topics: Timesteps and available functions**. Since differential equations are commonly used as the basis for these models' equations, the most commonly needed change will be changing `if t == 1` to `if is_first(t)`
In this version, the fourth argument (`t` below) can no longer always be used simply as an `Int`. Indexing with `t` is still permitted, but special care must be taken when comparing `t` with conditionals or using it in arithmetic expressions. The full API as described later in this document in **Advanced Topics: Timesteps and available functions**. Since differential equations are commonly used as the basis for these models' equations, the most commonly needed change will be changing `if t == 1` to `if is_first(t)`

```julia
@defcomp component1 begin
Expand Down
10 changes: 5 additions & 5 deletions docs/src/howto/howto_9.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Here we briefly summarize the new, encouraged parameter API. We encourage users

### Parameters

Component parameters in Mimi obtain values either (1) from a variable calculated by another component and passed through an internal connection or (2) from an externally set value stored in a model parameter. For the latter case, model parameters can be unshared, such that they can only connect to one component/parameter pair and must be accessed by specifying both the component and component's parameter name, or shared, such that they can connect to mulitple component/parameter pairs and have a unique name they can be referenced with.
Component parameters in Mimi obtain values either (1) from a variable calculated by another component and passed through an internal connection or (2) from an externally set value stored in a model parameter. For the latter case, model parameters can be unshared, such that they can only connect to one component/parameter pair and must be accessed by specifying both the component and component's parameter name, or shared, such that they can connect to multiple component/parameter pairs and have a unique name they can be referenced with.

In the next few subsections we will present the API for setting, connecting, and updating parameters as presented by different potential use cases. The API consistes of only a few primary functions:
In the next few subsections we will present the API for setting, connecting, and updating parameters as presented by different potential use cases. The API consists of only a few primary functions:

- [`update_param!`](@ref)
- [`add_shared_param!`](@ref)
Expand All @@ -35,7 +35,7 @@ myparameter = myrv
# or the shortcut:
myparameter = Normal(0,1)
```
Now, this syntax will only work if `myparameter` is a shared model parameter and thus accesible with that name. If the parameter is an unshared model parameter, use dot syntax like
Now, this syntax will only work if `myparameter` is a shared model parameter and thus accessible with that name. If the parameter is an unshared model parameter, use dot syntax like
```julia
rv(myrv) = Normal(0,1)
mycomponent.myparameter = myrv
Expand Down Expand Up @@ -144,7 +144,7 @@ For each (k, v) pair in the provided `parameters` dictionary, [`update_params!`]

For example, given a model `m` with a shared model parameter `model_param_name` connected to several component parameters, and two unshared model parameters `p1` and `p2` in a component `A`:
```julia
# update shared model parameters and unshared model parameters seprately
# update shared model parameters and unshared model parameters separately
shared_dict = Dict(:model_param_name => 1)
unshared_dict = Dict((:A, :p5) => 2, (:A, :p6) => 3)
update_params!(m, shared_dict)
Expand Down Expand Up @@ -185,7 +185,7 @@ or
rv(myrv) = Normal(0,1)
myparameter = myrv
```
Now, this syntax will only work if `myparameter` is a shared model parameter and thus accesible with that name. If the parameter is an unshared model parameter, use dot syntax like
Now, this syntax will only work if `myparameter` is a shared model parameter and thus accessible with that name. If the parameter is an unshared model parameter, use dot syntax like
```
mycomponent.myparameter = Normal(0,1)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ As we work to enhance and improve Mimi we will release new versions of the packa
pkg> update Mimi
```

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!
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 pertinent 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!

## Models using Mimi

Expand Down
2 changes: 1 addition & 1 deletion docs/src/ref/ref_composites.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reference Guide: Composite Components

Prior versions of Mimi supported only "flat" models, i.e., with one level of components. The current 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.
Prior versions of Mimi supported only "flat" models, i.e., with one level of components. The current version supports multiple 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.

To the degree possible, composite components are designed to operate the same as leaf components, though there are necessarily differences:

Expand Down

0 comments on commit 987fdb1

Please sign in to comment.