-
Notifications
You must be signed in to change notification settings - Fork 48
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
Convert all remaining namedtuples to attr classes #157
Conversation
The motivation for the changes in this PR are outlined in more detail in #138. Most changes from that PR were also used here, but with some modifications and corrections. |
@FarnazH I removed the code again that explicitly runs the validators before dumping and after loading. Even without these, just by turning |
@FarnazH One thing we should consider adding here is to update all NamedTuple classes into attr classes. This may resolve issues like the one you mentioned here: #188 (comment) |
e2ec8c3
to
db297ac
Compare
@wilhadams This PR switches all namedtuples to attr classes, adding more validation and a few minor bug fixes. Does the last section in |
9af6cef
to
cda1f95
Compare
This introduces additional attribute validation, which fixes some silly bugs.
cda1f95
to
9b66202
Compare
Codecov Report
@@ Coverage Diff @@
## master #157 +/- ##
==========================================
+ Coverage 95.56% 95.65% +0.09%
==========================================
Files 61 63 +2
Lines 6605 6743 +138
Branches 847 865 +18
==========================================
+ Hits 6312 6450 +138
Misses 136 136
Partials 157 157
Continue to review full report at Codecov.
|
I'm going to close this PR and reopen it because most of the comments above are outdated. |
Fixes theochem#201 Related to theochem#138 and theochem#157 (which were earlier attempts) This PR includes: - Attribute validation (to large extent, not every detail) - attrutil module to facilitate validation of array attributes - Documentation of how attrs is used in IOData - Bug fix in CP2K loader - Minor fixes elsewhere
Fixes theochem#201 Related to theochem#138 and theochem#157 (which were earlier attempts) This PR includes: - Attribute validation (to large extent, not every detail) - attrutil module to facilitate validation of array attributes - Documentation of how attrs is used in IOData - Bug fix in CP2K loader - Minor fixes elsewhere
Fixes theochem#201 Related to theochem#138 and theochem#157 (which were earlier attempts) This PR includes: - Attribute validation (to large extent, not every detail) - attrutil module to facilitate validation of array attributes - Documentation of how attrs is used in IOData - Bug fix in CP2K loader, related to theochem/gbasis#78 - Minor fixes elsewhere to satisfy attribute validators
Fixes #201 amongst other things:
attrutil
module to facilitate writing validators.CONTRIBUTING.rst