Skip to content
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

Merged
merged 26 commits into from
Nov 22, 2022

Conversation

MarkusFrankATcernch
Copy link
Contributor

@MarkusFrankATcernch MarkusFrankATcernch commented Nov 21, 2022

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

@MarkusFrankATcernch MarkusFrankATcernch enabled auto-merge (rebase) November 21, 2022 20:34
auto-merge was automatically disabled November 21, 2022 21:33

Rebase failed

def _evalProperty(data):
"""
Function necessary to extract real strings from the property value.
Strings may be emraced by quotes: '<value>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Strings may be emraced by quotes: '<value>'
Strings may be embraced by quotes: '<value>'

"""
try:
if isinstance(data, str):
return eval(data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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'

@MarkusFrankATcernch MarkusFrankATcernch merged commit 3ec53b6 into AIDASoft:master Nov 22, 2022
/// Execute the chained command statements
for(const auto& c : m_configureCommands) {
info("++ Executing configure command:%s",c.c_str());
mgr->ApplyCommand(c.c_str());
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants