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
12import requests
23
34import hypervector
@@ -47,12 +48,20 @@ def list(cls, ensemble):
4748 def new (cls , ensemble , expected_output ):
4849 endpoint = f"{ hypervector .API_BASE } /definition/{ ensemble .definition_uuid } " \
4950 f"/ensemble/{ ensemble .ensemble_uuid } /benchmarks/add"
51+
52+ if isinstance (expected_output , np .ndarray ):
53+ expected_output = expected_output .tolist ()
54+
5055 data = {"expected_output" : expected_output }
5156 response = requests .post (endpoint , json = data , headers = cls .get_headers ()).json ()
5257 return cls .from_response (response )
5358
5459 def assert_equal (self , output_to_assert ):
5560 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+
5665 data = {"output_to_assert" : output_to_assert }
5766 response = requests .post (endpoint , json = data , headers = self .get_headers ()).json ()
5867 return response
Original file line number Diff line number Diff line change 55
66setup (
77 name = 'hypervector-wrapper' ,
8- version = '0.0.10 ' ,
8+ version = '0.0.11 ' ,
99 description = 'Python wrapper to use the Hypervector API. Better data tests' ,
1010 long_description = long_description ,
1111 long_description_content_type = "text/markdown" ,
1414 url = "https://github.com/hypervectorio/hypervector-wrapper" ,
1515 packages = find_packages (exclude = ["tests" ]),
1616 install_requires = [
17- "requests ~=2.25.0"
17+ "requests ~=2.25.0" ,
18+ "numpy ~=1.20.2"
1819 ],
1920 extras_require = {
2021 "dev" : [
You can’t perform that action at this time.
0 commit comments