-
Notifications
You must be signed in to change notification settings - Fork 2
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 #16 from dslosky-usgs/updates
Add core tests and roll version
- Loading branch information
Showing
6 changed files
with
34 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .core import * | ||
from .damage import * | ||
from .damping import * | ||
from .spectrum import * | ||
|
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,29 @@ | ||
import unittest | ||
|
||
from shakecastaebm.capacity import get_capacity | ||
from shakecastaebm.core import run | ||
|
||
class TestRun(unittest.TestCase): | ||
def test_Runs(self): | ||
# run shakecast example | ||
hazard = [ | ||
{'x': .03, 'y': 1.1377}, | ||
{'x': 1.0, 'y': .8302}, | ||
{'x': 3.0, 'y': .348} | ||
] | ||
|
||
hazard_beta = .5 | ||
mag = 6.7 | ||
r_rup = 20 | ||
|
||
capacity = get_capacity('C2', 'high', 1, 24, 2, 1990, 'very_poor', 'poor') | ||
|
||
results = run(capacity, | ||
hazard, hazard_beta, mag, r_rup) | ||
|
||
for result in results: | ||
self.assertIsNotNone(result) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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