From 32056da93bcbae9b4b6d5bfdf2bd0a3b62e2d3b7 Mon Sep 17 00:00:00 2001 From: kean-smullen-nnl <51930705+kean-smullen-nnl@users.noreply.github.com> Date: Tue, 9 Feb 2021 18:12:20 -0500 Subject: [PATCH] New Package: py-xgboost (#21470) * new python package py-xgboost added * py-xgboost spack style applied * py-xgboost: Addressing PR #21470 comments. Added variant descriptions and fixed scikit-learn when clause --- .../builtin/packages/py-xgboost/package.py | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-xgboost/package.py diff --git a/var/spack/repos/builtin/packages/py-xgboost/package.py b/var/spack/repos/builtin/packages/py-xgboost/package.py new file mode 100644 index 0000000000..5a12966afe --- /dev/null +++ b/var/spack/repos/builtin/packages/py-xgboost/package.py @@ -0,0 +1,39 @@ +# Copyright 2013-2021 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 import * + + +class PyXgboost(PythonPackage): + """XGBoost is an optimized distributed gradient boosting library designed to be + highly efficient, flexible and portable.""" + + homepage = 'https://xgboost.ai/' + pypi = 'xgboost/xgboost-1.3.3.tar.gz' + + version('1.3.3', sha256='397051647bb837915f3ff24afc7d49f7fca57630ffd00fb5ef66ae2a0881fb43') + + variant('pandas', default=False, description='Enable Pandas extensions for training.') + variant('scikit-learn', default=False, description='Enable scikit-learn extensions for training.') + variant('dask', default=False, description='Enables Dask extensions for distributed training.') + variant('plotting', default=False, description='Enables tree and importance plotting.') + + depends_on('cmake', type='build') + depends_on('python@3.6:', type=('build', 'run')) + depends_on('py-setuptools', type=('build')) + depends_on('py-numpy', type=('build', 'run')) + depends_on('py-scipy', type=('build', 'run')) + + depends_on('py-pandas', when='+pandas', type=('build', 'run')) + + depends_on('py-scikit-learn', when='+scikit-learn', type=('build', 'run')) + + depends_on('py-dask', when='+dask', type=('build', 'run')) + depends_on('py-pandas', when='+dask', type=('build', 'run')) + depends_on('py-distributed', when='+dask', type=('build', 'run')) + + depends_on('py-graphviz', when='+plotting', type=('build', 'run')) + depends_on('py-matplotlib', when='+plotting', type=('build', 'run'))