Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede committed Jun 30, 2024
1 parent 2feace3 commit 8761f4a
Show file tree
Hide file tree
Showing 31 changed files with 721 additions and 530 deletions.
2 changes: 1 addition & 1 deletion examples/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Simple integral interface.
Simple integral interface. Can be helpful for testing.
"""
from pathlib import Path

Expand Down
2 changes: 1 addition & 1 deletion examples/limitation_xitorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Calculating forces for vancomycin via AD.
Example for xitorch's inability to be used together with functorch.
"""
from pathlib import Path

Expand Down
4 changes: 2 additions & 2 deletions src/dxtb/_src/cli/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _set_attr(self, attr: str) -> int | list[int]:
for path in self.base:
# use charge (or spin) from file or set to zero
if Path(path, FILES[attr]).is_file():
vals.append(io.read_chrg(Path(path, FILES[attr])))
vals.append(read.read_chrg_from_path(Path(path, FILES[attr])))

Check warning on line 111 in src/dxtb/_src/cli/driver.py

View check run for this annotation

Codecov / codecov/patch

src/dxtb/_src/cli/driver.py#L111

Added line #L111 was not covered by tests
else:
vals.append(0)

Expand Down Expand Up @@ -176,7 +176,7 @@ def singlepoint(self) -> Result | None:
numbers = pack(_n)
positions = pack(_p)
else:
_n, _p = io.read_structure_from_file(args.file[0], args.filetype)
_n, _p = read.read_from_path(args.file[0], args.filetype)
numbers = torch.tensor(_n, dtype=torch.long, device=dd["device"])
positions = torch.tensor(_p, **dd)

Expand Down
10 changes: 0 additions & 10 deletions src/dxtb/_src/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,5 @@
Functions for reading and writing files.
"""

from . import read
from .handler import *
from .logutils import DEFAULT_LOG_CONFIG
from .output import *
from .read import (
read_chrg,
read_coord,
read_orca_engrad,
read_qcschema,
read_structure_from_file,
read_xyz,
)
2 changes: 1 addition & 1 deletion src/dxtb/_src/io/logutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Logging
Logging.
"""

from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion src/dxtb/_src/io/output/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
WIDTH = 70


def get_header() -> str:
def get_header() -> str: # pragma: no cover
logo = [
r" _ _ _ ",
r" | | | | | | ",
Expand Down
6 changes: 3 additions & 3 deletions src/dxtb/_src/io/output/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import platform

import torch

from dxtb._src.typing import Any
from dxtb.__version__ import __tversion__

__all__ = [
Expand Down Expand Up @@ -70,7 +70,7 @@ def get_system_info():
}


def get_pytorch_info():
def get_pytorch_info() -> dict[str, Any]: # pragma: no cover
is_cuda = torch.cuda.is_available()

backends = []
Expand Down Expand Up @@ -129,7 +129,7 @@ def get_pytorch_info():
}


def print_system_info(punit=print):
def print_system_info(punit=print) -> None: # pragma: no cover
system_info = get_system_info()["System Information"]
pytorch_info = get_pytorch_info()["PyTorch Information"]
sep = 17
Expand Down
Loading

0 comments on commit 8761f4a

Please sign in to comment.