Skip to content

Commit 56ccd9d

Browse files
Merge pull request #56 from yuta-nakahara/release-0.2.1
Release 0.2.1
2 parents 9342dcf + dd64ef4 commit 56ccd9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5896
-4179
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Plain text
137137

138138
```
139139
Y. Nakahara, N. Ichijo, K. Shimada, Y. Iikubo,
140-
S. Saito, K. Kazama, T. Matsushima, ``BayesML 0.2.0,''
140+
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML 0.2.1,''
141141
[Online] https://github.com/yuta-nakahara/BayesML
142142
```
143143

@@ -147,8 +147,8 @@ BibTeX
147147
@misc{bayesml,
148148
author = {Nakahara Yuta and Ichijo Naoki and Shimada Koshi and
149149
Iikubo Yuji and Saito Shota and Kazama Koki and
150-
Matsushima Toshiyasu}
151-
title = {BayesML 0.2.0},
150+
Matsushima Toshiyasu and {BayesML Developers}},
151+
title = {BayesML 0.2.1},
152152
howpublished = {\url{https://github.com/yuta-nakahara/BayesML}},
153153
year = {2022}
154154
}

README_jp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ BayesMLへのコントリビューションを考えてくださってありが
134134

135135
```
136136
Y. Nakahara, N. Ichijo, K. Shimada, Y. Iikubo,
137-
S. Saito, K. Kazama, T. Matsushima, ``BayesML 0.2.0,''
137+
S. Saito, K. Kazama, T. Matsushima, BayesML Developers, ``BayesML 0.2.1,''
138138
[Online] https://github.com/yuta-nakahara/BayesML
139139
```
140140

@@ -144,8 +144,8 @@ BibTeX
144144
@misc{bayesml,
145145
author = {Nakahara Yuta and Ichijo Naoki and Shimada Koshi and
146146
Iikubo Yuji and Saito Shota and Kazama Koki and
147-
Matsushima Toshiyasu}
148-
title = {BayesML 0.2.0},
147+
Matsushima Toshiyasu and {BayesML Developers}},
148+
title = {BayesML 0.2.1},
149149
howpublished = {\url{https://github.com/yuta-nakahara/BayesML}},
150150
year = {2022}
151151
}

bayesml/_check.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ def nonneg_ints(val,val_name,exception_class):
4747
return val
4848
raise(exception_class(val_name + " must be int or a numpy.ndarray whose dtype is int. Its values must be non-negative (including 0)."))
4949

50+
def pos_ints(val,val_name,exception_class):
51+
try:
52+
return pos_int(val,val_name,exception_class)
53+
except:
54+
pass
55+
if type(val) is np.ndarray:
56+
if np.issubdtype(val.dtype,np.integer) and np.all(val>0):
57+
return val
58+
raise(exception_class(val_name + " must be int or a numpy.ndarray whose dtype is int. Its values must be positive (not including 0)."))
59+
5060
def int_vec(val,val_name,exception_class):
5161
if type(val) is np.ndarray:
5262
if np.issubdtype(val.dtype,np.integer) and val.ndim == 1:
@@ -59,6 +69,12 @@ def nonneg_int_vec(val,val_name,exception_class):
5969
return val
6070
raise(exception_class(val_name + " must be a 1-dimensional numpy.ndarray whose dtype is int. Its values must be non-negative (including 0)."))
6171

72+
def pos_int_vec(val,val_name,exception_class):
73+
if type(val) is np.ndarray:
74+
if np.issubdtype(val.dtype,np.integer) and val.ndim == 1 and np.all(val>0):
75+
return val
76+
raise(exception_class(val_name + " must be a 1-dimensional numpy.ndarray whose dtype is int. Its values must be positive (not including 0)."))
77+
6278
def nonneg_int_vecs(val,val_name,exception_class):
6379
if type(val) is np.ndarray:
6480
if np.issubdtype(val.dtype,np.integer) and val.ndim >= 1 and np.all(val>=0):

0 commit comments

Comments
 (0)