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

Factory method for make (fanci) script #9

Merged
merged 9 commits into from
Oct 3, 2024

Conversation

kzsigmond
Copy link
Contributor

What changed

Created a factory method for wfn_type in make_script and make_fanci_script. Added option for custom wave function type.

Why

Previously one had to edit the output of make_script if the wave function was not in make_script.

How

make_script gets a method for a given wfn_type from get_wfn_info. These wfn_type dependent methods return the import_line, wfn_name, and wfn_kwargs, which make_scripts uses later. The custom wave function method looks for wfn_name and import_from in wfn_kwargs. For example, wfn_kwarg for the CISD wave function would be wfn_kwargs = "wfn_name = CISD, import_from = fanpy.wfn.ci.cisd"

Testing

  • comparison of old wfn information and information from factory
  • test to see if the from import line still works
  • test for raising ValueError for incorrect wfn_type
  • used the write_wfn_py method of run_calc to generate calculate.py for custom and cisd wfn_type

@ramirandaq ramirandaq merged commit 21a3e45 into mqcomplab:main Oct 3, 2024
@kzsigmond kzsigmond deleted the make_script branch October 4, 2024 15:02
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.

2 participants