Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed np.bool to np.bool_ as those have been depreciated. #107

Merged
merged 7 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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