-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I think we can *finally* make a distributable python module that beha…
…ves nicely
- Loading branch information
Showing
12 changed files
with
50 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,38 @@ | ||
[build-system] | ||
requires = ["scikit-build-core>=0.3.3", "pybind11", "torch"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "nuTens" | ||
version = "0.0.2" | ||
version = "0.0.3" | ||
description="Library to calculate neutrino oscillation probabilities using tensors" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Ewan Miller", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.9" | ||
license = {file="LICENSE"} | ||
keywords = ["neutrino", "oscillations", "physics", "particle", "tensor", "experiment", "autograd", "differentiable programming"] | ||
classifiers = [ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Environment :: GPU", | ||
"Programming Language :: C++", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
"Intended Audience :: Science/Research" | ||
] | ||
dependencies = [ | ||
"torch" | ||
] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/ewanwm/nuTens" | ||
Issues = "https://github.com/ewanwm/nuTens/issues" | ||
Documentation = "https://ewanwm.github.io/nuTens/" | ||
|
||
[build-system] | ||
requires = ["scikit-build-core>=0.3.3", "pybind11", "torch"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[tool.cibuildwheel] | ||
build-frontend = "build[uv]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
|
||
pybind11_add_module( | ||
pyNuTens MODULE | ||
_pyNuTens MODULE | ||
binding.cpp | ||
) | ||
|
||
if(NT_USE_PCH) | ||
target_precompile_headers( pyNuTens REUSE_FROM nuTens-pch ) | ||
target_precompile_headers( _pyNuTens REUSE_FROM nuTens-pch ) | ||
endif() | ||
target_link_libraries( pyNuTens PUBLIC nuTens ) | ||
target_link_libraries( _pyNuTens PUBLIC nuTens ) | ||
|
||
# This is passing in the version as a define just as an example | ||
target_compile_definitions( pyNuTens PRIVATE VERSION_INFO=${PROJECT_VERSION} ) | ||
target_compile_definitions( _pyNuTens PRIVATE VERSION_INFO=${PROJECT_VERSION} ) | ||
|
||
install( TARGETS pyNuTens DESTINATION pyNuTens/ ) | ||
install( TARGETS _pyNuTens DESTINATION nuTens/ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Python Interface | ||
|
||
nuTens provides a python interface that can be installed manually or via [pyPi](https://pypi.org/). [binding.cpp](binding.cpp) defines the python bindings of many of the nuTens c++ objects, which are then compiled into a python module using [pybind11](https://github.com/pybind/pybind11) (see [CMakeLists.txt](CMakeLists.txt)). | ||
|
||
The [nuTens](nuTens) folder defines the python module and any pure python extension code for nuTens should go in there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from ._pyNuTens import __doc__, __version__, tensor, propagator, dtype | ||
|
||
__all__ = ["__doc__", "__version__", "tensor", "propagator", "dtype"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from ._pyNuTens import dtype | ||
from ._pyNuTens.dtype import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from ._pyNuTens import propagator | ||
from ._pyNuTens.propagator import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from ._pyNuTens import tensor | ||
from ._pyNuTens.tensor import * |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters