Skip to content

Commit

Permalink
[ponicode-pull-request] Ponicode wrote new docstrings!
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke authored Mar 21, 2021
1 parent f1ab2ad commit e68dbda
Show file tree
Hide file tree
Showing 9 changed files with 418 additions and 0 deletions.
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):
"""
Generate struct struct struct struct struct.
Args:
exp_inpgen: (todo): 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):
"""
Parse a yaml file.
Args:
datadir: (str): 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):
"""
Parse the yaml text
Args:
datadir: (str): 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 if geomagnetic geomagnetic geom
Args:
prep_inpgen: (bool): 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):
"""
Parse geomagnetic geomagnetic file. geom
Args:
prep_inpgen: (todo): 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):
"""
Parse a geom file and - like object.
Args:
prep_inpgen: (todo): 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):
"""
Generate all brokens.
Args:
prep_inpgen: (todo): write your description
"""
waex.cookies.gen_base(f"{prep_inpgen}/expbrsym.yml")
pass


def test_nobrsym(prep_inpgen):
"""
Èi̇·åıĸæńįģä¸ĭ¶æģ
Args:
prep_inpgen: (bool): write your description
"""
waex.cookies.gen_base(f"{prep_inpgen}/nbrsym.yml")
pass


def test_viz(datadir):
"""
Test if the given datadir exists.
Args:
datadir: (str): write your description
"""
pass


def test_geom_scans(datadir):
"""
Parse geom
Args:
datadir: (str): 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):
"""
R calculate eigenvalue of the eigenvalue isca.
Args:
datadir: (str): 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 run information.
Args:
datadir: (str): 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):
"""
Calculate the surface energy.
Args:
datadir: (str): 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):
"""
Calculate surface surface surface and surface surface.
Args:
datadir: (str): 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):
"""
R calculate surface surface surface surface.
Args:
datadir: (str): 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):
"""
Calculate the energy of the surface energy of the energy.
Args:
datadir: (str): 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):
"""
Determine the energy of the energy of - energy.
Args:
datadir: (str): 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):
"""
R calculate energy of the energy energy of - energy.
Args:
datadir: (str): 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 whether the mass isca or not.
Args:
datadir: (str): 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):
"""
Perform a single - detector is aca.
Args:
datadir: (str): 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 if nstep nstep.
Args:
datadir: (str): 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 for mult_orca is aca.
Args:
datadir: (str): 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):
"""
Perform a mult_orca is a mult_populationca.
Args:
datadir: (str): 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 if theca specca spec is a numpy array.
Args:
datadir: (str): 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 if vpt2 is a 2d array.
Args:
datadir: (str): 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 irradiance.
Args:
datadir: (str): 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

0 comments on commit e68dbda

Please sign in to comment.