Skip to content

Commit

Permalink
Merge pull request #1094 from glotzerlab/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
tommy-waltmann committed Apr 4, 2023
2 parents fa6b265 + c22a3d3 commit 2a8b680
Show file tree
Hide file tree
Showing 45 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: '23.1.0'
rev: '23.3.0'
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand All @@ -83,7 +83,7 @@ repos:
hooks:
- id: cmake-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v15.0.7'
rev: 'v16.0.0'
hooks:
- id: clang-format
types_or: [c, c++]
Expand Down
2 changes: 1 addition & 1 deletion cpp/box/Box.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,6 @@ class Box
bool m_2d; //!< Specify whether box is 2D.
};

}; }; // end namespace freud::box
}; }; // end namespace freud::box

#endif // BOX_H
2 changes: 1 addition & 1 deletion cpp/cluster/Cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ class Cluster
const std::vector<size_t>& min_ids);
};

}; }; // end namespace freud::cluster
}; }; // end namespace freud::cluster

#endif // CLUSTER_H
2 changes: 1 addition & 1 deletion cpp/cluster/ClusterProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ class ClusterProperties
util::ManagedArray<float> m_cluster_masses; //!< Mass per cluster
};

}; }; // end namespace freud::cluster
}; }; // end namespace freud::cluster

#endif // CLUSTER_PROPERTIES_H
2 changes: 1 addition & 1 deletion cpp/density/CorrelationFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ template<typename T> class CorrelationFunction : public locality::BondHistogramC
CFThreadHistogram m_local_correlation_function; //!< Thread local copy of the correlation function
};

}; }; // end namespace freud::density
}; }; // end namespace freud::density

#endif // CORRELATION_FUNCTION_H
12 changes: 6 additions & 6 deletions cpp/density/GaussianDensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ class GaussianDensity
vec3<unsigned int> getWidth();

private:
box::Box m_box; //!< Simulation box containing the points.
vec3<unsigned int> m_width; //!< Number of bins in the grid in each dimension.
float m_r_max; //!< Max distance at which to compute density.
float m_sigma; //!< Gaussian width sigma.
bool m_has_computed; //!< Tracks whether a call to compute has been made.
box::Box m_box; //!< Simulation box containing the points.
vec3<unsigned int> m_width; //!< Number of bins in the grid in each dimension.
float m_r_max; //!< Max distance at which to compute density.
float m_sigma; //!< Gaussian width sigma.
bool m_has_computed; //!< Tracks whether a call to compute has been made.

util::ManagedArray<float> m_density_array; //! Computed density array.
};

}; }; // end namespace freud::density
}; }; // end namespace freud::density

#endif // GAUSSIAN_DENSITY_H
8 changes: 4 additions & 4 deletions cpp/density/LocalDensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ class LocalDensity
}

private:
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum neighbor distance
float m_diameter; //!< Diameter of the particles
box::Box m_box; //!< Simulation box where the particles belong
float m_r_max; //!< Maximum neighbor distance
float m_diameter; //!< Diameter of the particles

util::ManagedArray<float> m_density_array; //!< density array computed
util::ManagedArray<float> m_num_neighbors_array; //!< number of neighbors array computed
};

}; }; // end namespace freud::density
}; }; // end namespace freud::density

#endif // LOCAL_DENSITY_H
4 changes: 2 additions & 2 deletions cpp/density/RDF.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ class RDF : public locality::BondHistogramCompute
//!< num_query_points/num_points).
util::ManagedArray<float> m_pcf; //!< The computed pair correlation function.
util::ManagedArray<float>
m_N_r; //!< Cumulative bin sum N(r) (the average number of points in a ball of radius r).
m_N_r; //!< Cumulative bin sum N(r) (the average number of points in a ball of radius r).
util::ManagedArray<float>
m_vol_array2D; //!< Areas of concentric rings corresponding to the histogram bins in 2D.
util::ManagedArray<float>
m_vol_array3D; //!< Areas of concentric spherical shells corresponding to the histogram bins in 3D.
};

}; }; // end namespace freud::density
}; }; // end namespace freud::density

#endif // RDF_H
10 changes: 5 additions & 5 deletions cpp/density/SphereVoxelization.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class SphereVoxelization
vec3<unsigned int> getWidth() const;

