Incorrect parameter sanitation to np.logspace
yohad opened this issue · 2 comments
Bug report
Bug summary
In function b2t in frontends/art/io.py
, the call to np.logspace passes the third argument without validating it is an integer.
Code for reproduction
When loading my database I get n=100.0 when trying to load ("stars", "particle_creation_time")
Version Information
- Operating System: Linux Cluster (not sure which OS)
- Python Version: 3.12.2
- yt version: 4.3.1
- Other Libraries (if applicable): numpy=1.26.4
installed yt from conda-forge
Hi, and welcome to yt! Thanks for opening your first issue. We have an issue template that helps us to gather relevant information to help diagnosing and fixing the issue.
Thanks for reporting !
Indeed, np.logspace
's third argument doesn't accept float values, which means the default value we use in the following function is broken
Lines 630 to 638 in e9ba8ac
There are a couple ways we can address this, but there's precedent in just converting to int
on the fly in this situation in the very same module:
Line 592 in e9ba8ac
So I'll open a PR to do just that.