-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for prior initialization of ROSCO (#401)
* Add mpi_tools to rosco * Check for prior initialization * Check if ROSCO has already been initialized * Add unit test for rosco initialization * Run example 4 * Only publish on macos-latest * Update install directory
- Loading branch information
Showing
9 changed files
with
227 additions
and
169 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,34 @@ | ||
''' | ||
Unit testing for ROSCO | ||
Tests: | ||
initialization | ||
''' | ||
|
||
import os | ||
import unittest | ||
|
||
|
||
# ROSCO toolbox modules | ||
from rosco import discon_lib_path | ||
from rosco.toolbox import control_interface as ROSCO_ci | ||
|
||
|
||
class UnitTesting(unittest.TestCase): | ||
def test_initialization(self): | ||
|
||
this_dir = os.path.dirname(os.path.abspath(__file__)) | ||
param_filename = os.path.join(this_dir,'../../Examples/Test_Cases/IEA-15-240-RWT-UMaineSemi/DISCON-UMaineSemi.IN') | ||
|
||
|
||
# Load controller library | ||
ci_1 = ROSCO_ci.ControllerInterface(discon_lib_path,param_filename=param_filename,sim_name='sim1') | ||
|
||
ci_2 = ROSCO_ci.ControllerInterface(discon_lib_path,param_filename=param_filename,sim_name='sim2') | ||
|
||
# Check that the error is as expected | ||
assert("b'ROSCO:ERROR: This ROSCO dynamic library has already been loaded" == str(ci_2.avcMSG.raw).split('.')[0]) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |