Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in prepare_network from add_dynamic_emission_prices #1527

Open
MaxBrehm opened this issue Feb 4, 2025 · 0 comments
Open

Error in prepare_network from add_dynamic_emission_prices #1527

MaxBrehm opened this issue Feb 4, 2025 · 0 comments
Labels

Comments

@MaxBrehm
Copy link

MaxBrehm commented Feb 4, 2025

I encountered an issue when enableing:

costs:
  emission_prices:
    enable: false 
    co2_monthly_prices: true

in my config.

localrule prepare_network:
    input: resources/max-2/test_01/networks/base_s_100_elec.nc, resources/max-2/test_01/costs_2030.csv
    output: resources/max-2/test_01/networks/base_s_100_elec_Ep.nc
    log: logs/max-2/test_01/prepare_network_base_s_100_elec_Ep.log
    jobid: 2
    benchmark: benchmarks/max-2/test_01/prepare_network_base_s_100_elec_Ep
    reason: Missing output files: resources/max-2/test_01/networks/base_s_100_elec_Ep.nc; Input files updated by another job: resources/max-2/test_01/networks/base_s_100_elec.nc, resources/max-2/test_01/costs_2030.csv
    wildcards: clusters=100, opts=Ep
    resources: tmpdir=/tmp, mem_mb=4000, mem_mib=3815

INFO:pypsa.io:Imported network base_s_100_elec.nc has buses, carriers, generators, lines, loads, storage_units
INFO:__main__:N-1 security margin of lines set to 0.7
INFO:__main__:Resampling the network to 1H
/home/maxb/Dokumente/Masterarbeit/pypsa-eur/pypsa-eur/.snakemake/scripts/tmprw7f0a8c.prepare_network.py:192: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
  snapshot_weightings = n.snapshot_weightings.resample(offset).sum()
/home/maxb/Dokumente/Masterarbeit/pypsa-eur/pypsa-eur/.snakemake/scripts/tmprw7f0a8c.prepare_network.py:203: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
  pnl[k] = df.resample(offset).mean()
INFO:__main__:Setting time dependent emission prices according spot market price
ERROR:root:Uncaught exception
Traceback (most recent call last):
  File "/home/maxb/Dokumente/Masterarbeit/pypsa-eur/pypsa-eur/.snakemake/scripts/tmprw7f0a8c.prepare_network.py", line 342, in <module>
    add_dynamic_emission_prices(n)
  File "/home/maxb/Dokumente/Masterarbeit/pypsa-eur/pypsa-eur/.snakemake/scripts/tmprw7f0a8c.prepare_network.py", line 126, in add_dynamic_emission_prices
    co2_price = pd.read_csv(snakemake.input.co2_price, index_col=0, parse_dates=True)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maxb/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1026, in read_csv
    return _read(filepath_or_buffer, kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maxb/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 620, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maxb/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1620, in __init__
    self._engine = self._make_engine(f, self.engine)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/maxb/miniconda3/envs/pypsa-eur/lib/python3.12/site-packages/pandas/io/parsers/readers.py", line 1895, in _make_engine
    raise ValueError(msg)
ValueError: Invalid file path or buffer object type: <class 'snakemake.io.Namedlist'>
@MaxBrehm MaxBrehm added the bug label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant