Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port environment to nanobind #1291

Draft
wants to merge 31 commits into
base: nanobind
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e499f2a
Begin porting environment to nanobind
tcmoore3 Sep 11, 2024
61827ee
Export classes
AlainKadar Sep 11, 2024
babe658
Tests are passing for angular separation classes
tcmoore3 Sep 11, 2024
6435063
Merge branch 'nanobind' into nanobind-environment
DomFijan Nov 1, 2024
8a47eae
move environment to pure python
DomFijan Nov 1, 2024
32f7bbf
fix cmake config for environment
DomFijan Nov 1, 2024
128c406
tests on angular separations pass
DomFijan Nov 1, 2024
19265bc
port local bond projection, tests pass
DomFijan Nov 1, 2024
6d22fd0
update testing framework
DomFijan Nov 1, 2024
8ef7d68
begin porting local descriptors, python class is ported
DomFijan Nov 1, 2024
4484dd5
update build for LocalDescriptors
DomFijan Nov 4, 2024
a7286ae
port LocalDescriptors, enum in constructor is still TODO
DomFijan Nov 4, 2024
d01949c
export complex managed array
DomFijan Nov 5, 2024
0208c74
correctly export constructor and fix other exports
DomFijan Nov 5, 2024
9549988
fix copy with new managed array
DomFijan Nov 5, 2024
f5f7b07
add back missing const
DomFijan Nov 5, 2024
5eff9b0
Translate BondOrder
janbridley Nov 8, 2024
e72d8fc
Progress on BondOrder export
janbridley Nov 8, 2024
408b470
Compile BondOrder
janbridley Nov 8, 2024
295a523
Python for BondOrder
janbridley Nov 8, 2024
494fa15
Progress on BondOrder
janbridley Nov 8, 2024
42b24e4
fix managed array issue for LocalDescriptors
DomFijan Nov 12, 2024
8c528af
Merge branch 'nanobind' into nanobind-environment
DomFijan Nov 12, 2024
e6fa0ba
start porting environment matching, python file ported
DomFijan Nov 12, 2024
ccb8005
update computes for env motif match and rmsd min with a wrapper
DomFijan Nov 12, 2024
c15a634
Minor BondOrder fixes
janbridley Nov 15, 2024
a1ed072
Clean up working functions
janbridley Nov 15, 2024
373139a
Fix BondOrder
janbridley Nov 15, 2024
e472950
pre-commit working
janbridley Nov 15, 2024
b755897
Lint BondOrder part of environment.py
janbridley Nov 15, 2024
b6a6e56
Merge remote-tracking branch 'origin/nanobind-environment-bod' into n…
janbridley Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
48 changes: 30 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 @@ -152,15 +152,26 @@ 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 @@ -213,6 +224,7 @@ set(python_files
box.py
cluster.py
data.py
environment.py
diffraction.py
errors.py
locality.py
Expand All @@ -223,7 +235,7 @@ set(python_files
interface.py
plot.py
util.py)
# cluster.py density.py diffraction.py environment.py interface.py msd.py)
# density.py)

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

Expand All @@ -232,9 +244,9 @@ if(SKBUILD)
install(FILES ${python_files} DESTINATION freud)
install(TARGETS _box DESTINATION freud)
install(TARGETS _cluster DESTINATION freud)
# install(TARGETS _density DESTINATION freud)
install(TARGETS _environment DESTINATION freud)
install(TARGETS _diffraction DESTINATION freud)
# install(TARGETS _density DESTINATION freud) install(TARGETS _environment
# DESTINATION freud)
install(TARGETS _locality DESTINATION freud)
install(TARGETS _order DESTINATION freud)
install(TARGETS _parallel DESTINATION freud)
Expand Down
4 changes: 3 additions & 1 deletion freud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# 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.

# density,
from . import (
box,
cluster,
data,
diffraction,
environment,
interface,
locality,
msd,
Expand All @@ -30,7 +32,7 @@
"data",
# "density",
"diffraction",
# "environment",
"environment",
"interface",
"locality",
"msd",
Expand Down
Loading
Loading