ClimateMARGO / ClimateMARGO.jl

Julia implementation of MARGO, an idealized climate-economic modelling framework for Optimizing trade-offs between emissions Mitigation, Adaptation, carbon dioxide Removal, and solar Geoengineering.
https://margo.plutojl.org/
MIT License
67 stars 13 forks source link

Updated IO paths #21

Closed fonsp closed 4 years ago

fonsp commented 4 years ago

Hi!

The IO methods used "../../configurations" as the default config path, but that path is relative to the Julia process calling the function, not relative to the file where the function is defined, so it did not work when I started julia in a different folder.

It's now fixed, the argument is simply path::String, with no second arguent config_dir. So the new syntax is

export_params("~/optimistic.json", params)

It is tricky to access non-.jl files inside a package from outside the package, so I added a dictionary included_configurations that goes through the folder configurations and imports them all. The parameter name field is used as dictionary key, so you can access the default config using

CliateMARGO.IO.included_parameters["default"]
fonsp commented 4 years ago

I also moved the docstrings around between ClimateModel and ClimateModelParameters

fonsp commented 4 years ago

Sorry for all the commits, you should Squash and merge this PR :)