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

Key errors in tools.results.calculate_mvgd_stats() #318

Closed
gplssm opened this issue Nov 27, 2019 · 0 comments · Fixed by #319
Closed

Key errors in tools.results.calculate_mvgd_stats() #318

gplssm opened this issue Nov 27, 2019 · 0 comments · Fixed by #319
Assignees
Labels

Comments

@gplssm
Copy link
Contributor

gplssm commented Nov 27, 2019

Traceback

Traceback (most recent call last):
  File "/home/guido/miniconda3/envs/ding0_tmp/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4736, in get_value
    return libindex.get_value_box(s, key)
  File "pandas/_libs/index.pyx", line 51, in pandas._libs.index.get_value_box
  File "pandas/_libs/index.pyx", line 47, in pandas._libs.index.get_value_at
  File "pandas/_libs/util.pxd", line 98, in pandas._libs.util.get_value_at
  File "pandas/_libs/util.pxd", line 83, in pandas._libs.util.validate_indexer
TypeError: 'str' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "example_analyze_single_grid_district.py", line 71, in <module>
    example_stats(filename)
  File "example_analyze_single_grid_district.py", line 43, in example_stats
    stats = results.calculate_mvgd_stats(nd)
  File "/home/guido/git/ding0_tmp/ding0/tools/results.py", line 587, in calculate_mvgd_stats
    lv_impedance += (G_lv.adj[path[i]][path[i+1]]['branch'].type['L_l'] * 1e-3 * omega * \
  File "/home/guido/miniconda3/envs/ding0_tmp/lib/python3.6/site-packages/pandas/core/series.py", line 1071, in __getitem__
    result = self.index.get_value(self, key)
  File "/home/guido/miniconda3/envs/ding0_tmp/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4744, in get_value
    raise e1
  File "/home/guido/miniconda3/envs/ding0_tmp/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4730, in get_value
    return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None))
  File "pandas/_libs/index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value
  File "pandas/_libs/index.pyx", line 88, in pandas._libs.index.IndexEngine.get_value
  File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'L_l'

Note: it's already resolved in branch fix/#315-deviating-stats by commit feee3a3. But, this commit introduces two unwanted print statement. Therefore,

  1. Cherry pick the commit into fix branch
  2. Remove prints
@gplssm gplssm added the bug label Nov 27, 2019
@gplssm gplssm self-assigned this Nov 27, 2019
gplssm added a commit that referenced this issue Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant