Skip to content

Commit

Permalink
card length check skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
kbat committed Sep 25, 2024
1 parent bab6161 commit 555794b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mctools/fluka/fluka-add-card.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def main():
parser.add_argument('inp', type=str, help='FLUKA input file name')
parser.add_argument('-card', type=str, nargs='+', help='card(s) to add. Each card corresponds to a single line of the FLUKA input and must contain 8 words. Empty WHATs are marked with a dash (-) symbol.')
parser.add_argument('-before', dest='before', type=str, help='input file line pattern which should directly follow the card(s) being inserted', default="STOP")
parser.add_argument('-replace', action='store_true', default=False, dest='replace', help='replace the BEFORE pattern with the given card(s)')

args = parser.parse_args()

Expand All @@ -18,10 +19,13 @@ def main():
l = l.strip()
if re.search(f"\A{args.before}", l):
for card in args.card:
n = len(card.split())
assert n == 8, f"{card}: incorrect card length of {n}"
# n = len(card.split())
# assert n == 8, f"{card}: incorrect card length of {n}"
line(*card.split())
print(l)
if not args.replace:
print(l)
else:
print(l)

if __name__ == "__main__":
sys.exit(main())

0 comments on commit 555794b

Please sign in to comment.