-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple commits. See release notes. #1021
Multiple commits. See release notes. #1021
Conversation
Rebase failed
…mands.py. Improve DDDigi
1dbfc47
to
543ff0a
Compare
def _evalProperty(data): | ||
""" | ||
Function necessary to extract real strings from the property value. | ||
Strings may be emraced by quotes: '<value>' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings may be emraced by quotes: '<value>' | |
Strings may be embraced by quotes: '<value>' |
""" | ||
try: | ||
if isinstance(data, str): | ||
return eval(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return eval(data) | |
import ast | |
return ast.literal_eval(data) | |
except ValueError: |
https://docs.python.org/3.7/library/ast.html#ast.literal_eval
Safely(!) eval
>>> import ast
>>> ast.literal_eval('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/ast.py", line 80, in literal_eval
return _convert(node_or_string)
File "/usr/lib64/python2.7/ast.py", line 79, in _convert
raise ValueError('malformed string')
ValueError: malformed string
>>> ast.literal_eval('"foo"')
'foo'
/// Execute the chained command statements | ||
for(const auto& c : m_configureCommands) { | ||
info("++ Executing configure command:%s",c.c_str()); | ||
mgr->ApplyCommand(c.c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add a check for success
BEGINRELEASENOTES
Implemented issue Changing Geant4 physics flags #1010: Changing Geant4 physics flags
o Extended the Geant4UIManager to support command queues at various stages of the program:
-- configure
-- initialize
-- pre-run
-- post-run
-- terminate
o Added interface function to directly communicate with the G4UI using string commands at any time
from python.
o Extended Geant4Kernel functionality to allow client actions to subscribe to stages of the program
and perform dedicated actions on:
-- configure
-- initialize
-- terminate
As an example please see DDG4/src/Geant4UIManager.cpp
Dropped issue DDG4: Particle charge is not properly propagated from the input stage to the output stage #1004 after some tests and investigation:
This issue cannot be resolved, because MC records may also be read without Geant4 and a physics list being initialized.
Hence the event readers cannot implement such a feature if the event record does not support charge, but only the PDG code.
Conclusion is to best update the charge of particles at the output stage using the PDG code or to implement an event action,
which performs this actions right before the output stage.
Simplified component properties.
Improvements to DDDigi (work in progress)
ENDRELEASENOTES