Skip to content

Commit

Permalink
Running precommit to fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yonatank93 committed Oct 7, 2024
1 parent bf9b73b commit 5a2aaad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion tests/uq/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

import pytest

from kliff.models import KIMModel
from kliff.dataset import Dataset
from kliff.models import KIMModel


@pytest.fixture(scope="session")
Expand Down
7 changes: 4 additions & 3 deletions tests/uq/test_bootstrap_empirical.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

import numpy as np
import pytest
from scipy.optimize import OptimizeResult

from kliff.calculators.calculator import Calculator, _WrapperCalculator
Expand Down Expand Up @@ -106,7 +105,9 @@ def test_bootstrap_cas_generator(BS_1calc, calc_forces):

# Test the shape of bootstrap cas samples if we specify the number of cas to generate
ncas = ncas_forces - 1
bootstrap_cas_2 = bootstrap_cas_generator_empirical(nsamples, [cas_forces], ncas=ncas)
bootstrap_cas_2 = bootstrap_cas_generator_empirical(
nsamples, [cas_forces], ncas=ncas
)
assert np.all(
[
[len(bs_cas) == ncas for bs_cas in bootstrap_cas_2[ii]]
Expand Down
4 changes: 3 additions & 1 deletion tests/uq/test_bootstrap_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def test_bootstrap_cas_generator(BS, fingerprints):
assert np.all(
[len(bs_cas) == fingerprints[1] for _, bs_cas in bootstrap_cas.items()]
), "For each sample, generator should generate the same number of cas as the original"
assert BS._nsamples_prepared == nsamples, "`_nsamples_prepared` property doesn't work"
assert (
BS._nsamples_prepared == nsamples
), "`_nsamples_prepared` property doesn't work"

# Test the shape of bootstrap cas samples if we specify the number of cas to generate
nfp = fingerprints[1] - 1
Expand Down
6 changes: 4 additions & 2 deletions tests/uq/test_bootstrap_nn_separate_species.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from pathlib import Path
import pytest

import numpy as np
import pytest

from kliff import nn
from kliff.calculators.calculator_torch import CalculatorTorchSeparateSpecies
Expand Down Expand Up @@ -93,7 +93,9 @@ def test_original_state(BS, uq_nn_orig_state_filename):
), "There should be 2 elements in orig_state_filename"
# check elements
splitted_path = os.path.splitext(uq_nn_orig_state_filename)
fnames = [Path(splitted_path[0] + f"_{el}" + splitted_path[1]) for el in ["Si", "C"]]
fnames = [
Path(splitted_path[0] + f"_{el}" + splitted_path[1]) for el in ["Si", "C"]
]
assert np.all(
[str(fname) in BS.orig_state_filename for fname in fnames]
), "Not all original state filename are listed"
Expand Down

0 comments on commit 5a2aaad

Please sign in to comment.