Skip to content

Commit

Permalink
fix: placate flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Feb 4, 2024
1 parent 347d966 commit 6ae0a93
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DDG4/python/DDSim/Helper/Action.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ def calorimeterSDTypes(self):
def calorimeterSDTypes(self, val):
self._calorimeterSDTypes = ConfigHelper.makeList(val)


@staticmethod
def makeListOfDictFromJSON(val):
if isinstance(val, str):
# assumes: valid JSON string or comma-separated list of names
import json
try:
val = json.loads(val)
except:
except ValueError as e:
val = tuple(val.split(","))
if isinstance(val, tuple):
# assumes: ( "Geant4TestEventAction", {"Property_int": 10} )
Expand All @@ -141,7 +140,7 @@ def makeListOfDictFromJSON(val):
if isinstance(val, dict):
# assumes: { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} }
# creates: [ { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } ]
val = [ val ]
val = [val]
if isinstance(val, list):
# assumes: [ { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } ]
return val
Expand Down

0 comments on commit 6ae0a93

Please sign in to comment.