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

Moved dunders to impl__ implementation in trees #104

Merged
merged 5 commits into from
Aug 26, 2023

Conversation

bjorgve
Copy link
Member

@bjorgve bjorgve commented Jul 16, 2023

First take on moving lambdas away from dunders.

I also found that I could use overload_cast and avoid dunders like these:

def(
            "__iadd__",
            [](FunctionTree<D> *out, FunctionTree<D> *inp) { return impl__add__<D>(out, inp); },

Is this okey @robertodr ?

Do you think all lambdas should be reimplemented like this?

@bjorgve bjorgve requested a review from robertodr July 16, 2023 19:13
@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (a446b2b) 90.90% compared to head (3a50084) 90.90%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #104   +/-   ##
=======================================
  Coverage   90.90%   90.90%           
=======================================
  Files           3        3           
  Lines         187      187           
=======================================
  Hits          170      170           
  Misses         17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/vampyr/trees/trees.h Outdated Show resolved Hide resolved
src/vampyr/trees/trees.h Outdated Show resolved Hide resolved
src/vampyr/trees/trees.h Outdated Show resolved Hide resolved
@robertodr
Copy link
Contributor

I think the overload_cast is not needed, but I'm actually not so sure. If it's needed, I find it a bit confusing1 and would instead use the form with the lambdas.

Footnotes

  1. Overloading is when a function with the same name accepts different arguments (more/less and/or different types) Here you're binding to Python functions with different names.

@bjorgve
Copy link
Member Author

bjorgve commented Jul 17, 2023

Updated. I was sure I had tested, and concluded overload cast was needed.

Apparently not.

@robertodr robertodr merged commit c0eb87c into MRChemSoft:master Aug 26, 2023
10 checks passed
stigrj added a commit that referenced this pull request Dec 7, 2023
* Update readme

* Try to fix binder.yml workflow

* Do not run binder.yml on PRs

* Add quadrature to MWNode and FunctionTree

* Update src/vampyr/trees/trees.h

* Throw exceiption in 1D and 2D f_tree quadrature requests.

As suggested by Roberto. Thanks

* __add__ and __iadd__

* Update pybind so it works with newer python versions (#103)

* Fix RTD builds (#108)

* Moved dunders to impl__ implementation in trees (#104)




Co-authored-by: Roberto Di Remigio Eikås <roberto@totaltrash.xyz>

* Work on documentation

* Add hydrogen atom example

* Add helium atom

* Avoid killed kernel with badly defined analytic functions

* update convolution operator and add comment to error catch

* Add Beryllium atom notebook

* Update notebooks

* Update link to current mrcpp master

* Run clang-format

* Update MRCPP version to fetch

* Add matplotlib, safeguard in plotter.py

* Run black+isort on Python files

* better solvent notebook (#107)


Co-authored-by: Roberto Di Remigio Eikås <roberto@totaltrash.xyz>

* Add authorship and instruction cells above executable cells (#110)

* Remove repetition from `index.rst` (#112)

* linked vampyr to the timeevol branch of evgeniy's fork

* added _skbuild/ to .gitignore

* added complex apply

* added time evolution operator in 1d

* minor changes to convolutions.h

* Time evolution operator can now be imported

* added filter class to get filter matrices U, H0, and so on

* linked vampyr back to the master mrcpp branch

* added a time evolution test

* small changes proposed by a reviewer

* def test_time_evolution():

* documentation

* docs

* docs

* removed some stuff from notebook messing with other cells

* Preparing v1.0rc1

---------

Co-authored-by: Magnar Bjorgve <magnbjor@gmail.com>
Co-authored-by: Roberto Di Remigio Eikås <robertodr@users.noreply.github.com>
Co-authored-by: Roberto Di Remigio Eikås <roberto@totaltrash.xyz>
Co-authored-by: Gabriel <gabriel.a.gerez.s@uit.no>
Co-authored-by: edinvay <evgeni36@yandex.ru>
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.

None yet

2 participants