Coder Social home page Coder Social logo

Comments (4)

txlauren avatar txlauren commented on June 19, 2024 1

Thank you so much @hdrake, that did the trick!

from climatemargo.jl.

hdrake avatar hdrake commented on June 19, 2024

If you find yourself frequently doing the above to extract data from ClimateMARGO types and saving them as CSV files, I would recommend writing a function to do so. See examples of how we've done this with the JSON file structure here: https://github.com/ClimateMARGO/ClimateMARGO.jl/blob/master/src/IO/json_io.jl

from climatemargo.jl.

txlauren avatar txlauren commented on June 19, 2024

Thank you for your detailed response. I've tried adapting this solution to extract a time-series of the control deployment percentages but each control has the same values throughout the time-series in the resulting csv.

df = DataFrame(
      year =t(m),
      M = m.controls.mitigate,
      R = m.controls.remove,
      G = m.controls.geoeng,
      A = m.controls.adapt
)

Would you be able to advise me on where I might be going wrong?

Kind regards,
Tilly

from climatemargo.jl.

hdrake avatar hdrake commented on June 19, 2024

Hi @txlauren, thanks for reaching out on here! I think the issue is that the example here has not yet been run through the optimization. So the controls are likely set to their defaults of zero at all times.

Try running the following commands to import the optimization functions and run the model through the control-optimizer.

using ClimateMARGO.Optimization
@time optimize_controls!(m);

You can see a more complete example in the documentation. Hope that helps!

from climatemargo.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.