Commit fef15432 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

provide a `get_overrides` api point to get only the manual overrides

parent 0339eb75a683
......@@ -335,6 +335,12 @@ def test_manual_overrides(engine, tsh):
2010-01-09 4.0
""", tsh.get(engine, 'ts_mixte'))
manual = tsh.get_overrides(engine, 'ts_mixte')
assert_df("""
2010-01-06 3.0
2010-01-09 4.0
""", manual)
def test_first_manual(engine, tsh):
ts_begin = genserie(datetime(2010, 1, 1), 'D', 10)
......
......@@ -78,6 +78,24 @@ class TimeSerie(BaseTS):
# supervision specific API
def get_overrides(self, cn, name, revision_date=None,
from_value_date=None, to_value_date=None):
autotsh = self.auto_store
auto = autotsh.get(cn, name,
revision_date=revision_date,
from_value_date=from_value_date,
to_value_date=to_value_date,
_keep_nans=True)
synth = self.get(cn, name,
revision_date=revision_date,
from_value_date=from_value_date,
to_value_date=to_value_date,
_keep_nans=True)
manual = self.diff(auto, synth)
manual.name = name
return manual
def get_ts_marker(self, cn, name, revision_date=None,
from_value_date=None, to_value_date=None):
table = self._get_ts_table(cn, name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment