Skip to content

Commit e230307

Browse files
committed
[MNT] Code formatting
1 parent 4fb8821 commit e230307

16 files changed

+100
-151
lines changed

LICENSE

Lines changed: 49 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,50 @@ documentation files (the "Software").
1414
The copyright holder hereby grants you a non-exclusive, non-transferable, free
1515
of charge right to copy, modify, merge, publish, distribute, and sublicense
1616
the Software for the sole purpose of performing non-commercial scientific
17-
research, non-commercial education, or non-commercial artistic projects provided
18-
that the following conditions are met:
19-
20-
* Redistributions of source code must retain the above copyright notice, this list
21-
of conditions and the following disclaimer.
22-
23-
* Redistributions in binary form must reproduce the above copyright notice, this list
24-
of conditions and the following disclaimer in the documentation and/or other
25-
materials provided with the distribution.
26-
27-
* All advertising materials mentioning features or use of this software must display
28-
the following information in the acknowledgement part: This product includes software
29-
developed by the LAMDA, Nanjing University, China.
30-
31-
* In academic research publications and other publications where full and partial
32-
implementations of the code or binary distribution are used, presented, compared
33-
evaluated etc., a description or citation to the relevant articles ''Z.-H. Zhou and
34-
J. Feng, Deep Forest, National Science Review, vol. 6, no. 1, pp. 74-86, 2018'' and
35-
''Z.-H. Zhou and J. Feng, Deep Forest: Towards an alternative to deep neural networks,
36-
in IJCAI, 2017'' should be listed explicitly. In addition, this distribution should
37-
be given in the acknowledgement part in the following format: This work includes
38-
software developed by the LAMDA, Naning University, China.
39-
40-
Any other use, in particular any use for commercial purposes, requires the grant
41-
from the LAMDA, Nanjing University, China. This includes, without limitation,
42-
incorporation in a commercial product, use in a commercial service, or production
43-
of other artefacts for commercial purposes.
44-
45-
For all use above, including the non-commercial and commercial ones, neither the name
46-
of the LAMDA, Nanjing University, China nor the names of its contributors may be used to
47-
endorse or promote products derived from this software without specific prior
48-
written permission.
49-
50-
THIS SOFTWARE IS PROVIDED BY LAMDA, NANJING UNIVERSITY, CHINA ''AS IS'' AND ANY EXPRESS
51-
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
52-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
53-
THE LAMDA, NANJING UNIVERSITY, CHINA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
54-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
55-
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
57-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
58-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17+
research, non-commercial education, or non-commercial artistic projects
18+
provided that the following conditions are met:
19+
20+
* Redistributions of source code must retain the above copyright notice, this
21+
list of conditions and the following disclaimer.
22+
23+
* Redistributions in binary form must reproduce the above copyright notice,
24+
this list of conditions and the following disclaimer in the documentation
25+
and/or other materials provided with the distribution.
26+
27+
* All advertising materials mentioning features or use of this software must
28+
display the following information in the acknowledgement part: This product
29+
includes software developed by the LAMDA, Nanjing University, China.
30+
31+
* In academic research publications and other publications where full and
32+
partial implementations of the code or binary distribution are used,
33+
presented, compared evaluated etc., a description or citation to the relevant
34+
articles ''Z.-H. Zhou and J. Feng, Deep Forest, National Science Review,
35+
vol. 6, no. 1, pp. 74-86, 2018'' and ''Z.-H. Zhou and J. Feng, Deep Forest:
36+
Towards an alternative to deep neural networks, in IJCAI, 2017'' should be
37+
listed explicitly. In addition, this distribution should be given in the
38+
acknowledgement part in the following format: This work includes software
39+
developed by the LAMDA, Naning University, China.
40+
41+
Any other use, in particular any use for commercial purposes, requires the
42+
grant from the LAMDA, Nanjing University, China. This includes, without
43+
limitation, incorporation in a commercial product, use in a commercial service,
44+
or production of other artefacts for commercial purposes.
45+
46+
For all use above, including the non-commercial and commercial ones, neither
47+
the name of the LAMDA, Nanjing University, China nor the names of its
48+
contributors may be used to endorse or promote products derived from this
49+
software without specific prior written permission.
50+
51+
THIS SOFTWARE IS PROVIDED BY LAMDA, NANJING UNIVERSITY, CHINA ''AS IS'' AND ANY
52+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
53+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
54+
DISCLAIMED. IN NO EVENT SHALL THE LAMDA, NANJING UNIVERSITY, CHINA BE LIABLE
55+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
56+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
57+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
58+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
59+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5961

6062

6163
From Scikit-Learn
@@ -124,8 +126,8 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
124126
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
125127
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126128

127-
From Numpy:
128-
-----------
129+
From Numpy
130+
----------
129131

130132
BSD 3-Clause License
131133

@@ -160,8 +162,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
160162
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
161163
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
162164

163-
From Scipy:
164-
-----------
165+
From Scipy
166+
----------
165167

166168
BSD 3-Clause License
167169

@@ -374,4 +376,4 @@ From Cython
374376
incurred by, or claims asserted against, such Contributor by reason
375377
of your accepting any such warranty or additional liability.
376378

377-
END OF TERMS AND CONDITIONS
379+
END OF TERMS AND CONDITIONS

deepforest/_binner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Implementation of the Binner in Deep Forest.
2+
Implementation of the Binner class in Deep Forest.
33
44
This class is modified from:
55
https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/ensemble/_hist_gradient_boosting/binning.py

deepforest/_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""A wrapper on base estimator."""
1+
"""A wrapper on the base estimator for naming consistency."""
22

33

44
__all__ = ["Estimator"]

deepforest/_io.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class is designed to support the partial mode in deep forest.
44
"""
55

6+
67
__all__ = ["Buffer"]
78

89
import os

deepforest/_layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Implementation of forest-based Cascade Layer."""
1+
"""Implementation of the forest-based cascade layer."""
22

33

44
__all__ = ["Layer"]

deepforest/forest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Implementation of the forest for classification in Deep Forest.
2+
Implementation of the forest model for classification in Deep Forest.
33
44
This class is modified from:
55
https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/_forest.py

deepforest/tree/_criterion.pxd

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
# Authors: Gilles Louppe <[email protected]>
2-
# Peter Prettenhofer <[email protected]>
3-
# Brian Holt <[email protected]>
4-
# Joel Nothman <[email protected]>
5-
# Arnaud Joly <[email protected]>
6-
# Jacob Schreiber <[email protected]>
7-
#
8-
# License: BSD 3 clause
1+
# This header file is modified from:
2+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_criterion.pxd
93

10-
# See _criterion.pyx for implementation details.
114

125
import numpy as np
136
cimport numpy as np

deepforest/tree/_criterion.pyx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
# cython: boundscheck=False
33
# cython: wraparound=False
44

5-
# Authors: Gilles Louppe <[email protected]>
6-
# Peter Prettenhofer <[email protected]>
7-
# Brian Holt <[email protected]>
8-
# Noel Dawe <[email protected]>
9-
# Satrajit Gosh <[email protected]>
10-
# Lars Buitinck
11-
# Arnaud Joly <[email protected]>
12-
# Joel Nothman <[email protected]>
13-
# Fares Hedayati <[email protected]>
14-
# Jacob Schreiber <[email protected]>
15-
# Nelson Liu <[email protected]>
16-
#
17-
# License: BSD 3 clause
5+
# This class is modified from:
6+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_criterion.pyx
7+
188

199
from libc.stdlib cimport calloc
2010
from libc.stdlib cimport free

deepforest/tree/_splitter.pxd

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
# Authors: Gilles Louppe <[email protected]>
2-
# Peter Prettenhofer <[email protected]>
3-
# Brian Holt <[email protected]>
4-
# Joel Nothman <[email protected]>
5-
# Arnaud Joly <[email protected]>
6-
# Jacob Schreiber <[email protected]>
7-
#
8-
# License: BSD 3 clause
9-
10-
# See _splitter.pyx for details.
1+
# This header file is modified from:
2+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_splitter.pxd
3+
114

125
import numpy as np
136
cimport numpy as np

deepforest/tree/_splitter.pyx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@
22
# cython: boundscheck=False
33
# cython: wraparound=False
44

5-
# Authors: Gilles Louppe <[email protected]>
6-
# Peter Prettenhofer <[email protected]>
7-
# Brian Holt <[email protected]>
8-
# Noel Dawe <[email protected]>
9-
# Satrajit Gosh <[email protected]>
10-
# Lars Buitinck
11-
# Arnaud Joly <[email protected]>
12-
# Joel Nothman <[email protected]>
13-
# Fares Hedayati <[email protected]>
14-
# Jacob Schreiber <[email protected]>
15-
#
16-
# License: BSD 3 clause
5+
# This class is modified from:
6+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_splitter.pyx
7+
178

189
from ._criterion cimport Criterion
1910

deepforest/tree/_tree.pxd

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
# The header file for `_tree.pyx`
2-
#
3-
# Author: Yi-Xuan Xu <[email protected]>
4-
# Last Modified: December, 2020
5-
6-
# Modified from the implementation of decision tree in Scikit-Learn.
7-
# Authors: Gilles Louppe <[email protected]>
8-
# Peter Prettenhofer <[email protected]>
9-
# Brian Holt <[email protected]>
10-
# Joel Nothman <[email protected]>
11-
# Arnaud Joly <[email protected]>
12-
# Jacob Schreiber <[email protected]>
13-
# Nelson Liu <[email protected]>
14-
#
15-
# License: BSD 3 clause
1+
# This header file is modified from:
2+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_tree.pxd
163

174

185
import numpy as np

deepforest/tree/_tree.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ from cpython cimport Py_INCREF, PyObject, PyTypeObject
77

88
from libc.stdlib cimport free
99
from libc.string cimport memcpy
10+
# This class is modified from:
11+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_tree.pyx
12+
13+
1014
from libc.string cimport memset
1115
from libc.stdint cimport SIZE_MAX
1216

deepforest/tree/_utils.pxd

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
# Authors: Gilles Louppe <[email protected]>
2-
# Peter Prettenhofer <[email protected]>
3-
# Arnaud Joly <[email protected]>
4-
# Jacob Schreiber <[email protected]>
5-
# Nelson Liu <[email protected]>
6-
#
7-
# License: BSD 3 clause
8-
9-
# See _utils.pyx for details.
1+
# This header file is modified from:
2+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_utils.pxd
3+
104

115
import numpy as np
126
cimport numpy as np

deepforest/tree/_utils.pyx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
# cython: boundscheck=False
33
# cython: wraparound=False
44

5-
# Authors: Gilles Louppe <[email protected]>
6-
# Peter Prettenhofer <[email protected]>
7-
# Arnaud Joly <[email protected]>
8-
# Jacob Schreiber <[email protected]>
9-
# Nelson Liu <[email protected]>
10-
#
11-
#
12-
# License: BSD 3 clause
5+
# This header file is modified from:
6+
# https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/tree/_utils.pyx
7+
138

149
from libc.stdlib cimport free
1510
from libc.stdlib cimport malloc

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[build-system]
2-
# Minimum requirements for the build system to execute.
32
requires = [
43
"setuptools",
54
"wheel",

setup.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,24 @@
88
from numpy.distutils.core import setup
99

1010

11-
DISTNAME = 'deepforest'
11+
# Package Info
12+
DISTNAME = "deep-forest"
1213
DESCRIPTION = "Deep Forest"
13-
with open('README.rst') as f:
14+
with open("README.rst") as f:
1415
LONG_DESCRIPTION = f.read()
15-
MAINTAINER = 'Yi-Xuan Xu'
16-
MAINTAINER_EMAIL = '[email protected]'
17-
URL = 'https://github.com/LAMDA-NJU/Deep-Forest'
18-
VERSION = '0.1.0'
16+
MAINTAINER = "Yi-Xuan Xu"
17+
MAINTAINER_EMAIL = "[email protected]"
18+
URL = "https://github.com/LAMDA-NJU/Deep-Forest"
19+
VERSION = "0.1.0"
1920

2021

21-
def configuration(parent_package='', top_path=None):
22-
if os.path.exists('MANIFEST'):
23-
os.remove('MANIFEST')
22+
def configuration(parent_package="", top_path=None):
23+
if os.path.exists("MANIFEST"):
24+
os.remove("MANIFEST")
2425

2526
from numpy.distutils.misc_util import Configuration
2627
config = Configuration(None, parent_package, top_path)
27-
config.add_subpackage('deepforest')
28+
config.add_subpackage("deepforest")
2829

2930
return config
3031

@@ -49,19 +50,18 @@ def configuration(parent_package='', top_path=None):
4950
long_description=LONG_DESCRIPTION,
5051
zip_safe=False,
5152
classifiers=[
52-
'Intended Audience :: Science/Research',
53-
'Intended Audience :: Developers',
54-
'Programming Language :: C',
55-
'Programming Language :: Python',
56-
'Topic :: Software Development',
57-
'Topic :: Scientific/Engineering',
58-
'Operating System :: Microsoft :: Windows',
59-
'Operating System :: POSIX',
60-
'Operating System :: Unix',
61-
'Programming Language :: Python :: 3',
62-
'Programming Language :: Python :: 3.6',
63-
'Programming Language :: Python :: 3.7',
64-
'Programming Language :: Python :: 3.8',
53+
"Intended Audience :: Science/Research",
54+
"Intended Audience :: Developers",
55+
"Programming Language :: C",
56+
"Programming Language :: Python",
57+
"Topic :: Software Development",
58+
"Topic :: Scientific/Engineering",
59+
"Operating System :: Microsoft :: Windows",
60+
"Operating System :: Unix",
61+
"Programming Language :: Python :: 3",
62+
"Programming Language :: Python :: 3.6",
63+
"Programming Language :: Python :: 3.7",
64+
"Programming Language :: Python :: 3.8",
6565
],
6666
python_requires=">=3.6",
6767
install_requires=[

0 commit comments

Comments
 (0)