Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
olzhasar-reef committed May 6, 2024
1 parent 63bf076 commit b0d35f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/bittensor_panel/core/bt.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load_hyperparams() -> dict[str, int] | None:
return asdict(hyperparams)


def update_remote_hyperparam(name: str, value: int) -> bool:
def update_remote_hyperparam(name: str, value: str) -> bool:
st = get_subtensor()
wallet = get_wallet()

Expand Down
4 changes: 2 additions & 2 deletions app/src/bittensor_panel/core/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_refresh_hyperparams_view(admin_client: Client, mock_refresh_hyperparams
mock_refresh_hyperparams.assert_called_once()

assert response.status_code == 302
assert response.url == "/admin/core/hyperparameter/"
assert response.url == "/admin/core/hyperparameter/" # type: ignore


def test_refresh_hyperparams_view_exception(admin_client: Client, mock_refresh_hyperparams: MagicMock):
Expand All @@ -27,4 +27,4 @@ def test_refresh_hyperparams_view_exception(admin_client: Client, mock_refresh_h
response = admin_client.post("/admin/core/hyperparameter/refresh-hyperparams/")

assert response.status_code == 302
assert response.url == "/admin/core/hyperparameter/"
assert response.url == "/admin/core/hyperparameter/" # type: ignore
4 changes: 2 additions & 2 deletions app/src/bittensor_panel/core/tests/test_bt.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_update_remote_hyperparam(mock_subtensor: MagicMock, mock_wallet: MagicM
mock_subtensor.return_value.set_hyperparameter.return_value = result

name = "difficulty"
value = 10
value = "10"

assert bt.update_remote_hyperparam(name, value) == result

Expand All @@ -137,4 +137,4 @@ def test_update_remote_hyperparam_exception(mock_subtensor: MagicMock, mock_wall
mock_subtensor.return_value.set_hyperparameter.side_effect = RuntimeError

with pytest.raises(SubtensorServerError):
bt.update_remote_hyperparam("difficulty", 10)
bt.update_remote_hyperparam("difficulty", "10")

0 comments on commit b0d35f2

Please sign in to comment.