Closed berland closed 6 years ago
OK - that should be possible; assuming the deck looks like this:
DATES
1. JAN 2000 /
KW1
KW2
KW3
DATES
1. FEB 2000 /
KW4
KW5
KW6
If removing the 1. FEB 2000 DATES keyword; should then also KW1, KW2 and KW3 be removed?
No, KW1, 2 and 3 should be kept. 4 5 and 6 should be deleted.
Ok
Fixed here: https://github.com/Statoil/sunbeam/pull/83
Bug in #83 found it seems:
from sunbeam.tools import TimeVector
import datetime
foo = TimeVector(datetime.datetime(2017,1,1))
foo.add_keywords(datetime.datetime(2018,1,1), ['FOO18'])
foo.add_keywords(datetime.datetime(2019,1,1), ['FOO19'])
foo.add_keywords(datetime.datetime(2020,1,1), ['FOO20'])
foo.delete(datetime.datetime(2019,1,1))
foo.delete(datetime.datetime(2020,1,1))
IndexError: list assignment index out of range
The first delete() statement works fine, but the second one fails. I suspect book-keeping-bug.
(in a "real" world case I got removal of other tsteps than the ones I asked for, I speculate that is the same bug as this one)
Bug in #83 found it seems:
Looks good. Closing.
There is a need for an API call to remove date (or list of dates) from a TimeVector