Skip to content
Snippets Groups Projects
Commit 7a5a9856 authored by Markus Frank's avatar Markus Frank Committed by MarkusFrankATcernch
Browse files

Fix python style according to Flake8

parent 1ce48e0a
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,15 @@
#
# ==========================================================================
from __future__ import absolute_import, unicode_literals
import logging
import DDG4
import os
from g4units import GeV, m
#
#
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
"""
dd4hep example setup using the python configuration
......@@ -85,7 +89,7 @@ def run():
(11 * GeV, 22 * GeV, 33 * GeV, 44 * GeV),
(111 * GeV, 222 * GeV, 333 * GeV, 444 * GeV)]
act.list_str = ['aa', 'bb', 'cc' ,'dd']
act.list_str = ['aa', 'bb', 'cc', 'dd']
act.list_bool = [0, 0, 0, 1, 1, 1]
act.list_int = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8]
act.list_long = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8]
......@@ -94,11 +98,11 @@ def run():
act.list_double = [0 * m, 1 * m, 2 * m, 3 * m, 4 * m, 5 * m, 6 * m, 7 * m, 8 * m, 8 * m, 8 * m]
act.list_XYZPoint = [(1, 2, 3), (11, 22, 33), (111, 222, 333), (1111, 2222, 3333)]
act.list_XYZVector = [(1, 2, 3), (11, 22, 33), (111, 222, 333), (1111, 2222, 3333)]
act.list_PxPyPzEVector = [(1 * GeV, 2 * GeV, 3 * GeV,4 * GeV),
act.list_PxPyPzEVector = [(1 * GeV, 2 * GeV, 3 * GeV, 4 * GeV),
(11 * GeV, 22 * GeV, 33 * GeV, 44 * GeV),
(111 * GeV, 222 * GeV, 333 * GeV, 444 * GeV)]
act.vector_str = ['aa', 'bb', 'cc' ,'dd']
act.vector_str = ['aa', 'bb', 'cc', 'dd']
act.vector_bool = [0, 0, 0, 1, 1, 1]
act.vector_int = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8]
act.vector_long = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 8]
......@@ -114,26 +118,20 @@ def run():
act.enableUI()
# Check read access:
"""
print('--> {value}'.format(value='-------------------------------------------------------'))
print('--> {value}'.format(value=str(act.prop_str))) # 'Hello World!'
print('--> {value}'.format(value=str(act.prop_bool))) # True
print('--> {value}'.format(value=str(act.prop_int))) # 1234
print('--> {value}'.format(value=str(act.prop_float))) # 1234567.8
print('--> {value}'.format(value=str(act.prop_double))) # 1234567.8
print('--> {value}'.format(value=str(act.prop_XYZPoint))) # (1,2,3)
print('--> {value}'.format(value=str(act.prop_XYZVector))) # (1 * m,2 * m,3 * m)
print('--> {value}'.format(value=str(act.prop_PxPyPzEVector))) # (1 * GeV,2 * GeV,3 * GeV,4 * GeV)
print('--> {value}'.format(value='-------------------------------------------------------'))
"""
logger.info('--> {value}'.format(value='-------------------------------------------------------'))
logger.info('--> {value}'.format(value=str(act.prop_str))) # 'Hello World!'
logger.info('--> {value}'.format(value=str(act.prop_bool))) # True
logger.info('--> {value}'.format(value=str(act.prop_int))) # 1234
logger.info('--> {value}'.format(value=str(act.prop_float))) # 1234567.8
logger.info('--> {value}'.format(value=str(act.prop_double))) # 1234567.8
logger.info('--> {value}'.format(value=str(act.prop_XYZPoint))) # (1,2,3)
logger.info('--> {value}'.format(value=str(act.prop_XYZVector))) # (1 * m,2 * m,3 * m)
logger.info('--> {value}'.format(value=str(act.prop_PxPyPzEVector))) # (1 * GeV,2 * GeV,3 * GeV,4 * GeV)
logger.info('--> {value}'.format(value='-------------------------------------------------------'))
phys = geant4.setupPhysics('FTFP_BERT')
phys.dump()
ui.Commands = [
'/ddg4/Test/show',
'/ddg4/Test/dumpProperties',
'/ddg4/UI/exit'
]
ui.Commands = ['/ddg4/Test/show', '/ddg4/Test/dumpProperties', '/ddg4/UI/exit']
kernel.NumEvents = 0
kernel.configure()
kernel.initialize()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment