Skip to content

Error calling function PseudoIsingBlockState.get_S()

Bug reports:

Minimal example code:

import graph_tool.all as gt
import numpy as np

data = np.array([[1,1],[1,1]])
lstate = gt.PseudoIsingBlockState(data)

lstate.get_S()

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.12/dist-packages/graph_tool/inference/reconstruction.py", line 1862, in get_S
    return DynamicsBlockStateBase.entropy(self, sbm=False, tdist=False,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/graph_tool/inference/base_states.py", line 94, in entropy
    return self._entropy(**dict(self.get_entropy_args(), **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/graph_tool/inference/base_states.py", line 49, in wrapper
    S = func(self, *args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/graph_tool/inference/reconstruction.py", line 426, in _entropy
    eargs = self._get_entropy_args(locals())
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/graph_tool/inference/base_states.py", line 187, in _get_entropy_args
    setattr(ea, arg, eargs.pop(arg, self._entropy_args[arg]))
AttributeError: 'bool' object has no attribute '__iter__'. Did you mean: '__str__'?
  • Operating system: Ubuntu 24.04.2 LTS
  • Python version: Python 3.12.3
  • Compiler: gcc 13.3.0
  • Boost version: 1.83.0.1ubuntu2

Please follow the general troubleshooting steps first:

  • Are you running the latest graph-tool version?
    • Do you observe the problem with the current git version?
  • Are you using Macports or Homebrew? If yes, please submit an issue there instead: https://github.com/Homebrew/brew/issues and https://trac.macports.org/newticket
  • Did you compile graph-tool manually?
  • If you answered yes above, did you use the exact same compiler to build graph-tool, boost-python and Python?

Do not forget to supply the following information:

  • A minimal and self-contained example that shows the problem.
  • Your operating system.
  • The Python version you are using.
  • If you compiled graph-tool manually: Your compiler version, as well as the version of Boost being used.
  • If you are reporting a compilation error, please provide the entire ./configure output, as well as the entire contents of the config.log file and the entire compilation output.
Edited by Bukyoung Jhun