summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/py-yt/package.py
blob: 2a956e355f0caf66a79d6dfcf372062dce7bbd7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


from spack.package import *


class PyYt(PythonPackage):
    """Volumetric Data Analysis

       yt is a python package for analyzing and visualizing
       volumetric, multi-resolution data from astrophysical
       simulations, radio telescopes, and a burgeoning
       interdisciplinary community.
    """
    homepage = "https://yt-project.org"
    url      = "https://github.com/yt-project/yt/archive/yt-3.5.0.tar.gz"
    git      = "https://github.com/yt-project/yt.git"

    maintainers = ['qobilidop']

    version("develop", branch="master")
    version("develop-4.0", branch="yt-4.0")

    version('3.6.1', sha256='a1be3ea7e18729d3cd86e9234dc4731bf23200dff3344fa756fe173ea36cc747')
    version('3.6.0', sha256='4e3bab11766d5950477ba4d6c528a495e12cda1155227361b4579ac4ac0bf975')
    version('3.5.1', sha256='cdc0ecb153e737d74820581f311d1be7b6f1a7ee065ad69706470939db88b041')
    version('3.5.0', sha256='548598912adba72b782b7422d40d1d12a8c1a6cd064281a9a537fdb2a5af89fc')
    version('3.4.1', sha256='b9a73ade3726a8163fc992999c8c1010ca89473131901fe4d48b820ab2ced486')
    version('3.4.0', sha256='2120793a76864cf3165b2b7290ef719e358fa57501ee8721941e7cfc434cfb2b')
    version('3.3.5', sha256='2ebe4bbefd9f5367563ce4d7eb87d3f6ef0de1f97ed1c03106d9541e71b7e1ca')
    version('3.3.4', sha256='2842bab891cfbf3269a3c4bd8f22fef23c9a15a790ba48c6490730cb51ce9b0e')
    version('3.3.3', sha256='7b9244089e92b1d32cef791cd72760bb8c80b391eaec29672a5377c33f932d88')
    version('3.3.2', sha256='d323419ad3919e86d2af1738c846021fd7f5b5dc5c06059cdf3a2bc63226466a')
    version('3.3.1', sha256='7ac68d5e05e2b57fb3635f1027f3201094f3547d584e72ab55fedbfd3bc09a36')
    version('3.3.0', sha256='e6be799c0d9a83a06649f0d77a61ad9c23b94b34f94e16724e2b18f5c7513c33')
    version('3.2.3', sha256='96476d17e9ce35f0d4380b2ddb398fe729e39f1f3894602ff07e49844541e5ca')
    version('3.2.2', sha256='498ed77b3dae8c54929602d4931f3c3e0a3420a9b500cbd870f50b1e0efea8c3')

    variant("astropy", default=True, description="enable astropy support")
    variant("h5py", default=True, description="enable h5py support")
    variant("scipy", default=True, description="enable scipy support")
    variant("rockstar", default=False, description="enable rockstar support")

    depends_on("py-astropy@4.0.1:", type=('build', 'run'), when="+astropy")
    depends_on("py-cython@0.24:", type=('build', 'run'))
    depends_on("py-h5py@3.1:", type=('build', 'run'), when="+h5py")
    depends_on("py-ipython@1.0:", type=('build', 'run'))
    depends_on("py-ipython@:6", type=('build', 'run'), when="^python@:2")
    depends_on("py-matplotlib@1.5.3:", type=('build', 'run'))
    depends_on("py-matplotlib@:3.2.2", type=('build', 'run'), when="@:3.6.0")
    depends_on("py-numpy@1.10.4:", type=('build', 'run'))
    depends_on("py-scipy@1.5.0:", type=('build', 'run'), when="+scipy")
    depends_on("py-setuptools@19.6:", type=('build', 'run'))
    depends_on("py-sympy@1.0:", type=('build', 'run'))
    depends_on("rockstar@yt", type=('build', 'run'), when="+rockstar")
    depends_on("python@2.7.0:2.7,3.5:", type=('build', 'run'))

    @run_before('install')
    def prep_yt(self):
        if '+rockstar' in self.spec:
            with open('rockstar.cfg', 'w') as rockstar_cfg:
                rockstar_cfg.write(self.spec['rockstar'].prefix)

    @run_after('install')
    @on_package_attributes(run_tests=True)
    def check_install(self):
        # The Python interpreter path can be too long for this
        # yt = Executable(join_path(prefix.bin, "yt"))
        # yt("--help")
        python(join_path(self.prefix.bin, "yt"), "--help")