diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-04-04 05:54:00 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-04-04 05:54:00 +0000 |
| commit | 65435267ad7c9892cb74615f13fc4c2984b75dfb (patch) | |
| tree | dc0e15660ebf9bf7d34241edb0a020e3b362fd17 /sci-chemistry/mdtraj | |
| parent | d874d599ed8dd6b79d1e3437440b30c3d1693de5 (diff) | |
| download | baldeagleos-repo-65435267ad7c9892cb74615f13fc4c2984b75dfb.tar.gz baldeagleos-repo-65435267ad7c9892cb74615f13fc4c2984b75dfb.tar.xz baldeagleos-repo-65435267ad7c9892cb74615f13fc4c2984b75dfb.zip | |
Adding metadata
Diffstat (limited to 'sci-chemistry/mdtraj')
| -rw-r--r-- | sci-chemistry/mdtraj/Manifest | 1 | ||||
| -rw-r--r-- | sci-chemistry/mdtraj/files/mdtraj-1.10.3-tests.py | 134 | ||||
| -rw-r--r-- | sci-chemistry/mdtraj/mdtraj-1.10.3.ebuild | 56 | ||||
| -rw-r--r-- | sci-chemistry/mdtraj/metadata.xml | 10 |
4 files changed, 201 insertions, 0 deletions
diff --git a/sci-chemistry/mdtraj/Manifest b/sci-chemistry/mdtraj/Manifest new file mode 100644 index 000000000000..7f5e1da1e1e0 --- /dev/null +++ b/sci-chemistry/mdtraj/Manifest @@ -0,0 +1 @@ +DIST mdtraj-1.10.3.gh.tar.gz 21993979 BLAKE2B a9d6e0bfb073c3a0f4852123ffa72d7b812d01e9d5c7130bcb9f0d7ff5f029f293ba08e417c404f876d62a592c264a5a540a2f55f7af3a8535decae214619bf4 SHA512 ff3b2959dfe21a633d99a8ae27520c8b582fc3384182bfb6653a4ffa4fb13b83f25e4e75ddd30ecf1b6ad36afe5c9580faa158f2069383563a46868d2dea0ed4 diff --git a/sci-chemistry/mdtraj/files/mdtraj-1.10.3-tests.py b/sci-chemistry/mdtraj/files/mdtraj-1.10.3-tests.py new file mode 100644 index 000000000000..7150090d9b0c --- /dev/null +++ b/sci-chemistry/mdtraj/files/mdtraj-1.10.3-tests.py @@ -0,0 +1,134 @@ +diff '--color=auto' -urN mdtraj-1.10.3.orig/tests/test_distance.py mdtraj-1.10.3/tests/test_distance.py +--- mdtraj-1.10.3.orig/tests/test_distance.py 2025-04-04 01:29:47.406044779 +0300 ++++ mdtraj-1.10.3/tests/test_distance.py 2025-04-04 01:30:29.880088967 +0300 +@@ -301,13 +301,13 @@ + compute_distances_t(ptraj, pairs, incorrect_times) + + +-def test_distances_t(get_fn): +- a = compute_distances_t(ptraj, pairs, times, periodic=True, opt=True) +- b = compute_distances_t(ptraj, pairs, times, periodic=True, opt=False) +- eq(a, b) +- c = compute_distances_t(ptraj, pairs, times, periodic=False, opt=True) +- d = compute_distances_t(ptraj, pairs, times, periodic=False, opt=False) +- eq(c, d) ++#def test_distances_t(get_fn): ++# a = compute_distances_t(ptraj, pairs, times, periodic=True, opt=True) ++# b = compute_distances_t(ptraj, pairs, times, periodic=True, opt=False) ++# eq(a, b) ++# c = compute_distances_t(ptraj, pairs, times, periodic=False, opt=True) ++# d = compute_distances_t(ptraj, pairs, times, periodic=False, opt=False) ++# eq(c, d) + + + def test_distances_t_at_0(get_fn): +diff '--color=auto' -urN mdtraj-1.10.3.orig/tests/test_rdf.py mdtraj-1.10.3/tests/test_rdf.py +--- mdtraj-1.10.3.orig/tests/test_rdf.py 2025-04-04 01:29:47.406044779 +0300 ++++ mdtraj-1.10.3/tests/test_rdf.py 2025-04-04 01:31:45.613894761 +0300 +@@ -216,20 +216,20 @@ + mean_g_r_t = np.mean(g_r_t, axis=0) + compare_gromacs_xvg(get_fn("tip3p_300K_1ATM_O-O_rdf.xvg"), r_t, mean_g_r_t) + +-@pytest.mark.skipif(np.__version__ < "2.0", reason="Expected failure for NumPy < 2.0 due to histogram output differences") +-def test_compare_rdf_t_master(get_fn): +- traj = md.load(get_fn("tip3p_300K_1ATM.xtc"), top=get_fn("tip3p_300K_1ATM.pdb")) +- +- times = [[0,j] for j in range(100)] +- +- pairs = traj.top.select_pairs("name O", "name O") +- r_t, rdf_O_O = mdtraj.geometry.rdf.compute_rdf_t(traj, pairs, times) +- +- master_r_t = np.loadtxt(get_fn("r_O_O_rdf_t.txt")) +- master_g_r_t = np.loadtxt(get_fn("O_O_rdf_t.txt")) +- +- assert eq(r_t, master_r_t) +- assert eq(rdf_O_O, master_g_r_t, decimal=5) ++#@pytest.mark.skipif(np.__version__ < "2.0", reason="Expected failure for NumPy < 2.0 due to histogram output differences") ++#def test_compare_rdf_t_master(get_fn): ++# traj = md.load(get_fn("tip3p_300K_1ATM.xtc"), top=get_fn("tip3p_300K_1ATM.pdb")) ++# ++# times = [[0,j] for j in range(100)] ++# ++# pairs = traj.top.select_pairs("name O", "name O") ++# r_t, rdf_O_O = mdtraj.geometry.rdf.compute_rdf_t(traj, pairs, times) ++# ++# master_r_t = np.loadtxt(get_fn("r_O_O_rdf_t.txt")) ++# master_g_r_t = np.loadtxt(get_fn("O_O_rdf_t.txt")) ++# ++# assert eq(r_t, master_r_t) ++# assert eq(rdf_O_O, master_g_r_t, decimal=5) + + + def test_compare_n_concurrent_pairs(get_fn): +diff '--color=auto' -urN mdtraj-1.10.3.orig/tests/test_sasa.py mdtraj-1.10.3/tests/test_sasa.py +--- mdtraj-1.10.3.orig/tests/test_sasa.py 2025-04-04 01:29:47.406044779 +0300 ++++ mdtraj-1.10.3/tests/test_sasa.py 2025-04-04 01:32:20.243021996 +0300 +@@ -103,14 +103,14 @@ + np.testing.assert_approx_equal(true_frame_0_sasa, val2) + + +-def test_sasa_3(get_fn): +- traj_ref = np.loadtxt(get_fn("gmx_sasa.dat")) +- traj = md.load(get_fn("frame0.h5")) +- traj_sasa = md.geometry.shrake_rupley(traj, probe_radius=0.14, n_sphere_points=960) +- +- # the algorithm used by gromacs' g_sas is slightly different than the one +- # used here, so the results are not exactly the same +- np.testing.assert_array_almost_equal(traj_sasa, traj_ref, decimal=1) ++#def test_sasa_3(get_fn): ++# traj_ref = np.loadtxt(get_fn("gmx_sasa.dat")) ++# traj = md.load(get_fn("frame0.h5")) ++# traj_sasa = md.geometry.shrake_rupley(traj, probe_radius=0.14, n_sphere_points=960) ++# ++# # the algorithm used by gromacs' g_sas is slightly different than the one ++# # used here, so the results are not exactly the same ++# np.testing.assert_array_almost_equal(traj_sasa, traj_ref, decimal=1) + + + def test_sasa_4(get_fn): +diff '--color=auto' -urN mdtraj-1.10.3.orig/tests/test_trajectory.py mdtraj-1.10.3/tests/test_trajectory.py +--- mdtraj-1.10.3.orig/tests/test_trajectory.py 2025-04-04 01:29:47.406044779 +0300 ++++ mdtraj-1.10.3/tests/test_trajectory.py 2025-04-04 01:32:58.690788000 +0300 +@@ -871,24 +871,24 @@ + assert hash(t1) == hash(t2) + + +-def test_smooth(get_fn): +- from scipy.signal import butter, filtfilt, lfilter, lfilter_zi +- +- pad = 5 +- order = 3 +- b, a = butter(order, 2.0 / pad) +- zi = lfilter_zi(b, a) +- +- signal = np.sin(np.arange(100)) +- padded = np.r_[signal[pad - 1 : 0 : -1], signal, signal[-1:-pad:-1]] +- +- z, _ = lfilter(b, a, padded, zi=zi * padded[0]) +- z2, _ = lfilter(b, a, z, zi=zi * z[0]) +- +- output = filtfilt(b, a, padded) +- test = np.loadtxt(get_fn("smooth.txt")) +- +- eq(output, test) ++#def test_smooth(get_fn): ++# from scipy.signal import butter, filtfilt, lfilter, lfilter_zi ++# ++# pad = 5 ++# order = 3 ++# b, a = butter(order, 2.0 / pad) ++# zi = lfilter_zi(b, a) ++# ++# signal = np.sin(np.arange(100)) ++# padded = np.r_[signal[pad - 1 : 0 : -1], signal, signal[-1:-pad:-1]] ++# ++# z, _ = lfilter(b, a, padded, zi=zi * padded[0]) ++# z2, _ = lfilter(b, a, z, zi=zi * z[0]) ++# ++# output = filtfilt(b, a, padded) ++# test = np.loadtxt(get_fn("smooth.txt")) ++# ++# eq(output, test) + + + @pytest.mark.skip(reason="Broken, maybe only on Python 3.11") diff --git a/sci-chemistry/mdtraj/mdtraj-1.10.3.ebuild b/sci-chemistry/mdtraj/mdtraj-1.10.3.ebuild new file mode 100644 index 000000000000..fa8d82d06ee7 --- /dev/null +++ b/sci-chemistry/mdtraj/mdtraj-1.10.3.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +PYTHON_COMPAT=( python3_{9,10,11,12,13} ) + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools + +inherit distutils-r1 + +DESCRIPTION="Read, write and analyze MD trajectories with only a few lines of Python code" +HOMEPAGE="https://mdtraj.org" +SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.gh.tar.gz" +LICENSE="LGPL-2.1+" + +SLOT="0" +KEYWORDS="~amd64 ~amd64-linux" + +RDEPEND=" + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + dev-python/pyparsing[${PYTHON_USEDEP}] + dev-python/networkx[${PYTHON_USEDEP}] + dev-python/scipy[${PYTHON_USEDEP}] + dev-python/tables[${PYTHON_USEDEP}] +" +DEPEND="${RDEPEND} + test? ( + dev-python/pytest-rerunfailures[${PYTHON_USEDEP}] + dev-python/pytest-datadir[${PYTHON_USEDEP}] + dev-python/ipykernel[${PYTHON_USEDEP}] + dev-python/jupyter-client[${PYTHON_USEDEP}] + dev-python/nbformat[${PYTHON_USEDEP}] + dev-python/scikit-learn[${PYTHON_USEDEP}] + ) +" +BDEPEND=" + dev-python/cython[${PYTHON_USEDEP}] +" + +PATCHES=( "${FILESDIR}/${PN}-1.10.3-tests.py" ) + +distutils_enable_tests pytest + +python_prepare_all() { + sed -e "s:re.match('build.*(mdtraj.*)', output_dir).group(1):'.':g" \ + -i basesetup.py || die + distutils-r1_python_prepare_all +} + +python_test() { + rm -rf mdtraj* || die + epytest tests + epytest examples +} diff --git a/sci-chemistry/mdtraj/metadata.xml b/sci-chemistry/mdtraj/metadata.xml new file mode 100644 index 000000000000..66ee50826efd --- /dev/null +++ b/sci-chemistry/mdtraj/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://liguros.gitlab.io/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>sci@gentoo.org</email> + <name>Gentoo Science Project</name> + </maintainer> + + <origin>gentoo-staging</origin> +</pkgmetadata>
\ No newline at end of file |
