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

Fix Link investment #28

Merged
merged 1 commit into from
Dec 2, 2021
Merged

Fix Link investment #28

merged 1 commit into from
Dec 2, 2021

Conversation

jnnr
Copy link
Member

@jnnr jnnr commented Jun 28, 2021

When running datapackages with expandable Links, _nominal_value returns None, but in Link, a dictionary is expected. This gives the following error:

  File "oemof/tabular/datapackage/reading.py", line 408, in deserialize_energy_system
    resource,
  File "oemof/tabular/datapackage/reading.py", line 102, in read_facade
    instance = create(mapping, facade, facade)
  File "oemof/tabular/datapackage/reading.py", line 288, in create
    instance = cls(**remap(init, attributemap, cls))
  File "oemof/tabular/facades.py", line 1407, in __init__
    self.build_solph_components()
  File "oemof/tabular/facades.py", line 1420, in build_solph_components
    nominal_value=self._nominal_value()["to_from"],
TypeError: 'NoneType' object is not subscriptable

This PR fixes that bug by introducing a conditional for the case of capacity expansion in _nominal_value.

@jnnr jnnr changed the base branch from master to dev June 28, 2021 18:21
@jnnr jnnr added the bug Something isn't working label Jun 28, 2021
@jnnr jnnr requested a review from simnh June 28, 2021 18:54
@jnnr jnnr merged commit a569a5a into dev Dec 2, 2021
@jnnr jnnr deleted the fix/link-investment branch December 2, 2021 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant