Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Single shells #539

Merged
merged 5 commits into from
Aug 20, 2020
Merged

Single shells #539

merged 5 commits into from
Aug 20, 2020

Conversation

JensWehner
Copy link
Member

implements #538

Shells do now have a single enum which tells their L value.

@JensWehner
Copy link
Member Author

@votca-bot changelog: xtp internally uses only single shells.

@codecov
Copy link

codecov bot commented Aug 19, 2020

Codecov Report

Merging #539 into master will decrease coverage by 0.2%.
The diff coverage is 90.2%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #539     +/-   ##
========================================
- Coverage    54.8%   54.5%   -0.3%     
========================================
  Files         291     291             
  Lines       30574   30334    -240     
========================================
- Hits        16761   16543    -218     
+ Misses      13813   13791     -22     
Impacted Files Coverage Δ
include/votca/xtp/ecpaobasis.h 66.6% <ø> (ø)
include/votca/xtp/eeinteractor.h 75.0% <ø> (-13.9%) ⬇️
src/libxtp/ecpaoshell.cc 0.0% <0.0%> (ø)
src/libxtp/qmpackages/orca.h 100.0% <ø> (ø)
src/libxtp/ecpbasisset.cc 58.5% <40.0%> (-2.1%) ⬇️
src/libxtp/qmpackages/orca.cc 65.7% <61.5%> (+1.1%) ⬆️
src/libxtp/basisset.cc 73.1% <83.6%> (-10.1%) ⬇️
src/libxtp/aomatrices/aoecp.cc 96.7% <90.9%> (-0.2%) ⬇️
src/libxtp/aoshell.cc 93.3% <96.5%> (+2.7%) ⬆️
include/votca/xtp/aoshell.h 98.2% <100.0%> (+1.3%) ⬆️
... and 19 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 34ccd94...6188442. Read the comment docs.

Copy link
Member

@felipeZ felipeZ left a comment

Choose a reason for hiding this comment

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

Great work:

  1. It is more clear
  2. some duplicated functionality has been removed
  3. This changes pave the way to introduced LibInt in the future

@@ -187,106 +94,12 @@ BOOST_AUTO_TEST_CASE(large_l_test) {
// we only check the first and last 600 values because this gets silly quite
// quickly
Eigen::Map<Eigen::VectorXd> mapped_result(block.data(), block.size());
Eigen::VectorXd ref_head = Eigen::VectorXd::Zero(600);
Copy link
Member

@felipeZ felipeZ Aug 20, 2020

Choose a reason for hiding this comment

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

removing this vector is great!

@@ -147,31 +73,12 @@ BOOST_AUTO_TEST_CASE(small_l_test) {
}

BOOST_AUTO_TEST_CASE(large_l_test) {
std::ofstream xyzfile("C2.xyz");
Copy link
Member

Choose a reason for hiding this comment

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

this is so much better!


bool CheckShellType(const std::string& shelltype);
enum class L { S = 0, P = 1, D = 2, F = 3, G = 4, H = 5, I = 6 };
Copy link
Member

Choose a reason for hiding this comment

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

This really improves readability!

}
return nbf;
return "";
Copy link
Member

Choose a reason for hiding this comment

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

Why not raising an error here?

Copy link
Member Author

Choose a reason for hiding this comment

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

If I am not mistaken you will get a compiler warning if you do not treat the whole enum so this cannot happen anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

thanks, I didn't know!

}
return nbf;
return -1;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a case where this -1 could be a problem?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should never happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure I did it to get rid of the compiler warning

Copy link
Collaborator

@rubengerritsen rubengerritsen left a comment

Choose a reason for hiding this comment

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

Very nice, it makes the code way easier to understand

case L::H:
return "H";
case L::I:
return "I";
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a default that throws an error, same for the switches that follow this one

Copy link
Member Author

Choose a reason for hiding this comment

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

yes I agree. I hope that it actually produces a compiler warning if you do not treat all the enum cases, so that you do not need a default.

Copy link
Member Author

Choose a reason for hiding this comment

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

https://stackoverflow.com/questions/37254496/c-warning-enumeration-value-not-handled-in-switch-wswitch actually without the default you get a compiler warning, which I prefer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Me to, didn't know about that

@JensWehner JensWehner merged commit 319a6d2 into master Aug 20, 2020
@JensWehner JensWehner deleted the single_shells branch August 20, 2020 12:55
votca-bot added a commit to votca/votca that referenced this pull request Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants