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

Sometimes state() can return NaN while leaving -1 in the quality array, which can be confusing. #47

Open
jranalli opened this issue Aug 18, 2022 · 0 comments
Labels

Comments

@jranalli
Copy link
Collaborator

One of our old documented bugs that was deemed to be a fix that should be handled later. Just migrating it here in github for better workflow now that 2.2 was released.

TestCode

w = pm.get('mp.H2O')

h = [1694.095, 4372, 4373]  # kJ/kg
p = [5, 100, 1000]  # bar
ans = w.state(h=h, p=p)  # expect ans['x'] = [0.5, -1, np.nan]

Former reply: The “right” way to handle this is to have _argparse maintain a separate index array that points to all out-of-bounds indices while it’s working. Then, at the final step, it should force NaN on all of those indices to all results. The tidiest way to do this would be to modify the _argparse structure so that there is only one return line and to modify _hybrid1 to return an out-of-bounds index list. I'm willing to do that, but I’d like to leave it for a later revision.

@jranalli jranalli added the bug label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant