This repository was archived by the owner on Mar 30, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
hypervector/resources/core Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ import numpy as np
1
2
import requests
2
3
3
4
import hypervector
@@ -47,12 +48,20 @@ def list(cls, ensemble):
47
48
def new (cls , ensemble , expected_output ):
48
49
endpoint = f"{ hypervector .API_BASE } /definition/{ ensemble .definition_uuid } " \
49
50
f"/ensemble/{ ensemble .ensemble_uuid } /benchmarks/add"
51
+
52
+ if isinstance (expected_output , np .ndarray ):
53
+ expected_output = expected_output .tolist ()
54
+
50
55
data = {"expected_output" : expected_output }
51
56
response = requests .post (endpoint , json = data , headers = cls .get_headers ()).json ()
52
57
return cls .from_response (response )
53
58
54
59
def assert_equal (self , output_to_assert ):
55
60
endpoint = f"{ hypervector .API_BASE } /benchmark/{ self .benchmark_uuid } /assert"
61
+
62
+ if isinstance (output_to_assert , np .ndarray ):
63
+ output_to_assert = output_to_assert .tolist ()
64
+
56
65
data = {"output_to_assert" : output_to_assert }
57
66
response = requests .post (endpoint , json = data , headers = self .get_headers ()).json ()
58
67
return response
Original file line number Diff line number Diff line change 5
5
6
6
setup (
7
7
name = 'hypervector-wrapper' ,
8
- version = '0.0.10 ' ,
8
+ version = '0.0.11 ' ,
9
9
description = 'Python wrapper to use the Hypervector API. Better data tests' ,
10
10
long_description = long_description ,
11
11
long_description_content_type = "text/markdown" ,
14
14
url = "https://github.com/hypervectorio/hypervector-wrapper" ,
15
15
packages = find_packages (exclude = ["tests" ]),
16
16
install_requires = [
17
- "requests ~=2.25.0"
17
+ "requests ~=2.25.0" ,
18
+ "numpy ~=1.20.2"
18
19
],
19
20
extras_require = {
20
21
"dev" : [
You can’t perform that action at this time.
0 commit comments