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

Bug in bmi_Ku.py when setting values #86

Open
ethan-pierce opened this issue Jun 14, 2023 · 1 comment
Open

Bug in bmi_Ku.py when setting values #86

ethan-pierce opened this issue Jun 14, 2023 · 1 comment
Assignees

Comments

@ethan-pierce
Copy link
Collaborator

In the BMI for Ku, set_value() calls the built-in getattr(), which raises an error because getattr() can't assign values. This is also a problem with set_value_at_indices().

https://github.com/permamodel/permamodel/blame/3d091411d115a2617d4cb686e5c65b4c0cd9b926/permamodel/components/bmi_Ku.py#L231

@ethan-pierce ethan-pierce self-assigned this Jun 14, 2023
@ethan-pierce
Copy link
Collaborator Author

Fixing this is not as simple as replacing getattr() with setattr(), as Ku expects xarray DataArrays for attribute fields related to model variables. (And the rest of the BMI expects to access field arrays using an attribute.values[:] syntax, which is not supported by numpy.)

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