openmodels / MimiPAGE2020.jl

PAGE-2020 - a Julia implementation of the PAGE Integrated Assessment Model
MIT License
8 stars 10 forks source link

Turn into package MimiPAGE2020 #65

Closed davidanthoff closed 3 years ago

davidanthoff commented 3 years ago

Tests all pass with this now.

jrising commented 3 years ago

@davidanthoff Thanks for getting this ready! I'm still hesitant to merge this, because it will break the ability to run the code except as a package. Specifically:

Why is it necessary to use, e.g., using MimiPAGE2020: TotalAbatementCosts rather than include("../src/components/TotalAbatementCosts.jl")? If the latter code is run within a package directory, won't it work as expected? Also, if I have the code elsewhere on my computer and also installed as a package, all of the tests will just test the package version.

Your changes also make the climate_model.jl and main_model.jl files no longer useful on their own, since the other imports aren't included. My solution to that, while still ensuring that files aren't multiply-imported, is to move the climatemodel and buildpage functions to a lib directory, and then I can have MimiPAGE2020.jl include those, while I have climate_model.jl and main_model.jl include both those and then necessary other imports.

I haven't build a package in a while, and I know that Julia's package system has changed somewhat. How do I test a package before it's been added to the Julia package repo?

jrising commented 3 years ago

Closing this, in preference to #66 .