diff --git a/docs/src/API.md b/docs/src/API.md index 64848615..5713cfb0 100644 --- a/docs/src/API.md +++ b/docs/src/API.md @@ -19,6 +19,9 @@ AliasParamDict create_toml_dict get_parameter_values! get_parameter_values +get_tagged_parameter_values +get_tagged_parameter_names +fuzzy_match float_type log_parameter_information write_log_file diff --git a/docs/src/index.md b/docs/src/index.md index c1ed5973..ad1f44a1 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -10,8 +10,6 @@ CLIMAParameters serve several functionalities and require certain attributes. A - The parameter does not vary in time (per climate simulation) - The parameter is a function of only constants other CLIMAParameters and or constants -In addition, CLIMAParameters have the flexibility of two important behaviors: - ## Usage See the [The TOML parameter file interface](@ref) and [Parameter Dictionaries](@ref) for usage examples. diff --git a/docs/src/toml.md b/docs/src/toml.md index b4442ae2..27a79b8d 100644 --- a/docs/src/toml.md +++ b/docs/src/toml.md @@ -12,7 +12,8 @@ A parameter is determined by its unique name. It has possible attributes 3. `type` 4. `description` 5. `prior` -6. `transformation` +6. `tags` +7. `transformation` !!! warn Currently we support `Type` and `array{Type}` for the following Types: `float`, `integer`, `string` and `bool`. @@ -35,6 +36,28 @@ type = "float" description = "Molecular weight dry air (kg/mol)" ``` +### Properly tagged parameter +To add a tag to a parameter, set the `tag` field with a list of tags. +Tags are an optional convenience and do not create a namespace. All parameter names must be unique. + +As an initial convention, parameters will be tagged with the component(s) in which they are used. +This convention will be changed as we see how packages use tags. + +```TOML +[prandtl_number_0_grachev] +alias = "Pr_0_Grachev" +value = 0.98 +type = "float" +description = "Pr_0 for Grachev universal functions. From Grachev et al, 2007. DOI: 10.1007/s10546-007-9177-6" +tag = ["SurfaceFluxes"] +``` +If this convention is followed, to obtain the parameters used to build tagged by "surfacefluxes", one could call for example: +```julia +surfacefluxes_params = get_tagged_parameter_values(toml_dict, "surfacefluxes") +``` + +When tags are matched, punctuation and capitalization is removed. For more information, see [`fuzzy_match`](@ref Main.fuzzy_match). + ### A more complex parameter for calibration ```TOML