mirror of
https://github.com/vale981/hopsflow
synced 2025-03-05 08:51:37 -05:00
project structure and license+setup.py
This commit is contained in:
parent
2edce57fe0
commit
533e3a8731
10 changed files with 120 additions and 38 deletions
21
LICENSE
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021 Valentin Boettcher
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
82
flake.nix
82
flake.nix
|
@ -1,31 +1,85 @@
|
||||||
{
|
{
|
||||||
description = "Calculating open system bath energy changes with HOPS and analytically. ";
|
description = "Calculating open system bath energy changes with HOPS and analytically.";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
mach-nix.url = "github:DavHau/mach-nix";
|
mach-nix.url = "github:DavHau/mach-nix";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, mach-nix }:
|
outputs = { self, nixpkgs, flake-utils, mach-nix }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
let
|
||||||
python = "python39";
|
python = "python39";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pypiDataRev = "master";
|
||||||
|
pypiDataSha256 = "041rpjrwwa43hap167jy8blnxvpvbfil0ail4y4mar1q5f0q57xx";
|
||||||
mach-nix-wrapper = import mach-nix { inherit pkgs python; };
|
devShell = pkgs:
|
||||||
requirements = builtins.readFile ./requirements.txt;
|
pkgs.mkShell {
|
||||||
pythonBuild = mach-nix-wrapper.mkPython { inherit requirements; };
|
|
||||||
in {
|
|
||||||
devShell = pkgs.mkShell {
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
# dev packages
|
|
||||||
(pkgs.${python}.withPackages
|
(pkgs.${python}.withPackages
|
||||||
(ps: with ps; [ black mypy sphinx-autodoc-typehints sphinx pydata-sphinx-theme ])) # <--- change here
|
(ps: with ps; [ black mypy ]))
|
||||||
pkgs.nodePackages.pyright
|
pkgs.nodePackages.pyright
|
||||||
|
|
||||||
# app packages
|
|
||||||
pythonBuild
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
mach-nix-wrapper = import mach-nix { inherit pkgs python pypiDataRev pypiDataSha256; };
|
||||||
|
|
||||||
|
fcSpline = (mach-nix-wrapper.buildPythonPackage
|
||||||
|
{src = builtins.fetchTarball {
|
||||||
|
url = "https://github.com/cimatosa/fcSpline/archive/4312b2c63d52711bff1bfe282d92f98a3e5073fb.tar.gz";
|
||||||
|
sha256 = "0l38q5avcbiyqlmmhznw9sg02y54fia6r7x2f9w6h3kqf2xh05yc";
|
||||||
|
};
|
||||||
|
pname="fcSpline";
|
||||||
|
version="0.1";
|
||||||
|
requirements=''
|
||||||
|
numpy
|
||||||
|
cython
|
||||||
|
setuptools
|
||||||
|
scipy
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
stocproc = (mach-nix-wrapper.buildPythonPackage
|
||||||
|
{src = builtins.fetchTarball {
|
||||||
|
url = "https://github.com/vale981/stocproc/archive/c81eead1b86d8da0caa5ec013b5fb65e9d3c3b79.tar.gz";
|
||||||
|
sha256 = "00fvfmdcpkm9lp2zn8kzzn6msq7cypqhf87ihrf63ci5z4hg2jpl";
|
||||||
|
};
|
||||||
|
pname="stocproc";
|
||||||
|
version = "1.0.1";
|
||||||
|
requirements = ''
|
||||||
|
numpy
|
||||||
|
cython
|
||||||
|
setuptools
|
||||||
|
mpmath
|
||||||
|
scipy
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
requirements = builtins.readFile ./requirements.txt;
|
||||||
|
|
||||||
|
pythonShell = mach-nix-wrapper.mkPythonShell {
|
||||||
|
requirements = requirements + ''
|
||||||
|
sphinx
|
||||||
|
pydata-sphinx-theme
|
||||||
|
sphinx-autodoc-typehints
|
||||||
|
data-science-types
|
||||||
|
'';
|
||||||
|
packagesExtra = [fcSpline stocproc];
|
||||||
|
_.stocproc.buildInputs.add = [fcSpline];
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonPackage = mach-nix-wrapper.buildPythonPackage ./setup.py;
|
||||||
|
|
||||||
|
mergeEnvs = envs:
|
||||||
|
pkgs.mkShell (builtins.foldl' (a: v: {
|
||||||
|
buildInputs = a.buildInputs ++ v.buildInputs;
|
||||||
|
nativeBuildInputs = a.nativeBuildInputs ++ v.nativeBuildInputs;
|
||||||
|
}) (pkgs.mkShell { }) envs);
|
||||||
|
|
||||||
|
in {
|
||||||
|
devShell = mergeEnvs [ (devShell pkgs) pythonShell ];
|
||||||
|
defaultPackage = pythonPackage;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
11
hopsflow/setup.py
Normal file
11
hopsflow/setup.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="Distutils",
|
||||||
|
version="1.0",
|
||||||
|
description="Python Distribution Utilities",
|
||||||
|
author="Greg Ward",
|
||||||
|
author_email="gward@python.net",
|
||||||
|
url="https://www.python.org/sigs/distutils-sig/",
|
||||||
|
packages=["distutils", "distutils.command"],
|
||||||
|
)
|
|
@ -1,6 +1,5 @@
|
||||||
numpy >= 1.20
|
numpy >= 1.20
|
||||||
data-science-types
|
|
||||||
scipy >= 1.6
|
scipy >= 1.6
|
||||||
h5py
|
h5py
|
||||||
sqlitedict
|
|
||||||
tqdm
|
tqdm
|
||||||
|
lmfit
|
||||||
|
|
15
setup.cfg
15
setup.cfg
|
@ -1,15 +0,0 @@
|
||||||
[flake8]
|
|
||||||
ignore = E501
|
|
||||||
max-line-length = 120
|
|
||||||
|
|
||||||
[mypy]
|
|
||||||
exclude = docs
|
|
||||||
|
|
||||||
[mypy-stocproc.*]
|
|
||||||
ignore_missing_imports = True
|
|
||||||
|
|
||||||
[mypy-scipy.*]
|
|
||||||
ignore_missing_imports = True
|
|
||||||
|
|
||||||
[mypy-lmfit.*]
|
|
||||||
ignore_missing_imports = True
|
|
12
setup.py
Normal file
12
setup.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
from distutils.core import setup
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name="hopsflow",
|
||||||
|
version="1.0",
|
||||||
|
description="Calculating open system bath energy changes with HOPS and analytically.",
|
||||||
|
author="Valentin Boettcher",
|
||||||
|
author_email="hiro@protagon.space",
|
||||||
|
url="https://github.com/vale981/hopsflow",
|
||||||
|
packages=["hopsflow"],
|
||||||
|
install_requires=["numpy >= 1.20", "scipy >= 1.6", "h5py", "tqdm", "lmfit"],
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue