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

[Ponicode] Docstrings created #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/io/orca/inpgen/test_multxyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@ def test_multxyz_num(mult_xyz):


def test_multxyz_struct(exp_inpgen):
"""
Multiply the values in the inpgen dictionary.

Args:
exp_inpgen: write your description
"""
waex.cookies.gen_base(f"{exp_inpgen}")
pass
54 changes: 54 additions & 0 deletions tests/io/orca/inpgen/test_orcainpgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ def prep_inpgen(tmpdir_factory):


def test_keywords(datadir):
"""
Test that ymlt has the same keywords as expected

Args:
datadir: write your description
"""
ymlt = waio.inp.inpGenerator(datadir / "orcaBlockKey.yml")
string = f"""
! NUMGRAD
Expand All @@ -48,6 +54,12 @@ def test_keywords(datadir):


def test_blocks(datadir):
"""
Test that ymlt. blocks matches expected blocks

Args:
datadir: write your description
"""
ymlt = waio.inp.inpGenerator(datadir / "orcaBlockKey.yml")
string = """
%method
Expand All @@ -70,6 +82,12 @@ def test_blocks(datadir):


def test_geom_constraint(prep_inpgen):
"""
Test that yaml file has the expected geometry lines

Args:
prep_inpgen: write your description
"""
string = f"""
%geom
Scan
Expand Down Expand Up @@ -101,6 +119,12 @@ def test_geom_constraint(prep_inpgen):


def test_geom_scaniter(prep_inpgen):
"""
Test that yaml file has the expected geometry lines

Args:
prep_inpgen: write your description
"""
string = f"""
%geom
Scan
Expand Down Expand Up @@ -129,6 +153,12 @@ def test_geom_scaniter(prep_inpgen):


def test_geom_maxiter(prep_inpgen):
"""
Test that yaml file has maxiter geometry lines

Args:
prep_inpgen: write your description
"""
string = f"""
%geom
maxiter = 300
Expand All @@ -147,20 +177,44 @@ def test_geom_maxiter(prep_inpgen):


def test_brokensym(prep_inpgen):
"""
Test broken symtabs.

Args:
prep_inpgen: write your description
"""
waex.cookies.gen_base(f"{prep_inpgen}/expbrsym.yml")
pass


def test_nobrsym(prep_inpgen):
"""
This test is a little lame but it s not a good idea to use this.

Args:
prep_inpgen: write your description
"""
waex.cookies.gen_base(f"{prep_inpgen}/nbrsym.yml")
pass


def test_viz(datadir):
"""
Test that the Viz file is properly formatted.

Args:
datadir: write your description
"""
pass


def test_geom_scans(datadir):
"""
Test that ymlt. geomlines matches the expected geometry lines.

Args:
datadir: write your description
"""
ymlt = waio.inp.inpGenerator(datadir / "orcaGeom.yml")
string = f"""
%geom
Expand Down
96 changes: 96 additions & 0 deletions tests/io/orca/singles/test_sp.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,24 @@


def test_orca_get_sp_e(datadir):
"""
Test that the orca - Vis functionality works correctly.

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
np.testing.assert_almost_equal(sEnerg.fin_sp_e.m, -1.01010039)
pass


def test_orca_runinfo(datadir):
"""
Test that the runinfo object is a dict of orca run information.

Args:
datadir: write your description
"""
se = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
se.runinfo = waio.orca.getRunInfo(Path("H2_test/QCISD/spin_01/ENERGY/3-21G/"))
assert se.runinfo == {
Expand All @@ -43,20 +55,38 @@ def test_orca_runinfo(datadir):


def test_orca_mdci_e_bounds(datadir):
"""
Test that a single energy surface with a lower bound is within the range of the DCI.

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
with pytest.raises(ValueError):
sEnerg.single_energy_surface(npoints=34)
pass


def test_orca_energ_error(datadir):
"""
Test that an error is raised when using Orca.

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
with pytest.raises(NotImplementedError):
sEnerg.single_energy_surface(etype="Squid")
pass


def test_orca_energ_empty(datadir):
"""
Test that an orca energie is empty.

Args:
datadir: write your description
"""
warnings.filterwarnings("ignore")
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_uhf.out")
with pytest.raises(ValueError):
Expand Down Expand Up @@ -203,6 +233,12 @@ def test_orca_mdci_e_mtrip_yvals(datadir):


def test_mult_energy_surf(datadir):
"""
Mult the single energy surface with multiple energy surfaces.

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
eDat = sEnerg.single_energy_surface("MDCI w/o Triples", 33)
eDatMDCI = sEnerg.single_energy_surface("MDCI")
Expand All @@ -214,6 +250,12 @@ def test_mult_energy_surf(datadir):


def test_mult_energy_surf_subset(datadir):
"""
Subset of the energies in a sub - set.

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
eDatAll = sEnerg.mult_energy_surface(etype=["MDCI", "SCF Energy"])
assert "Actual Energy" not in eDatAll.columns
Expand All @@ -223,6 +265,12 @@ def test_mult_energy_surf_subset(datadir):


def test_mult_energy_surf_single(datadir):
"""
Multiplier of energy surfaces with single energy surfaces

Args:
datadir: write your description
"""
sEnerg = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
eDatSingleL = sEnerg.mult_energy_surface(etype=["MDCI"])
eDatMDCI = sEnerg.single_energy_surface("MDCI")
Expand All @@ -238,6 +286,12 @@ def test_mult_energy_surf_single(datadir):


def test_orca_single_chargepop(datadir):
"""
Test the orca - vis single - population analysis.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
sdat = spop.single_population_analysis()
assert sdat.shape == (4, 5)
Expand All @@ -249,6 +303,12 @@ def test_orca_single_chargepop(datadir):


def test_orca_single_fullpop(datadir):
"""
Test for orca - single fullpopulation analysis.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "orca_uhf.out")
sdat = spop.single_population_analysis()
assert sdat.shape == (2, 6)
Expand All @@ -261,6 +321,12 @@ def test_orca_single_fullpop(datadir):


def test_orca_nstep_pop(datadir):
"""
Test the orca - vis single population analysis.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "ch3f_3ang_b3lyp.out")
popdat = spop.single_population_analysis()
assert popdat.step.max() == 2
Expand All @@ -276,6 +342,12 @@ def test_orca_nstep_pop(datadir):


def test_orca_mult_chargepop(datadir):
"""
Test the multi - population analysis of the orca - vis data.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "orca_qcisdt.out")
sdat = spop.mult_population_analysis()
assert sdat.shape == (8, 10)
Expand All @@ -284,6 +356,12 @@ def test_orca_mult_chargepop(datadir):


def test_orca_mult_fullpop(datadir):
"""
Variant of orca. orcaVis. mult_population_analysis.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "orca_uhf.out")
sdat = spop.mult_population_analysis()
assert sdat.shape == (4, 11)
Expand All @@ -298,6 +376,12 @@ def test_orca_mult_fullpop(datadir):


def test_orca_irspec(datadir):
"""
Test the IR spec of the orca - Vis dataset.

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "b3lyp_6311g88_h2o.out")
sdat = spop.ir_spec()
assert sdat.shape == (3, 11)
Expand All @@ -316,6 +400,12 @@ def test_orca_irspec(datadir):


def test_orca_vpt2(datadir):
"""
Test the vpt2 transitions of orca via waio. orcaVis

Args:
datadir: write your description
"""
spop = waio.orca.orcaVis(ofile=datadir / "orcaVPT2.out")
sdat = spop.vpt2_transitions()
assert sdat.shape == (3, 9)
Expand Down Expand Up @@ -348,6 +438,12 @@ def test_orca_vpt2(datadir):


def test_calc_htst(datadir):
"""
Calculate the HST using the orca library.

Args:
datadir: write your description
"""
prod = waio.orca.orcaVis(ofile=datadir / "orcaProduct.out")
react = waio.orca.orcaVis(ofile=datadir / "orcaReactant.out")
ts = waio.orca.orcaVis(ofile=datadir / "orcaTS.out")
Expand Down
Loading