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

Problem with new version of numpy #166

Closed
echaussidon opened this issue Jun 25, 2023 · 5 comments
Closed

Problem with new version of numpy #166

echaussidon opened this issue Jun 25, 2023 · 5 comments
Assignees

Comments

@echaussidon
Copy link

Hi,

I'm using python3.10 with numpy = 1.24.3.

except IndexError:

does not raise 'IndexError' but 'ValueError'. So, I cannot use the code, as it is.

Instead of playing with the exception, I suggest to just try the shape of this file:

if np.loadtxt(infile).shape[1] == 8:
DO
else:
DO

@weaverba137
Copy link
Member

@sbailey, when I look at the git history, it looks like you created that line, with commit f95b26b. It's not exactly clear at first glance what the most desirable outcome of this function is. In other words, do we have to continue supporting both methods of loading the data?

@dstndstn
Copy link
Contributor

I just hit this error. I note that the current version of the file in desimodel-data (0.18.0 and trunk) has only 8 columns, so the way the code first tries to read the file will always fail, and it depends on getting an IndexError in order to do the right thing, while some versions of numpy instead raise a ValueError. So at the very least, the expected path should be the path that doesn't demand the right kind of exception being raised :)

@dstndstn
Copy link
Contributor

Minimal change would be to make line 377

except (IndexError,ValueError): 

@sbailey
Copy link
Contributor

sbailey commented Aug 16, 2023

This dates back to a very early version of the file and supporting the transition period after the "arclength" column was dropped from the file provided by the engineering team. I'm fine with either updating the code to support only the current format, or updating to except (IndexError, ValueError): as the minimal change to restore functionality.

@moustakas
Copy link
Member

Looks like this issue was addressed by @dstndstn in a98e1ef; closing.

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

5 participants