From 90d4e64e87d97f4ab7605393eeeeba4a88891c20 Mon Sep 17 00:00:00 2001 From: bpuchala Date: Fri, 20 Dec 2024 01:27:14 -0500 Subject: [PATCH] Formatting --- python/libcasm/monte/__init__.py | 1 + python/libcasm/monte/events/__init__.py | 1 + python/libcasm/monte/ising_cpp/__init__.py | 1 + python/libcasm/monte/ising_py/__init__.py | 1 + python/libcasm/monte/ising_py/_model.py | 6 +++--- python/libcasm/monte/methods/__init__.py | 1 + python/tests/ising_cpp/test_ising_cpp_custom_functions.py | 1 + .../tests/ising_cpp/test_ising_semigrand_canonical_cpp.py | 1 + .../tests/ising_py/test_ising_semigrand_canonical_mixed.py | 1 + python/tests/ising_py/test_ising_semigrand_canonical_py.py | 1 + 10 files changed, 12 insertions(+), 3 deletions(-) diff --git a/python/libcasm/monte/__init__.py b/python/libcasm/monte/__init__.py index d8e8b7f..88b650f 100644 --- a/python/libcasm/monte/__init__.py +++ b/python/libcasm/monte/__init__.py @@ -1,4 +1,5 @@ """libcasm-monte: CASM Monte Carlo tools""" + from ._monte import ( MethodLog, RandomNumberEngine, diff --git a/python/libcasm/monte/events/__init__.py b/python/libcasm/monte/events/__init__.py index 1c6db4c..8e1742e 100644 --- a/python/libcasm/monte/events/__init__.py +++ b/python/libcasm/monte/events/__init__.py @@ -1,4 +1,5 @@ """Monte Carlo event application and occupant tracking""" + from ._monte_events import ( Atom, AtomLocation, diff --git a/python/libcasm/monte/ising_cpp/__init__.py b/python/libcasm/monte/ising_cpp/__init__.py index b2c4701..93c2e2c 100644 --- a/python/libcasm/monte/ising_cpp/__init__.py +++ b/python/libcasm/monte/ising_cpp/__init__.py @@ -1,4 +1,5 @@ """Python interface to C++ 2d square lattice Ising model""" + from ._monte_ising_cpp import ( IsingConfiguration, IsingFormationEnergy, diff --git a/python/libcasm/monte/ising_py/__init__.py b/python/libcasm/monte/ising_py/__init__.py index ca6ba1b..8810b96 100644 --- a/python/libcasm/monte/ising_py/__init__.py +++ b/python/libcasm/monte/ising_py/__init__.py @@ -1,4 +1,5 @@ """Pure Python 2d square lattice Ising model""" + from ._model import ( IsingConfiguration, IsingFormationEnergy, diff --git a/python/libcasm/monte/ising_py/_model.py b/python/libcasm/monte/ising_py/_model.py index 69e2007..0c63394 100644 --- a/python/libcasm/monte/ising_py/_model.py +++ b/python/libcasm/monte/ising_py/_model.py @@ -65,9 +65,9 @@ def occ(self, linear_site_index: int) -> np.int32: def set_occ(self, linear_site_index: int, new_occ: int) -> None: """Set the current occupation of one site""" - self._occupation[ - np.unravel_index(linear_site_index, self.shape, order="F") - ] = new_occ + self._occupation[np.unravel_index(linear_site_index, self.shape, order="F")] = ( + new_occ + ) @staticmethod def from_dict(data: dict) -> IsingConfiguration: diff --git a/python/libcasm/monte/methods/__init__.py b/python/libcasm/monte/methods/__init__.py index 0baf250..bae4406 100644 --- a/python/libcasm/monte/methods/__init__.py +++ b/python/libcasm/monte/methods/__init__.py @@ -1,4 +1,5 @@ """Monte Carlo simulation methods""" + from ._metropolis import ( metropolis_acceptance, ) diff --git a/python/tests/ising_cpp/test_ising_cpp_custom_functions.py b/python/tests/ising_cpp/test_ising_cpp_custom_functions.py index 12597e0..a1171e8 100644 --- a/python/tests/ising_cpp/test_ising_cpp_custom_functions.py +++ b/python/tests/ising_cpp/test_ising_cpp_custom_functions.py @@ -1,4 +1,5 @@ """Test C++ implemented property ising_cpp with Python implemented Monte Carlo loop""" + import json import math import pathlib diff --git a/python/tests/ising_cpp/test_ising_semigrand_canonical_cpp.py b/python/tests/ising_cpp/test_ising_semigrand_canonical_cpp.py index c4537ac..8e0620e 100644 --- a/python/tests/ising_cpp/test_ising_semigrand_canonical_cpp.py +++ b/python/tests/ising_cpp/test_ising_semigrand_canonical_cpp.py @@ -1,4 +1,5 @@ """Test C++ implemented property ising_cpp with Python implemented Monte Carlo loop""" + import json import pathlib diff --git a/python/tests/ising_py/test_ising_semigrand_canonical_mixed.py b/python/tests/ising_py/test_ising_semigrand_canonical_mixed.py index 0768ba1..8988f64 100644 --- a/python/tests/ising_py/test_ising_semigrand_canonical_mixed.py +++ b/python/tests/ising_py/test_ising_semigrand_canonical_mixed.py @@ -1,4 +1,5 @@ """Test C++ implemented property ising_cpp with Python implemented Monte Carlo loop""" + import json import pathlib diff --git a/python/tests/ising_py/test_ising_semigrand_canonical_py.py b/python/tests/ising_py/test_ising_semigrand_canonical_py.py index 65399b3..672c5df 100644 --- a/python/tests/ising_py/test_ising_semigrand_canonical_py.py +++ b/python/tests/ising_py/test_ising_semigrand_canonical_py.py @@ -1,6 +1,7 @@ """Test Python implemented property ising_cpp with Python implemented Monte Carlo \ loop """ + import json import pathlib