Skip to content

Commit

Permalink
Changed np.bool to np.bool_ as those have been depreciated. (#107)
Browse files Browse the repository at this point in the history
* Changed np.bool to np.bool_ as those have been depreciated.
https://numpy.org/doc/stable/release/1.24.0-notes.html#expired-deprecations
  • Loading branch information
harshcurious committed Jun 22, 2023
1 parent f3bf1c2 commit e8557b6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest]
python-version: [3.8, 3.9, '3.10']

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions mltype/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def text2features(text, vocabulary):

ch2ix = {ch: ix for ix, ch in enumerate(vocabulary)}

output = np.zeros((text_size, vocab_size), dtype=np.bool)
output = np.zeros((text_size, vocab_size), dtype=np.bool_)
for i, ch in enumerate(text):
try:
output[i, ch2ix[ch]] = True
Expand Down Expand Up @@ -195,7 +195,7 @@ def sample_char(
if previous_chars:
features = text2features(previous_chars, vocabulary)
else:
features = np.zeros((1, len(vocabulary)), dtype=np.bool)
features = np.zeros((1, len(vocabulary)), dtype=np.bool_)

network.eval()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"pytest-coverage",
"tox",
],
"mlflow": ["mlflow<=1.10.0"],
"mlflow": ["mlflow"],
},
entry_points={
"console_scripts": [
Expand Down
1 change: 0 additions & 1 deletion tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

class TestTypedTextWriter:
def test_colors(self, monkeypatch):

expected_keys = {
"color_default_background",
"color_default_foreground",
Expand Down
3 changes: 1 addition & 2 deletions tests/test_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_basic(self):
vocabulary = ["a", "b", "c"]

res_true = np.array(
[[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.bool
[[1, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 0]], dtype=np.bool_
)
res = text2features(text, vocabulary)

Expand Down Expand Up @@ -275,7 +275,6 @@ def test_forward_pass(self):
)

def test_pl(self, monkeypatch, tmpdir):

batch_size = 2
window_size = 3
vocab_size = 4
Expand Down

0 comments on commit e8557b6

Please sign in to comment.