Skip to content

Commit

Permalink
Appeased the pre-commit gods.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfteague committed Sep 30, 2024
1 parent 2d36aea commit 3b74b53
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion freud/cluster/Cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <algorithm>
#include <cstddef>
#include <numeric>
#include <memory>
#include <numeric>
#include <vector>

#include "Cluster.h"
Expand Down
7 changes: 4 additions & 3 deletions freud/cluster/Cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifndef CLUSTER_H
#define CLUSTER_H

#include <memory>
#include <cstddef>
#include <memory>
#include <vector>

#include "ManagedArray.h"
Expand Down Expand Up @@ -45,8 +45,9 @@ class Cluster
Cluster() = default;

//! Compute the point clusters.
void compute(const std::shared_ptr<locality::NeighborQuery>& nq, const std::shared_ptr<locality::NeighborList>& nlist,
const locality::QueryArgs& qargs, const unsigned int* keys = nullptr);
void compute(const std::shared_ptr<locality::NeighborQuery>& nq,
const std::shared_ptr<locality::NeighborList>& nlist, const locality::QueryArgs& qargs,
const unsigned int* keys = nullptr);
//! Get the total number of clusters.
unsigned int getNumClusters() const
{
Expand Down
6 changes: 3 additions & 3 deletions freud/cluster/ClusterProperties.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2010-2024 The Regents of the University of Michigan
// This file is from the freud project, released under the BSD 3-Clause License.

#include <memory>
#include <algorithm>
#include <cstddef>
#include <memory>
#include <vector>

#include "ClusterProperties.h"
Expand All @@ -26,8 +26,8 @@ namespace freud { namespace cluster {
getClusterInertiaMoments().
*/

void ClusterProperties::compute(const std::shared_ptr<locality::NeighborQuery>& nq, const unsigned int* cluster_idx,
const float* masses)
void ClusterProperties::compute(const std::shared_ptr<locality::NeighborQuery>& nq,
const unsigned int* cluster_idx, const float* masses)
{
// determine the number of clusters
const unsigned int* max_cluster_id = std::max_element(cluster_idx, cluster_idx + nq->getNPoints());
Expand Down
4 changes: 2 additions & 2 deletions freud/cluster/ClusterProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#ifndef CLUSTER_PROPERTIES_H
#define CLUSTER_PROPERTIES_H

#include <memory>
#include "VectorMath.h"
#include "ManagedArray.h"
#include "NeighborQuery.h"
#include "VectorMath.h"
#include <memory>

/*! \file ClusterProperties.h
\brief Routines for computing properties of point clusters.
Expand Down
11 changes: 5 additions & 6 deletions freud/cluster/export-Cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
#include <nanobind/nanobind.h>
#include <nanobind/ndarray.h>
#include <nanobind/stl/shared_ptr.h> // NOLINT(misc-include-cleaner): used implicitly
#include <nanobind/stl/vector.h> // NOLINT(misc-include-cleaner): used implicitly

#include <nanobind/stl/vector.h> // NOLINT(misc-include-cleaner): used implicitly

#include "Cluster.h"
#include "NeighborQuery.h"
#include "NeighborList.h"
#include "NeighborQuery.h"

namespace nb = nanobind;

Expand All @@ -19,7 +18,7 @@ template<typename T, typename shape>
using nb_array = nanobind::ndarray<T, shape, nanobind::device::cpu, nanobind::c_contig>;

namespace {
void compute(const std::shared_ptr<Cluster>& self,const std::shared_ptr<locality::NeighborQuery>& nq,
void compute(const std::shared_ptr<Cluster>& self, const std::shared_ptr<locality::NeighborQuery>& nq,
std::shared_ptr<locality::NeighborList>& nlist, const locality::QueryArgs& qargs,
const nb_array<const unsigned int, nanobind::shape<-1>>& keys)
{
Expand All @@ -34,8 +33,8 @@ void export_Cluster(nb::module_& module)
{
nanobind::class_<Cluster>(module, "Cluster")
.def(nb::init<>())
.def("compute", &compute, nanobind::arg("nq"), nanobind::arg("nlist").none(),
nanobind::arg("qargs"), nanobind::arg("keys").none())
.def("compute", &compute, nanobind::arg("nq"), nanobind::arg("nlist").none(), nanobind::arg("qargs"),
nanobind::arg("keys").none())
.def("getNumClusters", &Cluster::getNumClusters)
.def("getClusterIdx", &Cluster::getClusterIdx)
.def("getClusterKeys", &Cluster::getClusterKeys);
Expand Down
4 changes: 2 additions & 2 deletions freud/cluster/export-ClusterProperties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <nanobind/ndarray.h>
#include <nanobind/stl/shared_ptr.h> // NOLINT(misc-include-cleaner): used implicitly


#include "ClusterProperties.h"
#include "NeighborQuery.h"

Expand All @@ -18,7 +17,8 @@ template<typename T, typename shape>
using nb_array = nanobind::ndarray<T, shape, nanobind::device::cpu, nanobind::c_contig>;

namespace {
void compute(const std::shared_ptr<ClusterProperties>& self, const std::shared_ptr<locality::NeighborQuery>& nq,
void compute(const std::shared_ptr<ClusterProperties>& self,
const std::shared_ptr<locality::NeighborQuery>& nq,
const nb_array<const uint32_t, nanobind::shape<-1>>& cluster_idx,
const nb_array<const float, nanobind::shape<-1>>& masses)
{
Expand Down
3 changes: 1 addition & 2 deletions freud/cluster/module-Cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <nanobind/nanobind.h>
#include <nanobind/nb_defs.h>


namespace nb = nanobind;

namespace freud::cluster::detail {
Expand All @@ -14,7 +13,7 @@ void export_ClusterProperties(nb::module_& module);
// NOLINTEND(misc-use-internal-linkage)
} // namespace freud::cluster::detail

using namespace freud::cluster::detail;
using namespace freud::cluster::detail;

NB_MODULE(_cluster, module) // NOLINT(misc-use-anonymous-namespace): caused by nanobind
{
Expand Down

0 comments on commit 3b74b53

Please sign in to comment.