Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    euronion
    @euronion
    Hello world.
    euronion
    @euronion

    Hi there! Question reg. PyPSA-EUR

    I am encountering errors with the make_summary snakemake rule.
    More specifically with this line
    https://github.com/PyPSA/pypsa-eur/blob/7a18740cfb565b5d83d04387f3a7b35c28fa56cc/scripts/make_summary.py#L43

    TypeError: unhashable type: 'list'

    I ran only 2 scenarios (64 clusters with vopt and copt).
    Running Python 3.7 w/ most packages up-to-date.

    a. Does the rule have a minimum number of scenarios for it to work?
    b. Was there maybe an API change I overlooked which disabled compatability?
    c .Is there a specific reason, why the pandas dataframes have a single index with tuple values instead of a multiindex (this is really confusing and I get the impression hick-ups pandas quite a bit)

    pranjalchakraborty
    @pranjalchakraborty
    Hi! Is this active?
    FabianHofmann
    @FabianHofmann
    Hey! somehow yes :)
    pranjalchakraborty
    @pranjalchakraborty
    I just want to access the p0 of one line named "My line x". But, I can't find/figure out how to do that. Using network.lines , I get the table for all lines and the attributes. But, I need to sequentially access each line individually, and do some stuff if the p0 is over a limit. Any help is greatly appreciated.
    FabianHofmann
    @FabianHofmann
    the time series of components are in seperate dataframe with _t at the end. So network.lines_t.p0 is what you want
    pranjalchakraborty
    @pranjalchakraborty
    With that, we get a list of p0 for all the lines.
    Whereas, I need p0 for one particular line
    FabianHofmann
    @FabianHofmann
    this is a pandas selection issue, use n.lines_t.p0['My line']
    pranjalchakraborty
    @pranjalchakraborty
    It worked! Thanks, man. Love you
    pranjalchakraborty
    @pranjalchakraborty
    Does anyone know how to create graphs? I'm stuck at this

    network.graph()

    <pypsa.descriptors.OrderedGraph object at 0x1A2CDD30>

    network.graph() returns a networkx OrderedGraph
    pranjalchakraborty
    @pranjalchakraborty
    Yep, figured that out. Thanks anyway!
    florian-engels
    @florian-engels
    Hello, I’m having a question regarding the pypsa-eur.
    I’m trying to build the Y_bus admittance matrix from the output of an pypsa-eur network.
    Right now, I built the tutorial network. To get the nondiagonal values of the Y_bus matrix I can use the b,x,r and g values of the network.lines component. But I’m struggling with getting the diagonal elements of the Y_bus as I need values of the network.shunt_impedance component. But this one is just an empty vector in my output. Do you know, why that could be?
    Fabian Neumann
    @fneum
    Hi, you can use the function pypsa.pf.calculate_Y for calculating the bus admittance matrix of a synchronous zone https://github.com/PyPSA/PyPSA/blob/master/pypsa/pf.py#L916-L984.
    PyPSA-Eur does not consider any shunt impedances at the buses.
    That's why network.shunt_impedance should be empty.
    cchrisgong
    @cchrisgong
    Hi this is a beginner user of PYPSA. I would like to know whether there is an in-between stage between PYPSA-EUR and PYPSA-EUR-SEC. It looked like PYPSA-EUR contains one-country-one-node and no sector coupling, and PYPSA-EUR-SEC (which as noted by the website to contain serious issues) contains more nodes per country and sector coupling. Is there a PYPSA version with one-country-one-node and sector coupling? (From the publication it looks like I am looking for PYPSA-EUR-SEC-30, but I haven't found the repo for it?) Many thanks!
    cchrisgong
    @cchrisgong
    *and would also be interested to know whether PYPSA-EUR-SEC-30 or one-country-one-node version of the current version of PYPSA-EUR-SEC is issue-free
    Fabian Neumann
    @fneum
    Hi @cchrisgong, thanks for your question. PyPSA-Eur starts off with the full network resolution provided by the ENTSO-E transparency map (about 5000 buses) and is only clustered to coarser resolution later on in the workflow (due to computational constraints and modelling uncertainties). The minimum resolution is one node per country/synchronous zone (38 buses), but you can interpolate arbitrarily between the upper and lower bounds using the workflow (https://pypsa-eur.readthedocs.io/en/latest/simplification/cluster_network.html). PyPSA-Eur-Sec is already public but under development and you're right that there are improvements to be made. It uses the electricity system model from PyPSA-Eur and adds other energy sectors. PyPSA-Eur is more mature. I do not know what you mean by issue-free. If you mean perfect, then obviously the answer is no for both. You can find all repositories here: https://github.com/pypsa/.
    cchrisgong
    @cchrisgong
    Hi Fabian, thank you for your timely answer. On your last point: what I meant by "issue-free" was quite specific, sorry for not being clear - Specifically are the issues now flagged for PSA-Eur-Sec (e.g. https://github.com/PyPSA/pypsa-eur-sec/issues) - do they also occur for the coarsest spatial resolution, i.e. one-node per country, or can it be partially mitigated due to lower complexity? If so, to what degree can it be mitigated (if your team has looked into it). If so that would be very useful to my corner of the modelling world. Thanks again!
    Tom Brown
    @nworbmot
    Hi @cchrisgong, yes, many of the open issues in PyPSA-Eur-Sec arise because the data is only available at country level and we need to develop distribution keys to break the data down inside each country. The model can be considered more mature if you only use the coarsest one-node-per-country resolution. There will be a big update to the model tomorrow...
    cchrisgong
    @cchrisgong
    Thank you! Looking forward to the update! :)
    cchrisgong
    @cchrisgong
    Hi @fneum Thank you for the help the other day and the tutorial video. I successfully run the tutorial but when I tried to modify the config.yaml file (by copying over the config.default.yaml) for just 3 countries (DE, FR, BR) and 9 clusters and another time span. Yet when I run it and look at it using network.plot(), I only see the clusters plotted inside Germany (the other two countries are not included). The solve process looks fine as I was using Gurobi. Is it because when I run the yaml file certain rules were skipped such that the old country list containing only DE was used, and not the new country list {GB,FR,DE}? The time span was similarly not updated to new values. Many thanks!
    Fabian Neumann
    @fneum
    Did you delete the resources folder? If not, that’s probably the cause.
    cchrisgong
    @cchrisgong
    I did delete it but it didn't help :/
    Fabian Neumann
    @fneum
    Ah yes. The networks folder as well.
    cchrisgong
    @cchrisgong

    Thanks, @fneum! That worked well:)

    I now am trying to build network under pypsa-eur-sec now using "snakemake -j1 prepare_sector_networks", I encountered the follow error

    "...
    services: average fraction of non-electric for water is 0.11781164376526447
    Aviation
    Domestic navigation
    Traceback (most recent call last):
    File "/home/chengong/.local/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2646, in get_loc
    return self._engine.get_loc(key)
    File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
    KeyError: 'BA'
    "
    seems that BA got mixed in the EU countries? I used 37 nodes btw, not sure if it is something wrong with how I set it up in the config... Thank you again for your help :)