ooici / coverage-model

BSD 2-Clause "Simplified" License
2 stars 9 forks source link

ConstantOverTime overlapping #170

Closed lukecampbell closed 10 years ago

lukecampbell commented 10 years ago

If I set a parameter value using ConstantOverTime, and set it again later, the latest one completely overwrites the first.

data_dict = {'sparseness' : ConstantOverTime('sparseness', 4096, time_start=0, time_end=3000)}
cov.set_parameter_values(data_dict)
data_dict = {'sparseness' : ConstantOverTime('sparseness', 2048, time_start=30, time_end=3000)}
cov.set_parameter_values(data_dict)

Results in

><> cov.get_parameter_values(['sparseness']).get_data()
-->
rec.array([(-9999999.0, 20.0), (-9999999.0, 21.0), (-9999999.0, 22.0),
       (-9999999.0, 23.0), (-9999999.0, 24.0), (-9999999.0, 25.0),
       (-9999999.0, 26.0), (-9999999.0, 27.0), (-9999999.0, 28.0),
       (-9999999.0, 29.0), (2048.0, 30.0), (2048.0, 31.0), (2048.0, 32.0),
       (2048.0, 33.0), (2048.0, 34.0), (2048.0, 35.0), (2048.0, 36.0),
       (2048.0, 37.0), (2048.0, 38.0), (2048.0, 39.0)],
      dtype=[('sparseness', '<f8'), ('time', '<f8')])
caseybryant commented 10 years ago

Corrected with commit fcc5b45741f6c86f2a5ec3ab90c31dd3193d358a.

Validated with test_postgres_storage.py:TestPostgresStorageInt.test_add_constant

lukecampbell commented 10 years ago

Looks good! Thanks!