Skip to content

Commit

Permalink
added some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinuzziFrancesco committed Jan 24, 2024
1 parent 53ecb5b commit c13a098
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/axioms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,32 @@ struct Constant{S<:String,D,V}
value::V
end

"""
Constant(constant::Dict{String, Any}) -> Constant
Create a `Constant` object from a dictionary.
# Arguments
- `constant::Dict{String, Any}`: A dictionary containing the following keys:
+ `"description"`: Description of the constant.
+ `"short_name"`: Short name of the constant.
+ `"default"`: Default value of the constant.
# Returns
- `Constant`: An instance of the `Constant` struct with fields populated based on the provided dictionary.
# Example
```julia
constant_dict = Dict(
"description" => "Speed of light in vacuum", "short_name" => "c", "default" => 299792458
)
constant = Constant(constant_dict)
```
"""
function Constant(constant::Dict{String,Any})
description = constant["description"]
short_name = constant["short_name"]
Expand Down

0 comments on commit c13a098

Please sign in to comment.