Skip to content

Commit

Permalink
Rename base client to state client
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-nillion committed Jun 7, 2024
1 parent 6739dcc commit 2348884
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nada_ai/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from nada_ai.client import BaseClient, TorchClient, SklearnClient
from nada_ai.client import StateClient, TorchClient, SklearnClient
4 changes: 2 additions & 2 deletions nada_ai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def __ensure_numpy(self, array_like: Any) -> np.ndarray:
)


class BaseClient(ModelClient):
"""Base ModelClient for generic model states"""
class StateClient(ModelClient):
"""ModelClient for generic model states"""

def __init__(self, state_dict: Dict[str, Any]) -> None:
"""
Expand Down
8 changes: 4 additions & 4 deletions tests/python-tests/test_model_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from sklearn.linear_model import LinearRegression, LogisticRegression
from torch import nn
from nada_ai.client import ModelClient
from nada_ai import BaseClient, TorchClient, SklearnClient
from nada_ai import StateClient, TorchClient, SklearnClient
import py_nillion_client as nillion


Expand Down Expand Up @@ -73,10 +73,10 @@ def test_sklearn_4(self):
with pytest.raises(NotImplementedError):
model_client.export_state_as_secrets("test_model", nillion.SecretInteger)

def test_base_client_1(self):
base_client = BaseClient({"some_value": 1})
def test_state_client_1(self):
state_client = StateClient({"some_value": 1})

secrets = base_client.export_state_as_secrets("test_model", na.Rational)
secrets = state_client.export_state_as_secrets("test_model", na.Rational)

assert list(secrets.keys()) == ["test_model_some_value_0"]

Expand Down

0 comments on commit 2348884

Please sign in to comment.