Skip to content

Commit

Permalink
Merge branch 'nanobind' into nanobind_density_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DomFijan committed Feb 6, 2025
2 parents e780ab1 + 299af7c commit c5897c3
Show file tree
Hide file tree
Showing 230 changed files with 10,526 additions and 10,957 deletions.
3,635 changes: 1,743 additions & 1,892 deletions .github/workflows/environments/py310-conda-lock.yml

Large diffs are not rendered by default.

3,643 changes: 1,747 additions & 1,896 deletions .github/workflows/environments/py311-conda-lock.yml

Large diffs are not rendered by default.

3,677 changes: 1,764 additions & 1,913 deletions .github/workflows/environments/py312-conda-lock.yml

Large diffs are not rendered by default.

3,659 changes: 1,755 additions & 1,904 deletions .github/workflows/environments/py313-conda-lock.yml

Large diffs are not rendered by default.

3,535 changes: 1,725 additions & 1,810 deletions .github/workflows/environments/py39-conda-lock.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# uv pip compile --python-version 3.13 --python-platform linux requirements-build-sdist.in
build==1.2.2.post1
# via -r requirements-build-sdist.in
packaging==24.1
packaging==24.2
# via build
pyproject-hooks==1.2.0
# via build
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
pytest tests/test_data.py -v
pytest tests/test_pmft.py -v
pytest tests/test_util.py -v
pytest tests/test_environment*.py -v
pytest tests/test_diffraction*.py -v
pytest tests/test_interface.py -v
pytest tests/test_msd_msd.py -v
Expand Down
15 changes: 6 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exclude: (?:^extern/)

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.6.0'
rev: 'v5.0.0'
hooks:
- id: end-of-file-fixer
exclude: |
Expand All @@ -30,7 +30,7 @@ repos:
- id: debug-statements
- id: requirements-txt-fixer
- repo: https://github.com/glotzerlab/fix-license-header
rev: v0.4.0
rev: v0.4.1
hooks:
- id: fix-license-header
name: Fix License Headers (Python)
Expand All @@ -48,13 +48,13 @@ repos:
- --add=This file is from the freud project, released under the BSD 3-Clause License.
- --keep-before=#!
- repo: https://github.com/asottile/pyupgrade
rev: 'v3.16.0'
rev: 'v3.19.1'
hooks:
- id: pyupgrade
args:
- --py39-plus
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.6.3'
rev: 'v0.9.4'
hooks:
- id: ruff-format
- id: ruff
Expand All @@ -63,7 +63,7 @@ repos:
hooks:
- id: cmake-format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v18.1.6'
rev: 'v19.1.7'
hooks:
- id: clang-format
types_or: [c, c++]
Expand All @@ -82,10 +82,7 @@ repos:
exclude: |
(?x)^(
^extern/|
^freud/density/|
^freud/diffraction/|
^freud/environment/|
^freud/order/
^freud/density/
)
args:
- --warnings-as-errors=*
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ python:
submodules:
include: all
recursive: true
sphinx:
configuration: doc/source/conf.py
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License for freud

Copyright (c) 2010-2024 The Regents of the University of Michigan
Copyright (c) 2010-2025 The Regents of the University of Michigan
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import cProfile
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_cluster_Cluster.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_density_CorrelationFunction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_density_GaussianDensity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_density_LocalDensity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import math
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_density_RDF.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_environment_BondOrder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_locality_AABBQuery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_locality_LinkCell.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_locality_PeriodicBuffer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_msd_MSD.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_Cubatic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_Hexatic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_Nematic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_RotationalAutocorrelation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_SolidLiquid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_SteinhardtQl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_order_SteinhardtWl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_pmft_PMFTR12.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_pmft_PMFTXY.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_pmft_PMFTXYT.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_pmft_PMFTXYZ.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import numpy as np
Expand Down
8 changes: 3 additions & 5 deletions benchmarks/benchmarker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

import argparse
Expand Down Expand Up @@ -387,8 +387,7 @@ def compare_helper(_this_t, _other_t, _N, _thread):
"filename",
default="benchmark.json",
nargs="?",
help="The collection that contains the benchmark data"
"default='benchmark.json'.",
help="The collection that contains the benchmark datadefault='benchmark.json'.",
)
parser_report.set_defaults(func=main_report)

Expand Down Expand Up @@ -426,8 +425,7 @@ def compare_helper(_this_t, _other_t, _N, _thread):
"--filename",
default="benchmark.json",
nargs="?",
help="The collection that contains the benchmark data"
"default='benchmark.json'.",
help="The collection that contains the benchmark datadefault='benchmark.json'.",
)
parser_compare.add_argument(
"-f",
Expand Down
29 changes: 14 additions & 15 deletions doc/readthedocs-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ name: freud-rtd
channels:
- conda-forge
dependencies:
- python==3.12
- pip==24.0
- scikit-build==0.17.6
- cmake==3.29.3
- cython==3.0.10
- tbb==2021.12.0
- tbb-devel==2021.12.0
- nanobind==2.0.0
- numpy==1.26.4
- rowan==1.3.0.post1
- scipy==1.13.1
- sphinx==7.3.7
- furo==2024.5.6
- nbsphinx==0.9.4
- python==3.13
- pip==25.0
- scikit-build-core==0.10.7
- cmake==3.31.5
- tbb==2022.0.0
- tbb-devel==2022.0.0
- nanobind==2.5.0
- numpy==2.2.2
- rowan==1.3.2
- scipy==1.15.1
- sphinx==8.1.3
- furo==2024.8.6
- nbsphinx==0.9.6
- jupyter_sphinx==0.5.3
- sphinxcontrib-bibtex==2.6.2
- sphinxcontrib-bibtex==2.6.3
- sphinx-copybutton==0.5.2
- pip:
- sphinxcontrib-googleanalytics==0.4
45 changes: 27 additions & 18 deletions freud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ add_library(
diffraction/StaticStructureFactorDirect.h
diffraction/StaticStructureFactorDirect.cc
# environment
# environment/AngularSeparation.h
# environment/AngularSeparation.cc
# environment/BondOrder.h
# environment/BondOrder.cc
# environment/LocalBondProjection.h
# environment/LocalBondProjection.cc
# environment/LocalDescriptors.h
# environment/LocalDescriptors.cc
# environment/MatchEnv.h
# environment/MatchEnv.cc
# environment/Registration.h
environment/AngularSeparation.h
environment/AngularSeparation.cc
environment/BondOrder.h
environment/BondOrder.cc
environment/LocalBondProjection.h
environment/LocalBondProjection.cc
environment/LocalDescriptors.h
environment/LocalDescriptors.cc
environment/MatchEnv.h
environment/MatchEnv.cc
environment/Registration.h
# locality
locality/AABB.h
locality/AABBQuery.cc
Expand Down Expand Up @@ -148,15 +148,24 @@ nanobind_add_module(
target_link_libraries(_diffraction PUBLIC freud TBB::tbb)
target_set_install_rpath(_diffraction)

# environment nanobind_add_module(_environment environment/...)
# target_link_libraries(_environment PUBLIC freud TBB::tbb)
# target_set_install_rpath(_environment)

# box
nanobind_add_module(_box box/module-box.cc box/export-Box.cc box/export-Box.h)
target_link_libraries(_box PUBLIC TBB::tbb)
target_set_install_rpath(_box)

# environment
nanobind_add_module(
_environment
environment/module-environment.cc
environment/export-AngularSeparationNeighbor.cc
environment/export-AngularSeparationGlobal.cc
environment/export-LocalBondProjection.cc
environment/export-LocalDescriptors.cc
environment/export-BondOrder.cc
environment/export-MatchEnv.cc)
target_link_libraries(_environment PUBLIC freud TBB::tbb)
target_set_install_rpath(_environment)

# locality
nanobind_add_module(
_locality
Expand Down Expand Up @@ -223,6 +232,7 @@ set(python_files
data.py
density.py
diffraction.py
environment.py
errors.py
locality.py
msd.py
Expand All @@ -232,18 +242,17 @@ set(python_files
interface.py
plot.py
util.py)
# cluster.py density.py diffraction.py environment.py interface.py msd.py)

copy_files_to_build("${python_files}" "freud" "*.py")

# install
if(SKBUILD)
install(FILES ${python_files} DESTINATION freud)
install(TARGETS _box DESTINATION freud)
install(TARGETS _density DESTINATION freud)
install(TARGETS _cluster DESTINATION freud)
install(TARGETS _density DESTINATION freud)
install(TARGETS _diffraction DESTINATION freud)
# install(TARGETS _environment DESTINATION freud)
install(TARGETS _environment DESTINATION freud)
install(TARGETS _locality DESTINATION freud)
install(TARGETS _order DESTINATION freud)
install(TARGETS _parallel DESTINATION freud)
Expand Down
6 changes: 4 additions & 2 deletions freud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Copyright (c) 2010-2024 The Regents of the University of Michigan
# Copyright (c) 2010-2025 The Regents of the University of Michigan
# This file is from the freud project, released under the BSD 3-Clause License.

# density,
from . import (
box,
cluster,
data,
density,
diffraction,
environment,
interface,
locality,
msd,
Expand Down Expand Up @@ -36,8 +38,8 @@
"data",
"density",
"diffraction",
"environment",
"get_num_threads",
# "environment",
"interface",
"locality",
"msd",
Expand Down
Loading

0 comments on commit c5897c3

Please sign in to comment.