private:
box::Box m_box; //!< Simulation box containing the points.
vec3<unsigned int> m_width; //!< Number of bins in the grid in each dimension.
float m_r_max; //!< Sphere radius used for voxelization.
bool m_has_computed; //!< Tracks whether a call to compute has been made.
box::Box m_box; //!< Simulation box containing the points.
vec3<unsigned int> m_width; //!< Number of bins in the grid in each dimension.
float m_r_max; //!< Sphere radius used for voxelization.
bool m_has_computed; //!< Tracks whether a call to compute has been made.

util::ManagedArray<unsigned int> m_voxels_array; //! Computed voxels array.
};

}; }; // end namespace freud::density
}; }; // end namespace freud::density

#endif // SPHERE_VOXELIZATION_H
6 changes: 3 additions & 3 deletions cpp/diffraction/StaticStructureFactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ class StaticStructureFactor

StructureFactorHistogram m_structure_factor; //!< Histogram to hold computed structure factor
StructureFactorHistogram::ThreadLocalHistogram
m_local_structure_factor; //!< Thread local histograms for TBB parallelism
m_local_structure_factor; //!< Thread local histograms for TBB parallelism

bool m_reduce {true}; //! Whether to reduce local histograms
bool m_reduce {true}; //! Whether to reduce local histograms
float m_min_valid_k {std::numeric_limits<float>::infinity()}; //! Minimum valid k-vector magnitude
};

}; }; // namespace freud::diffraction
}; }; // namespace freud::diffraction

#endif // STATIC_STRUCTURE_FACTOR_H
2 changes: 1 addition & 1 deletion cpp/diffraction/StaticStructureFactorDebye.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ class StaticStructureFactorDebye : public StaticStructureFactor
unsigned int m_frame_counter {0}; //!< Number of frames calculated
};

}; }; // namespace freud::diffraction
}; }; // namespace freud::diffraction

#endif // STATIC_STRUCTURE_FACTOR_DEBYE_H
8 changes: 4 additions & 4 deletions cpp/diffraction/StaticStructureFactorDirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class StaticStructureFactorDirect : public StaticStructureFactor
std::vector<vec3<float>> m_k_points; //!< k-vectors used for sampling
KBinHistogram m_k_histogram; //!< Histogram of sampled k bins, used to normalize S(q)
KBinHistogram::ThreadLocalHistogram
m_local_k_histograms; //!< Thread local histograms of sampled k bins for TBB parallelism
box::Box previous_box; //!< box assigned to the system
bool box_assigned {false}; //!< Whether to reuse the box
m_local_k_histograms; //!< Thread local histograms of sampled k bins for TBB parallelism
box::Box previous_box; //!< box assigned to the system
bool box_assigned {false}; //!< Whether to reuse the box
};

}; }; // namespace freud::diffraction
}; }; // namespace freud::diffraction

#endif // STATIC_STRUCTURE_FACTOR_DIRECT_H
2 changes: 1 addition & 1 deletion cpp/environment/AngularSeparation.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ class AngularSeparationNeighbor
locality::NeighborList m_nlist; //!< The NeighborList used in the last call to compute.
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // ANGULAR_SEPARATION_H
2 changes: 1 addition & 1 deletion cpp/environment/BondOrder.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ class BondOrder : public locality::BondHistogramCompute
BondOrderMode m_mode; //!< The mode to calculate with.
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // BOND_ORDER_H
4 changes: 2 additions & 2 deletions cpp/environment/LocalBondProjection.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class LocalBondProjection
}

private:
locality::NeighborList m_nlist; //!< The NeighborList used in the last call to compute.
locality::NeighborList m_nlist; //!< The NeighborList used in the last call to compute.

util::ManagedArray<float> m_local_bond_proj; //!< Local bond projection array computed
util::ManagedArray<float> m_local_bond_proj_norm; //!< Normalized local bond projection array computed
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // LOCAL_BOND_PROJECTION_H
2 changes: 1 addition & 1 deletion cpp/environment/LocalDescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ class LocalDescriptors
util::ManagedArray<std::complex<float>> m_sphArray;
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // LOCAL_DESCRIPTORS_H
4 changes: 2 additions & 2 deletions cpp/environment/MatchEnv.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class EnvironmentCluster : public MatchEnv
unsigned int m_num_clusters {0}; //!< Last number of local environments computed
util::ManagedArray<unsigned int> m_env_index; //!< Cluster index determined for each particle
std::vector<std::vector<vec3<float>>>
m_cluster_environments; //!< Dictionary of (cluster id, vectors) pairs
m_cluster_environments; //!< Dictionary of (cluster id, vectors) pairs
};

//! Match local point environments to a specific motif.
Expand Down Expand Up @@ -441,6 +441,6 @@ class EnvironmentRMSDMinimizer : public MatchEnv
m_rmsds; //!< Boolean array indicating whether or not a particle's environment matches the motif.
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // MATCH_ENV_H
4 changes: 2 additions & 2 deletions cpp/environment/Registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ inline void AlignVectorSets(matrix& P, matrix& Q, matrix* pRotation = nullptr)
// back to its original dimensionality.
P = (rotation * P.transpose()).transpose(); // Apply the transformation.

if (pRotation != nullptr) // optionally copy the rotation.
if (pRotation != nullptr) // optionally copy the rotation.
{
*pRotation = rotation;
}
Expand Down Expand Up @@ -477,6 +477,6 @@ class RegisterBruteForce
//! those passed to Fit).
};

}; }; // end namespace freud::environment
}; }; // end namespace freud::environment

#endif // REGISTRATION_H
2 changes: 1 addition & 1 deletion cpp/locality/AABB.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,6 @@ inline AABB merge(const AABB& a, const AABB& b)
return new_aabb;
}

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // AABB_H
4 changes: 2 additions & 2 deletions cpp/locality/AABBQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ class AABBQueryBallIterator : public AABBIterator
unsigned int
cur_ref_p; //!< The current index into the reference particles in the current node of the tree.
};
}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // AABBQUERY_H
#endif // AABBQUERY_H
6 changes: 3 additions & 3 deletions cpp/locality/AABBTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct CACHE_ALIGN AABBNode

std::array<unsigned int, NODE_CAPACITY> particles; //!< Indices of the particles contained in the node
std::array<unsigned int, NODE_CAPACITY>
particle_tags; //!< Corresponding particle tags for particles in node
unsigned int num_particles; //!< Number of particles contained in the node
particle_tags; //!< Corresponding particle tags for particles in node
unsigned int num_particles; //!< Number of particles contained in the node
};

//! AABB Tree
Expand Down Expand Up @@ -616,6 +616,6 @@ inline unsigned int AABBTree::allocateNode()
return m_num_nodes - 1;
}

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // AABB_TREE_H
12 changes: 6 additions & 6 deletions cpp/locality/BondHistogramCompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@ class BondHistogramCompute

protected:
box::Box m_box;
unsigned int m_frame_counter {0}; //!< Number of frames calculated.
unsigned int m_n_points {0}; //!< The number of points.
unsigned int m_n_query_points {0}; //!< The number of query points.
bool m_reduce {true}; //!< Whether or not the histogram needs to be reduced.
unsigned int m_frame_counter {0}; //!< Number of frames calculated.
unsigned int m_n_points {0}; //!< The number of points.
unsigned int m_n_query_points {0}; //!< The number of query points.
bool m_reduce {true}; //!< Whether or not the histogram needs to be reduced.

util::Histogram<unsigned int> m_histogram; //!< Histogram of interparticle distances (bond lengths).
util::Histogram<unsigned int>::ThreadLocalHistogram
m_local_histograms; //!< Thread local bin counts for TBB parallelism
m_local_histograms; //!< Thread local bin counts for TBB parallelism

using BondHistogram = util::Histogram<unsigned int>;
};

}; }; // namespace freud::locality
}; }; // namespace freud::locality

#endif // BOND_HISTOGRAM_COMPUTE_H
2 changes: 1 addition & 1 deletion cpp/locality/Filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ class Filter
std::shared_ptr<NeighborList> m_filtered_nlist;
};

}; }; // namespace freud::locality
}; }; // namespace freud::locality

#endif // __FILTER_H__
2 changes: 1 addition & 1 deletion cpp/locality/FilterSANN.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ class FilterSANN : public Filter
bool m_allow_incomplete_shell;
};

}; }; // namespace freud::locality
}; }; // namespace freud::locality

#endif // __FILTERSANN_H__
14 changes: 7 additions & 7 deletions cpp/locality/LinkCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ class LinkCell : public NeighborQuery
//! Helper function to compute cell neighbors
const std::vector<unsigned int>& computeCellNeighbors(unsigned int cell) const;

float m_cell_width {0}; //!< Minimum necessary cell width cutoff
vec3<unsigned int> m_celldim {0, 0, 0}; //!< Cell dimensions
unsigned int m_size {0}; //!< The size of cell list.
float m_cell_width {0}; //!< Minimum necessary cell width cutoff
vec3<unsigned int> m_celldim {0, 0, 0}; //!< Cell dimensions
unsigned int m_size {0}; //!< The size of cell list.

util::ManagedArray<unsigned int> m_cell_list; //!< The cell list last computed
using CellNeighbors = tbb::concurrent_hash_map<unsigned int, std::vector<unsigned int>>;
mutable CellNeighbors m_cell_neighbors; //!< Hash map of cell neighbors for each cell
mutable CellNeighbors m_cell_neighbors; //!< Hash map of cell neighbors for each cell
};

//! Parent class of LinkCell iterators that knows how to traverse general cell-linked list structures.
Expand All @@ -271,7 +271,7 @@ class LinkCellIterator : public NeighborQueryPerPointIterator
~LinkCellIterator() override = default;

protected:
const LinkCell* m_linkcell; //!< Link to the LinkCell object
const LinkCell* m_linkcell; //!< Link to the LinkCell object
IteratorCellShell
m_neigh_cell_iter; //!< The shell iterator indicating how far out we're currently searching.
IteratorLinkCell m_cell_iter; //!< The cell iterator indicating which cell we're currently searching.
Expand Down Expand Up @@ -334,6 +334,6 @@ class LinkCellQueryBallIterator : public LinkCellIterator
protected:
int m_extra_search_width; //!< The extra shell distance to search, always 0 or 1.
};
}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // LINKCELL_H
#endif // LINKCELL_H
2 changes: 1 addition & 1 deletion cpp/locality/NeighborBond.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ struct NeighborBond
float weight {0}; //! The weight of this bond.
};

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // NEIGHBOR_BOND_H
4 changes: 2 additions & 2 deletions cpp/locality/NeighborComputeFunctional.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class NeighborListPerPointIterator : public NeighborPerPointIterator
const NeighborList* m_nlist; //! The NeighborList being iterated over.
size_t m_current_index; //! The row of m_nlist where the iterator is currently located.
size_t m_returned_point_index {
0xffffffff}; //! The index of the last returned point (i.e. the value of
0xffffffff}; //! The index of the last returned point (i.e. the value of
//! m_nlist.getNeighbors()(m_current_index, 0)). Initialized to an arbitrary sentinel in
//! case the user ever tries to access this for an iterator built from an empty nlist.
bool m_finished; //! Flag to indicate that the iterator has been exhausted.
Expand Down Expand Up @@ -221,6 +221,6 @@ void loopOverNeighbors(const NeighborQuery* neighbor_query, const vec3<float>* q
}
}

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // NEIGHBOR_COMPUTE_FUNCTIONAL_H
2 changes: 1 addition & 1 deletion cpp/locality/NeighborList.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ bool compareNeighborBond(const NeighborBond& left, const NeighborBond& right);
bool compareNeighborDistance(const NeighborBond& left, const NeighborBond& right);
bool compareFirstNeighborPairs(const std::vector<NeighborBond>& left, const std::vector<NeighborBond>& right);

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // NEIGHBOR_LIST_H
2 changes: 1 addition & 1 deletion cpp/locality/NeighborPerPointIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ class NeighborPerPointIterator
unsigned int m_query_point_idx; //!< The index of the query point.
};

}; }; // end namespace freud::locality
}; }; // end namespace freud::locality

#endif // NEIGHBOR_PER_POINT_ITERATOR_H

0 comments on commit 2a8b680

Please sign in to comment.