From 13c036eeea6f162cc8ed3b4e6769fae92302dce0 Mon Sep 17 00:00:00 2001
From: dmt <>
Date: Thu, 24 Oct 2019 21:51:26 +0200
Subject: [PATCH] Define temporary methods to extract blocks,
 time_sigma_relatives and estimate density.

---
 cml/domain/data_source.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cml/domain/data_source.py b/cml/domain/data_source.py
index 0865640..c877ae1 100644
--- a/cml/domain/data_source.py
+++ b/cml/domain/data_source.py
@@ -108,6 +108,16 @@ class DataSource:
     def __len__(self):
         return self.__source.length
 
+    def get_block(self, indices=None):
+        return self.__source.get_block_via_index(indices)
+
+    def time_sigma_relatives(self, block):
+        return next(iter(self.__learnblock_identifier._identify_relatives(
+            block, "T", "Sigma")))
+
+    def estimate_density(self, data):
+        return self.__learnblock_identifier.density_estimator(data).density()
+
 
 class Preprocessor:
     TIME_COLUMN = "T"
-- 
GitLab