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

Turn all numedtuples into attrs classes #214

Merged
merged 2 commits into from
Sep 7, 2020

Conversation

tovrstra
Copy link
Member

@tovrstra tovrstra commented Sep 3, 2020

Fixes #201

Related to #138 and #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 Bad iodata support gbasis#78
  • Minor fixes elsewhere to satisfy attribute validators

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
@tovrstra
Copy link
Member Author

tovrstra commented Sep 3, 2020

The previous two related PRs contain many outdated and redundant comments, which is the reason for making a ne PR. This is the cleaned-up version, which should be easier to review.

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #214 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #214      +/-   ##
==========================================
+ 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              
Impacted Files Coverage Δ
iodata/formats/chgcar.py 98.14% <ø> (ø)
iodata/attrutils.py 100.00% <100.00%> (ø)
iodata/basis.py 100.00% <100.00%> (ø)
iodata/formats/cp2klog.py 97.54% <100.00%> (ø)
iodata/formats/cube.py 100.00% <100.00%> (ø)
iodata/formats/molden.py 91.32% <100.00%> (+0.02%) ⬆️
iodata/iodata.py 100.00% <100.00%> (ø)
iodata/orbitals.py 68.29% <100.00%> (ø)
iodata/overlap.py 100.00% <100.00%> (ø)
iodata/test/test_attrutils.py 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ced6e7e...86c7e87. Read the comment docs.

evohringer
evohringer previously approved these changes Sep 3, 2020
Copy link
Contributor

@evohringer evohringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I´m not very familiar with the attrs class but it looks fine. Only a minor correction and a comment. Learnt a lot reviewing :-)

CONTRIBUTING.rst Outdated Show resolved Hide resolved
iodata/iodata.py Show resolved Hide resolved
@tovrstra
Copy link
Member Author

tovrstra commented Sep 7, 2020

Several people have already reviewed this (including in former PRs), so I'm going to merge this.

@tovrstra tovrstra merged commit c128c3d into theochem:master Sep 7, 2020
@tovrstra tovrstra deleted the attribute_validation branch September 7, 2020 13:07
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

Successfully merging this pull request may close these issues.

Document required attrs package
2 participants