Conversation
|
Hi @tovrstra, I made the PR to include all the errors from running @msricher commented that we don't use any annotation in Gbasis (I think IOData and Grid does) and then the one we are more unsure about it is the |
|
Ruff has recommendations for every error message it can generate and these are usually quite informative: https://docs.astral.sh/ruff/rules/ I'll try to give some advice for each type of problem;
class POINT(Structure):
_fields_ = ("x", c_int), ("y", c_int)I'm not sure if that will solve the Ruff message, but it is a useful change anyway. There is no reason to have a mutable
cfunc = self._cache.get(attr)
if cfunc is None:
cfunc = self._get_cfunc(attr)
self._cache[attr] = cfunc
return cfuncInside the helper method
|
|
P.S. If you prefer to stick to EAPF, which is certainly fine, then you can fix raise ValueError(f"there is no ``gbasis`` API for the function {attr}") from None`The more elaborate option would be: try:
cfunc = self._cache[attr]
except KeyError as exc:
...
else:
raise ValueError(f"there is no ``gbasis`` API for the function {attr}") from excThe second form seems less suited here because the KeyError is related to the caching and will not offer useful information. |
This PR addresses the request posted on issue #192 and includes the missing parts of PR #151 that were not included in #137. This also relates to PR #187.
Checklist
Add tests for each unit of code added (e.g. function, class)Update documentationSquash commits that can be grouped togetherType of Changes
Related