Code Monkey home page Code Monkey logo

Comments (4)

Zaid2995 avatar Zaid2995 commented on May 27, 2024 1

Thank you for the response; it worked. Unknowingly, I was typing just 'water_td_elec', whereas I should have been typing in water_td_elec_W, as suggested by you, with the correct XPATH function. Yup, I am aware the model uses calibration-derived share-weights as a default, and I will change those to reflect some of the scenarios I want. This was really helpful, thanks once again.

from gcam-core.

pkyle avatar pkyle commented on May 27, 2024

I don't know exactly what you're trying to do, but this one is reasonably comprehensive. You can just copy the text block below, and paste it into your "Queries" window of an open model database. Then File -> Save will add it to the queries file so it's always available when you open a database.
<supplyDemandQuery title="water share-weights by subsector"> <axis1 name="subsector">subsector</axis1> <axis2 name="Year">share-weight</axis2> <xPath buildList="true" dataName="price" group="false" sumAll="false">*[@type='sector' and contains(@name,'water')]/ *[@type='subsector']/ share-weight/text()</xPath> <comments/> </supplyDemandQuery>

from gcam-core.

Zaid2995 avatar Zaid2995 commented on May 27, 2024

Thanks @pkyle for your swift response!

To provide you with some context, I am trying to change the shareweights of water_td_elec which are assigned to basins in India for future years. Currently, they have a fixed shareweight of 1 through 2100, resulting in an equal share of water withdrawals across basins for electricity generation. I want to change that, especially for developing countries where it might not be true. Some basins are already stressed out, and this might impact new power plant installations. I want to explore such scenarios, and for that, I will change the shareweights. I also want to see the changes reflected in the model to confirm (even though the water_td XML also reflects them). Therefore, I am creating a new query.

In terms of the query, earlier, I was typing in 'water_td_elec' instead of 'water'. But correcting for that also 'returns no results'. Any reason you think that might be happening?

from gcam-core.

pkyle avatar pkyle commented on May 27, 2024

The query I sent just uses string matching. The sector for power sector withdrawals is called water_td_elec_W, but as long as you're using the XPATH function contains(@name, "") (rather than and (@name="")), you should be able to get it from water_td_elec. But it sounds like you really want to use and (@name='water_td_elec_W').
Also just to be clear the model uses calibration-derived share-weights, passed forward to future years using fixed share-weight interpolation. So you don't see the share-weight values in the input XML file water_td.xml, but they're not all equal to 1 (unless you've over-ridden the default behavior).

from gcam-core.

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.