openmm / NNPOps

High-performance operations for neural network potentials
Other
79 stars 17 forks source link

Move all torch.ops.load calls to the __init__.py scripts #89

Closed RaulPPelaez closed 1 year ago

RaulPPelaez commented 1 year ago

This PR tries to fix #68 by moving all calls to torch.ops.load to the init.py scripts.

raimis commented 1 year ago

@RaulPPelaez is this ready for review?

RaulPPelaez commented 1 year ago

Yes, thanks.

RaulPPelaez commented 1 year ago

My last commit broke the tests. This made me notice there is something weird about make install. See its output:

Install the project...
-- Install configuration: ""
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/libNNPOpsPyTorch.so
-- Set runtime path of "/usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/libNNPOpsPyTorch.so" to ""
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/__init__.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/BatchedNN.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/CFConv.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/CFConvNeighbors.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/EnergyShifter.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/OptimizedTorchANI.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/SpeciesConverter.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/SymmetryFunctions.py
-- Up-to-date: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/__init__.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/getNeighborPairs.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/neighbors/__init__.py
-- Installing: /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/neighbors/getNeighborPairs.py

The second time init.py is mentioned it says "up to date", and in fact

$ diff /usr/share/miniconda3/envs/nnpops/lib/python3.8/site-packages/NNPOps/{neighbors,}/__init__.py

Prints nothing, i.e NNPOps/neighbors/init.py overwrites NNPOps/init.py

raimis commented 1 year ago

Remove https://github.com/openmm/NNPOps/blob/293d90826371a20e63fa3bb21880cfd10132198a/CMakeLists.txt#L80-L81

RaulPPelaez commented 1 year ago

This is ready for review.

raimis commented 1 year ago

@peastman any comments? Otherwise, we can merge.

peastman commented 1 year ago

Looks good to me.