-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit testing for C dylib is now working
- Loading branch information
1 parent
d33d9af
commit ac1c133
Showing
30 changed files
with
539 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
# C Wrapper | ||
|
||
This workspace is a C wrapper for the `surrealml-core` library. This enables us to no longer need `PyO3` and we can also use this library in other languages. | ||
|
||
## Testing | ||
|
||
To test this C wrapper we first need to build the C lib and position it in the correct location for the Python tests to load the library. We can perform this setup with the following command: | ||
|
||
```bash | ||
sh ./scripts/prep_tests.sh | ||
``` | ||
|
||
This will build the C lib in debug mode and place it in the correct location for the Python tests to load the library. We can then run the tests with the following command: | ||
|
||
```bash | ||
sh ./scripts/run_tests.sh | ||
``` | ||
|
||
If you setup pycharm to put your Python tests through a debugger, you need to open pycharm in the root of this workspace and set the `tests` directory as the sources root. This will allow you to point and click on specific tests and run them through a debugger. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
# navigate to directory | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
cd $SCRIPTPATH | ||
|
||
cd .. | ||
|
||
cd tests | ||
|
||
python3 -m unittest discover . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
//! The C API for executing ML models. | ||
pub mod raw_compute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
//! C API for interacting with the SurML file storage and executing models. | ||
pub mod execution; | ||
pub mod storage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//! C Storage API | ||
pub mod load_model; | ||
pub mod save_model; | ||
pub mod load_cached_raw_model; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.