Skip to content

Commit

Permalink
fix calc_local_correlations function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
xivh committed Dec 10, 2024
1 parent 6cb4eaf commit 36d8d3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions python/src/clexulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,10 +1309,10 @@ PYBIND11_MODULE(_clexulator, m) {

m.def(
"calc_local_correlations",
[](clexulator::LocalClexulatorWrapper const &wrapper,
clexulator::ConfigDoFValues const &config_dof_values,
std::shared_ptr<clexulator::SuperNeighborList const> const
[](std::shared_ptr<clexulator::SuperNeighborList const> const
&supercell_neighbor_list,
clexulator::LocalClexulatorWrapper const &wrapper,
clexulator::ConfigDoFValues const &config_dof_values,
Index unitcell_index, Index equivalent_index,
std::optional<std::vector<unsigned int>> indices) {
if (wrapper.local_clexulator->size() == 0) {
Expand Down
20 changes: 10 additions & 10 deletions python/tests/clexulator/test_correlations.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,22 @@ def test_calc_local_correlations(session_shared_datadir):
# Test calculate all correlations
for equivalent_index in range(local_clexulator.n_equivalents()):
correlations = clex.calc_local_correlations(
local_clexulator,
dof_values,
supercell_neighbor_list,
unitcell_index,
equivalent_index,
local_clexulator=local_clexulator,
config_dof_values=dof_values,
supercell_neighbor_list=supercell_neighbor_list,
unitcell_index=unitcell_index,
equivalent_index=equivalent_index,
)
assert isinstance(correlations, np.ndarray)
assert len(correlations) == 6
# print(unitcell_index, equivalent_index, correlations.tolist())

restricted = clex.calc_local_correlations(
local_clexulator,
dof_values,
supercell_neighbor_list,
unitcell_index,
equivalent_index,
local_clexulator=local_clexulator,
config_dof_values=dof_values,
supercell_neighbor_list=supercell_neighbor_list,
unitcell_index=unitcell_index,
equivalent_index=equivalent_index,
indices=[1, 2],
)
assert isinstance(restricted, np.ndarray)
Expand Down

0 comments on commit 36d8d3a

Please sign in to comment.