Created
October 5, 2012 18:36
-
-
Save blazetopher/3841581 to your computer and use it in GitHub Desktop.
Functional persistence!!
This file contains hidden or 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
><> from coverage_model.test.examples import * | |
><> cov=oneparamcov(False,False) | |
><> cov.insert_timesteps(100) | |
><> cov.num_timesteps | |
--> 110 | |
><> cov.get_time_values() | |
--> | |
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, | |
9, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999]) | |
><> cov.set_parameter_values('time', [23,68,75,100],[[23,68,75,100]]) | |
><> cov.get_time_values() | |
--> | |
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, | |
9, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, 23, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, 68, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, 75, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, 100, -9999, -9999, -9999, -9999, | |
-9999, -9999]) | |
><> cov.set_parameter_values('time', [43,44,45,46,47,48,49],slice(43,50)) | |
><> cov.get_time_values() | |
--> | |
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, | |
9, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, 23, -9999, -9999, -9999, -9999, 43, 44, 45, | |
46, 47, 48, 49, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, 68, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, 75, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, 100, -9999, -9999, -9999, -9999, | |
-9999, -9999]) | |
><> cov.persistence_guid | |
--> '3B9694F8-DF16-4022-B412-69D3AD53534A' | |
><> |
This file contains hidden or 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
><> from coverage_model.coverage import SimplexCoverage | |
><> cov=SimplexCoverage.new_load('test_data','3B9694F8-DF16-4022-B412-69D3AD53534A') | |
><> cov.num_timesteps | |
--> 110 | |
><> cov.insert_timesteps(10) | |
><> cov.num_timesteps | |
--> 120 | |
><> cov.get_time_values() | |
--> | |
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, | |
9, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, 100, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, 43, 44, | |
45, 46, 47, 48, 49, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, 23, -9999, -9999, -9999, | |
-9999, -9999, -9999, 75, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, 68, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, -9999, | |
-9999, -9999, -9999]) | |
><> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment