From 3436a78a38b1785e246590dcae0e35bb3fc960ff Mon Sep 17 00:00:00 2001
From: Guillaume Baulieu <g.baulieu@ipnl.in2p3.fr>
Date: Thu, 9 Apr 2020 17:12:39 +0200
Subject: [PATCH] Replace all "ricochet.*" aliases with "lio.*"

---
 elasticsearch/ricq.py | 16 ++++++++--------
 ramses/ramses.conf    |  2 +-
 tests/esearch_test.py |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/elasticsearch/ricq.py b/elasticsearch/ricq.py
index 9b59277..10e428b 100755
--- a/elasticsearch/ricq.py
+++ b/elasticsearch/ricq.py
@@ -22,7 +22,7 @@ class DataFetcher:
 
     :Example:
 
-      Retrieving cernox_still and cernox_50k values from the ricochet.temperature index for the 01/09/2019, one value per hour.
+      Retrieving cernox_still and cernox_50k values from the lio.temperature index for the 01/09/2019, one value per hour.
 
       .. code-block:: python
 
@@ -30,7 +30,7 @@ class DataFetcher:
         import ricq
         try:
           df = ricq.DataFetcher()
-          df.fetch(["ricochet.temperature%cernox_still","ricochet.temperature%cernox_50k"]
+          df.fetch(["lio.temperature%cernox_still","lio.temperature%cernox_50k"]
                    ,datetime(2019,9,1), datetime(2019,9,2), "hour")
           d = df.get_data()
           print(d)
@@ -139,8 +139,8 @@ class DataFetcher:
         fields_in = dict() # list of fields per index
         for v in p_user_fields:
             if '%' not in v:
-                print(v," : no explicit index, will use ricochet.temperature")
-                user_index = 'ricochet.temperature'
+                print(v," : no explicit index, will use lio.temperature")
+                user_index = 'lio.temperature'
                 user_field = v
             else:
                 user_index = v.split('%')[0]
@@ -167,7 +167,7 @@ class DataFetcher:
         Connect to the cluster and retrieve data.
         
         :param p_user_fields:
-            A list of strings containing the names of the fields to retrieve and their index with the format "index%field". Index can be either "ricochet.temperature" or "ricochet.cryo".
+            A list of strings containing the names of the fields to retrieve and their index with the format "index%field". Index can be either "lio.temperature" or "lio.cryo".
 
         :param p_start:
             A :class:`datetime.datetime` date describing the start of the data period
@@ -309,13 +309,13 @@ if __name__ == "__main__":
   except getopt.GetoptError:
     print(sys.argv[0],'-s <start_date> -e <end_date> -r <bin_range> -v <value_index%value_name>')
     print("Example : ")
-    print(sys.argv[0],"-s 03-05-2019 -e 09-05-2019 -r 15m -v ricochet.cryo%K6 -v ricochet.temperature%cernox_50k")
+    print(sys.argv[0],"-s 03-05-2019 -e 09-05-2019 -r 15m -v lio.cryo%K6 -v lio.temperature%cernox_50k")
     sys.exit(2)
   for opt, arg in opts:
     if opt in ('-h',"--help"):
       print(sys.argv[0],'-s <start_date> -e <end_date> -r <bin_range> -v <value_index%value_name>')
       print("Example : ")
-      print(sys.argv[0],"-s 03-05-2019 -e 09-05-2019 -r 15m -v ricochet.cryo%K6 -v ricochet.temperature%cernox_50k")
+      print(sys.argv[0],"-s 03-05-2019 -e 09-05-2019 -r 15m -v lio.cryo%K6 -v lio.temperature%cernox_50k")
       print("ALL DATES ARE UTC!")
       print("You can export data to a CSV file instead of plotting them with the option -o <filename>")
       print("Add --display to print the data to stdout.")
@@ -334,7 +334,7 @@ if __name__ == "__main__":
       display = True
 
   if(len(user_fields)==0):
-      user_fields.append("ricochet.temperature%cernox_still")
+      user_fields.append("lio.temperature%cernox_still")
 
   print("From :",start,"(UTC)")
   print("To :",stop,"(UTC)")
diff --git a/ramses/ramses.conf b/ramses/ramses.conf
index b46d922..623067f 100644
--- a/ramses/ramses.conf
+++ b/ramses/ramses.conf
@@ -1,5 +1,5 @@
 {
-  "data_fields":["ricochet.temperature%cernox_4k","ricochet.temperature%cernox_50k","ricochet.cryo%K3","ricochet.cryo%K4","ricochet.cryo%K5","ricochet.cryo%K6","ricochet.cryo%K8"],
+  "data_fields":["lio.temperature%cernox_4k","lio.temperature%cernox_50k","lio.cryo%K3","lio.cryo%K4","lio.cryo%K5","lio.cryo%K6","lio.cryo%K8"],
   "data_interval":"1m",
   "nb_timesteps":15
 }
diff --git a/tests/esearch_test.py b/tests/esearch_test.py
index fd9b547..e3d72bc 100644
--- a/tests/esearch_test.py
+++ b/tests/esearch_test.py
@@ -13,7 +13,7 @@ class TestESearch(unittest.TestCase):
         filename='output.csv'
         start = datetime(2019, 8, 6, 0, 0, 0, 0)
         stop = datetime(2019, 8, 7, 0, 0, 0, 0)
-        df.fetch(['cernox_mc','ricochet.temperature%cernox_still'], start, stop, '1m')
+        df.fetch(['cernox_mc','lio.temperature%cernox_still'], start, stop, '1m')
         df.get_data()
         start_dt, stop_dt = df.get_data_period()
         self.assertEqual(start,start_dt)
@@ -27,9 +27,9 @@ class TestESearch(unittest.TestCase):
         self.assertEqual(num_lines,1441)
         
         df.clear()
-        df.fetch(['cernox_mc','ricochet.temperature%cernox_still'], start, stop, 'unknown')
+        df.fetch(['cernox_mc','lio.temperature%cernox_still'], start, stop, 'unknown')
         self.assertTrue(df.empty())
-        df.fetch(['cernox_mc','ricochet.temperature%cernox_still'], datetime(2017, 8, 6, 0, 0, 0, 0), datetime(2019, 8, 7, 0, 0, 0, 0), '1m')
+        df.fetch(['cernox_mc','lio.temperature%cernox_still'], datetime(2017, 8, 6, 0, 0, 0, 0), datetime(2019, 8, 7, 0, 0, 0, 0), '1m')
         self.assertTrue(df.empty())
 
 if __name__ == '__main__':
-- 
GitLab