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

update_inclusive_columns fails with AttributeError #106

Open
ilumsden opened this issue Sep 5, 2023 · 0 comments
Open

update_inclusive_columns fails with AttributeError #106

ilumsden opened this issue Sep 5, 2023 · 0 comments

Comments

@ilumsden
Copy link
Collaborator

ilumsden commented Sep 5, 2023

When running update_inclusive_columns on various datasets with a row MultiIndex, the function errors with an AttributeError. I originally discovered this while testing profiles associated with DYAD. I've managed to reproduce using HPCToolkit data in the Hatchet unit tests, but I'm not sure if HPCToolkit is still supported due to changes in the database format. So, I've attached the Caliper file from my DYAD testing. Because of GitHub requirements, I had to convert the file to a .txt file. It can be converted back into a .cali file by just changing the file extension. The code to reproduce is simply:

import hatchet as ht
gf = ht.GraphFrame.from_caliperreader("cons.cali")
gf.update_inclusive_columns()

On Corona, this fails with the following traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/WS2/lumsden1/hatchet/hatchet/graphframe.py", line 883, in update_inclusive_columns
    self.subgraph_sum(self.exc_metrics, self.inc_metrics)
  File "/usr/WS2/lumsden1/hatchet/hatchet/graphframe.py", line 725, in subgraph_sum
    self.subtree_sum(columns, out_columns, function)
  File "/usr/WS2/lumsden1/hatchet/hatchet/graphframe.py", line 694, in subtree_sum
    self.dataframe.loc[df_index1, col] = function(
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexing.py", line 814, in __setitem__
    indexer = self._get_setitem_indexer(key)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexing.py", line 692, in _get_setitem_indexer
    return ax.get_loc(key)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 2945, in get_loc
    start, stop = self.slice_locs(lead_key, lead_key)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 2775, in slice_locs
    return super().slice_locs(start, end, step)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6810, in slice_locs
    start_slice = self.get_slice_bound(start, "left")
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 2714, in get_slice_bound
    return self._partial_tup_index(label, side=side)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 2793, in _partial_tup_index
    loc = algos.searchsorted(lev, lab, side=side)
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1665, in searchsorted
    return arr.searchsorted(value, side=side, sorter=sorter)  # type: ignore[arg-type]
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/base.py", line 1298, in searchsorted
    return algorithms.searchsorted(
  File "/collab/usr/gapps/python/build/spack-toss4.2/var/spack/environments/python310/._view/i74j3perqsso644fvgbrjnzhyuvpn42l/lib/python3.10/site-packages/pandas/core/algorithms.py", line 1665, in searchsorted
    return arr.searchsorted(value, side=side, sorter=sorter)  # type: ignore[arg-type]
  File "/usr/WS2/lumsden1/hatchet/hatchet/node.py", line 197, in __lt__
    return self._hatchet_nid < other._hatchet_nid
AttributeError: 'int' object has no attribute '_hatchet_nid'

cons.txt

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

No branches or pull requests

1 participant