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

Error when retrieving parameters for materials that are not built-in properties (like "Na") #17

Open
Tracked by #16
dalonsoa opened this issue Oct 19, 2022 · 0 comments
Labels
bug Something isn't working Hacktoberfest

Comments

@dalonsoa
Copy link
Contributor

dalonsoa commented Oct 19, 2022

Problem

When trying to retrieve parameters for materials that are not built-in properties, like the doping concentration Na or Nd, the material retrieval fails. This is done in this line:

prop = solcore_mat.__getattr__(key) / ps.conversion[key]

The reason is that actual instance attributes are not really search by the overwritten __getattr__ method in solcore:

https://github.com/qpv-research-group/solcore5/blob/a5e0dae8f445cf43922c1e65bbfd6bbf644ac69b/solcore/material_system/material_system.py#L301

Possible solution

Ideally, the solution should be implemented in solcore adding a default call to the parent's __getattr__ after the custom one has gone through several options and before calling ParameterSystem. The simplest, sunglass only solution would be to check __getattribute__ IF AND ONLY IF __getattr__ fails as the first one checks the whole spectrum of attributes of the material.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant