Skip to content

Commit

Permalink
AI-inspired changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tovrstra committed Jul 11, 2024
1 parent 8708ad3 commit 62dc5dd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions iodata/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def prepare_unrestricted_aminusb(data: IOData, allow_changes: bool, filename: st
-------
data
The given data object if no conversion took place,
or a shallow copy with some new attriubtes.
or a shallow copy with some new attributes.
Raises
------
Expand Down Expand Up @@ -113,7 +113,7 @@ def prepare_segmented(data: IOData, keep_sp: bool, allow_changes: bool, filename
-------
data
The given data object if no conversion took place,
or a shallow copy with some new attriubtes.
or a shallow copy with some new attributes.
Raises
------
Expand Down
8 changes: 8 additions & 0 deletions iodata/test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,11 @@ def test_convert_to_segmented_sp():
assert_equal(shell3.kinds, ["p"])
assert_equal(shell3.exponents, obasis0.shells[1].exponents)
assert_equal(shell3.coeffs, obasis0.shells[1].coeffs[:, 1:])


def test_convert_to_segmented_empty():
obasis0 = MolecularBasis([], HORTON2_CONVENTIONS, "L2")
obasis1 = convert_to_segmented(obasis0, keep_sp=False)
assert len(obasis1.shells) == 0
obasis2 = convert_to_segmented(obasis0, keep_sp=True)
assert len(obasis2.shells) == 0
11 changes: 5 additions & 6 deletions iodata/test/test_molden.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,11 @@ def test_load_molden_f():
],
)
def test_load_dump_consistency(tmpdir, fn, match, allow_changes):
with as_file(files("iodata.test.data").joinpath(fn)) as file_name:
if match is None:
mol1 = load_one(str(file_name))
else:
with pytest.warns(LoadWarning, match=match):
mol1 = load_one(str(file_name))
with ExitStack() as stack:
file_name = stack.enter_context(as_file(files("iodata.test.data").joinpath(fn)))
if match is not None:
stack.enter_context(pytest.warns(LoadWarning, match=match))
mol1 = load_one(file_name)
fn_tmp = os.path.join(tmpdir, "foo.bar")
if allow_changes:
with pytest.warns(PrepareDumpWarning):
Expand Down

0 comments on commit 62dc5dd

Please sign in to comment.