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

Numpy 1.20-> dtype deprecation #117

Open
hakkinenarttu opened this issue Jan 24, 2025 · 0 comments
Open

Numpy 1.20-> dtype deprecation #117

hakkinenarttu opened this issue Jan 24, 2025 · 0 comments

Comments

@hakkinenarttu
Copy link

Description

As of numpy 1.20 the dtype np.bool has been deprecated, and should be np.bool_ (see https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations).

In hmc.py the stats_dtypes definition should be changed to:

stats_dtypes = [
        {
            "step_size": np.float64,
            "n_steps": np.int64,
            "tune": np.bool_,
            "step_size_bar": np.float64,
            "accept": np.float64,
            "diverging": np.bool_,
            "energy_error": np.float64,
            "energy": np.float64,
            "path_length": np.float64,
            "accepted": np.bool_,
            "model_logp": np.float64,
        }
    ]

And in nuts.py similarly to:

stats_dtypes = [
      {
          "depth": np.int64,
          "step_size": np.float64,
          "tune": np.bool_,
          "mean_tree_accept": np.float64,
          "step_size_bar": np.float64,
          "tree_size": np.float64,
          "diverging": np.bool_,
          "energy_error": np.float64,
          "energy": np.float64,
          "max_energy_error": np.float64,
          "model_logp": np.float64,
      }
  ]
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