Skip to content

Commit fbacdd2

Browse files
authored
Chore: Many small corrections and Nada Numpy update to 2.0.0 (#52)
* chore: updated numpy to version 2.0.0 * chore: added optional dependencies for examples and linting * fix: added .gitignore to prevent not found file errors * fix: Added linear_regression to testing infrastructure * chore: bump version number
1 parent 17b8eca commit fbacdd2

38 files changed

+384
-155
lines changed

examples/broadcasting/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import asyncio
99

10-
import nada_numpy.client as na_client
1110
import numpy as np
1211
import py_nillion_client as nillion
12+
from common.utils import compute, store_program, store_secret_array
1313
from config import DIM
1414
from cosmpy.aerial.client import LedgerClient
1515
from cosmpy.aerial.wallet import LocalWallet
@@ -20,7 +20,7 @@
2020
get_quote_and_pay, pay_with_quote)
2121
from py_nillion_client import NodeKey, UserKey
2222

23-
from common.utils import compute, store_program, store_secret_array
23+
import nada_numpy.client as na_client
2424

2525
home = os.getenv("HOME")
2626
load_dotenv(f"{home}/.config/nillion/nillion-devnet.env")

examples/broadcasting/src/broadcasting.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
from typing import List
44

5-
# Step 0: Nada Numpy is imported with this line
6-
import nada_numpy as na
75
from config import DIM
86
from nada_dsl import Output, SecretInteger
97

8+
# Step 0: Nada Numpy is imported with this line
9+
import nada_numpy as na
10+
1011

1112
def nada_main() -> List[Output]:
1213
"""

examples/common/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import time
55
from typing import Any, Callable, Dict, List
66

7-
import nada_numpy as na
8-
import nada_numpy.client as na_client
97
import numpy as np
108
import py_nillion_client as nillion
119
from cosmpy.aerial.client import LedgerClient
@@ -14,6 +12,9 @@
1412
create_payments_config, get_quote,
1513
get_quote_and_pay, pay_with_quote)
1614

15+
import nada_numpy as na
16+
import nada_numpy.client as na_client
17+
1718

1819
def async_timer(file_path: os.PathLike) -> Callable:
1920
"""

examples/dot_product/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import asyncio
99

10-
import nada_numpy.client as na_client
1110
import numpy as np
1211
import py_nillion_client as nillion
12+
from common.utils import compute, store_program, store_secret_array
1313
from config import DIM
1414
from cosmpy.aerial.client import LedgerClient
1515
from cosmpy.aerial.wallet import LocalWallet
@@ -20,11 +20,10 @@
2020
get_quote_and_pay, pay_with_quote)
2121
from py_nillion_client import NodeKey, UserKey
2222

23-
from common.utils import compute, store_program, store_secret_array
23+
import nada_numpy.client as na_client
2424

2525
home = os.getenv("HOME")
2626
load_dotenv(f"{home}/.config/nillion/nillion-devnet.env")
27-
# load_dotenv(f"/workspaces/ai/.nillion-testnet.env")
2827

2928

3029
# Main asynchronous function to coordinate the process

examples/dot_product/src/dot_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from typing import List
44

55
from config import DIM
6+
from nada_dsl import Output, SecretInteger
67

78
# Step 0: Nada Numpy is imported with this line
89
import nada_numpy as na
9-
from nada_dsl import Output, SecretInteger
1010

1111

1212
def nada_main() -> List[Output]:

examples/linear-regression/main.py renamed to examples/linear_regression/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import asyncio
99

10-
import nada_numpy.client as na_client
1110
import numpy as np
1211
import py_nillion_client as nillion
12+
from common.utils import compute, store_program, store_secret_array
1313
from cosmpy.aerial.client import LedgerClient
1414
from cosmpy.aerial.wallet import LocalWallet
1515
from cosmpy.crypto.keypairs import PrivateKey
@@ -20,12 +20,10 @@
2020
from py_nillion_client import NodeKey, UserKey
2121
from sklearn.linear_model import Ridge
2222

23-
from common.utils import compute, store_program, store_secret_array
23+
import nada_numpy.client as na_client
2424

2525
home = os.getenv("HOME")
26-
2726
load_dotenv(f"{home}/.config/nillion/nillion-devnet.env")
28-
# load_dotenv(f"/workspaces/ai/.nillion-testnet.env")
2927

3028

3129
# Main asynchronous function to coordinate the process

examples/linear-regression/src/determinant.py renamed to examples/linear_regression/src/determinant.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import nada_numpy as na
21
import numpy as np
32
from nada_dsl import *
3+
4+
import nada_numpy as na
45
from nada_numpy.array import NadaArray
56

67

examples/linear-regression/src/gauss_jordan.py renamed to examples/linear_regression/src/gauss_jordan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import nada_numpy as na
21
import numpy as np
32
from modular_inverse import PRIME, public_modular_inverse
43
from nada_dsl import *
54

5+
import nada_numpy as na
6+
67
# from nada_crypto import random_lu_matrix, public_modular_inverse
78

89

0 commit comments

Comments
 (0)