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

sum capacity of grid generators #326

Closed
azizmassano opened this issue Apr 22, 2020 · 2 comments · Fixed by #331
Closed

sum capacity of grid generators #326

azizmassano opened this issue Apr 22, 2020 · 2 comments · Fixed by #331
Assignees

Comments

@azizmassano
Copy link

I've problems running ding0 examples 'example_single_grid_district.py'
when I run run_ding0 it results: 'TypeError: unsupported operand type(s) for +: 'int' and 'str'
specifically, the problem occurs when:
cum_mv_peak_generation = sum([_.capacity for _ in self.grid.generators()])
capacities of generators are string: for example '580', and they cannot be summed together.

can somebody knows if there is an internal error or if I'm doing something wrong?

@gplssm gplssm self-assigned this Jun 8, 2020
@gplssm
Copy link
Contributor

gplssm commented Jun 8, 2020

Sorry for reacting that late! Thanks for reporting!

Seems to me like it's due data being delivered differently. I'll try to fix it.

@gplssm
Copy link
Contributor

gplssm commented Jun 9, 2020

This was quite a nasty thing. Numeric data retrieved from the database was casted into a string. Thus, you ended up with this error, because the sum over an array of strings can't be computed.

The fix will close this error. Then, installing the dev version should run again.

gplssm added a commit that referenced this issue Jun 9, 2020
…-generators

Use updated (unreleased) version of ego.io with fixed type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants