Skip to content

Commit

Permalink
Package for pip and add license file.
Browse files Browse the repository at this point in the history
Directory structure for python package.

numba-scipy is specified as a github dependency because the version on
pypi isn't yet compatible with numpy >=1.23. This has been addressed in
a pull request(numba/numba-scipy#90) and I
expect to use the pypi version in future.
  • Loading branch information
DavidPost-1 committed Sep 5, 2023
1 parent d8d9633 commit e65e6ea
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 10 deletions.
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2023 David Posthuma de Boer

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[project]
name = "PyTMCI"
version = "0.0.1"
description = "Vlasov solvers for coherent transverse beam instabilities."
license = {text = "BSD-3-Clause"}
requires-python = ">=3.8"
dependencies = [
"numpy==1.24.3",
"scipy==1.10.1"
]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[metadata]
author = "David Posthuma de Boer"
author_email = "[email protected]"
url = "undefined"

[project.optional-dependencies]
tests = [
"mpmath==1.2.1",
]

jit = [
"numba==0.57.1",
"numba-scipy @ git+https://github.com/numba/numba-scipy.git",
]

playground = [
"ipykernel",
"matplotlib",
"tqdm",
"joblib",
"loky"
]
6 changes: 6 additions & 0 deletions setup_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python -m venv ~/.venvs/PyTMCI
source ~/.venvs/PyTMCI/bin/activate
python -m pip install -e .
python -m pip install -e '.[jit]'
python -m pip install -e '.[tests]'
deactivate
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_NHT.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unittest
import numpy as np
import scipy.constants as cn
import PyVlasovSolver as vs
from PyVlasovSolver import airbag_methods as am
import PyTMCI as vs
from PyTMCI import airbag_methods as am


class TestNHT(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_airbag.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unittest
import numpy as np
import scipy.constants as cn
import PyVlasovSolver as vs
from PyVlasovSolver import airbag_methods as am
import PyTMCI as vs
from PyTMCI import airbag_methods as am


class TestAirbag(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_laguerre.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import unittest
import numpy as np
import scipy.constants as cn
import PyVlasovSolver as vs
from PyVlasovSolver import airbag_methods as am
from PyVlasovSolver import laguerre_methods as lm
import PyTMCI as vs
from PyTMCI import airbag_methods as am
from PyTMCI import laguerre_methods as lm


# Max and min frequencies to check.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_vlasov.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import unittest
import numpy as np
import scipy.constants as cn
import PyVlasovSolver as vs
from PyVlasovSolver import airbag_methods as am
from PyVlasovSolver import laguerre_methods as lm
import PyTMCI as vs
from PyTMCI import airbag_methods as am
from PyTMCI import laguerre_methods as lm


class TestGeneral(unittest.TestCase):
Expand Down

0 comments on commit e65e6ea

Please sign in to comment.