From f716ee238efcef7f0033e3b7d76b23e2d26b8280 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Tue, 5 Nov 2024 12:10:29 -0500 Subject: [PATCH] Apply suggestions from code review. --- freud/order.py | 4 ---- freud/order/Cubatic.cc | 8 ++------ freud/order/Cubatic.h | 1 - 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/freud/order.py b/freud/order.py index 23866dec0..6c559f2cd 100644 --- a/freud/order.py +++ b/freud/order.py @@ -25,10 +25,6 @@ logger = logging.getLogger(__name__) -# numpy must be initialized. When using numpy from C or Cython you must -# _always_ do that, or you will have segfaults -# np.import_array() - class Cubatic(_Compute): r"""Compute the cubatic order parameter :cite:`Haji_Akbari_2015` for a system of diff --git a/freud/order/Cubatic.cc b/freud/order/Cubatic.cc index f2aa5f9fc..605af7e75 100644 --- a/freud/order/Cubatic.cc +++ b/freud/order/Cubatic.cc @@ -2,7 +2,7 @@ // This file is from the freud project, released under the BSD 3-Clause License. #include -#include +#include #include #include "Cubatic.h" @@ -71,11 +71,7 @@ tensor4 tensor4::operator*(const float& b) const void tensor4::copyToManagedArray(util::ManagedArray& ma) { - // TODO: this may be possible with std::copy but this works as well. - for (unsigned int i = 0; i < 81; i++) - { - ma[i] = data[i]; - } + std::copy(data.begin(), data.end(), ma.data()); } //! Complete tensor contraction. diff --git a/freud/order/Cubatic.h b/freud/order/Cubatic.h index aa7abd07a..cef8ae784 100644 --- a/freud/order/Cubatic.h +++ b/freud/order/Cubatic.h @@ -8,7 +8,6 @@ #include "VectorMath.h" #include #include -#include /*! \file Cubatic.h \brief Compute the cubatic order parameter for each particle.