forked from YangLab-um/BiologicalOscillations.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request YangLab-um#22 from ftavella/update-network-utilities
Update network utilities and input handling - New functionality
- Loading branch information
Showing
6 changed files
with
243 additions
and
6 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
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
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,18 @@ | ||
using BiologicalOscillations | ||
|
||
# Test is_valid_connectivity | ||
valid_connectivity = [0 0 1; 1 0 0; 0 -1 0] | ||
result, errmsg = is_valid_connectivity(valid_connectivity) | ||
@test result == true | ||
@test errmsg == "" | ||
|
||
invalid_connectivity = [0 0 1; 1 0 0; 0 -1 2] | ||
result, errmsg = is_valid_connectivity(invalid_connectivity) | ||
@test result == false | ||
@test errmsg == "Only -1, 0, and 1 are allowed as connectivity values" | ||
|
||
# Test connectivity_string_to_matrix | ||
connectivity_string = "[0 0 1; 1 0 0; 0 -1 0]" | ||
valid_connectivity = [0 0 1; 1 0 0; 0 -1 0] | ||
connectivity_matrix = connectivity_string_to_matrix(connectivity_string) | ||
@test connectivity_matrix == valid_connectivity |