From f227223667d81d96c41b5d020eb046e4ed7d4276 Mon Sep 17 00:00:00 2001
From: gino <gino2007@gmail.com>
Date: Sat, 1 Apr 2023 23:17:10 +0200
Subject: [PATCH] added control on Actror

---
 GenDevice/excelIcd.py | 9 ++++++++-
 install.sh            | 2 +-
 setup.py              | 2 +-
 test/readIcdFile.py   | 6 +++++-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/GenDevice/excelIcd.py b/GenDevice/excelIcd.py
index 946aa94..bb135b9 100755
--- a/GenDevice/excelIcd.py
+++ b/GenDevice/excelIcd.py
@@ -34,8 +34,15 @@ class excelIcd:
 		self.nsheets = len(self.book.sheet_names)
 		if(self.debug):
 			print(self.nsheets,self.book.sheet_names)
+		actor="ALL"
 		for sheet_name in (self.book.sheet_names):
-			she=(self.book.parse(sheet_name)) #.dropna(axis=0,how='all')
+
+			#print(sheet_name)
+			if( sheet_name!="Main"):
+				query="`Actor` =="+ "'"+actor+"'"
+				she=(self.book.parse(sheet_name)).query(query) #.dropna(axis=0,how='all')
+			else:
+				she=(self.book.parse(sheet_name))
 			self.sheets[sheet_name]=she #.dropna(axis=1,how='all')
 			siz=self.sheets[sheet_name].shape
 			if(self.debug):
diff --git a/install.sh b/install.sh
index 16bb570..abcebdd 100644
--- a/install.sh
+++ b/install.sh
@@ -1,2 +1,2 @@
 python setup.py bdist_wheel
-python -m pip install dist/GenDevice-0.3-py3-none-any.whl
+python -m pip install dist/GenDevice-0.7-py3-none-any.whl
diff --git a/setup.py b/setup.py
index d8af525..766f4aa 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
 from setuptools import setup
 setup(name='GenDevice',
-version='0.3',
+version='0.7',
 description='Python code generator for ASTRI-MA',
 url='#',
 author='Gino Tosti',
diff --git a/test/readIcdFile.py b/test/readIcdFile.py
index 91f1abf..6acae4d 100644
--- a/test/readIcdFile.py
+++ b/test/readIcdFile.py
@@ -15,13 +15,17 @@ if __name__=="__main__":
                   help="ICD Exel File ", metavar="FILE")
 	parser.add_option("-s", "--sheet", dest="sheet", default='Main',
                   help="ICD Exel File Sheet Name to show", metavar="SHEET")
+	parser.add_option("-a", "--actor", dest="actor", default='ALL',
+                  help="ICD Exel File Actor Name to show", metavar="ACTOR")
 
 	(options, args) = parser.parse_args()
 	gen_dir=os.environ["PYGEN"]
 	excel_file =options.book_file
 	wb=excelIcd(excel_file)
 	get=wb.getSheet(options.sheet)
-	print(get)
+	#query="`Actor` =="+ "'"+options.actor+"'"
+	#get=(wb.book.parse(options.sheet)).query(query)
+	print(get["Actor"])
 
 
 
-- 
GitLab