Skip to content

Commit

Permalink
distutils is replaced with shutil since the former is deprecated in P…
Browse files Browse the repository at this point in the history
…ython 3.12
  • Loading branch information
kbat committed Jun 14, 2024
1 parent b9126d1 commit ddb8dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Project homepage: https://github.com/kbat/mc-tools
* Emacs [syntax highlighting script](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/fluka-mode.el) for [FLUKA](http://www.fluka.org).
* [fluka2root](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/fluka2root.py) tool to convert the FLUKA binary output into [ROOT](https://root.cern). It calls the standard FLUKA tools to merge data files and converts the merged files into a single ROOT file. To understand how it works, run the standard example ```$FLUPRO/flutil/rfluka $FLUPRO/exmixed.inp``` and then execute ```fluka2root exmixed.inp```.
* A more detailed tutorial is available in the [wiki section](https://github.com/kbat/mc-tools/wiki/FLUKA).
* Internally, `fluka2root` uses the following convertes which can be called individually:
* Internally, `fluka2root` runs the following convertes which can (but should not) be called individually:
* [usbsuw2root](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/usbsuw2root.py) script to convert the USRBIN results into a TH3F histogram. Note that this tool does not directly convert the files produced by the USRBIN card, but these files must first be averaged by the $FLUPRO/flutil/usbsuw program. The resulting averaged file can be converted into ROOT by ```usbsuw2root```. The $FLUPRO/flutil/usbsuw call is done automatically if the [fluka2root](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/fluka2root.py) general converter is used.
* [usxsuw2root](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/usxsuw2root.py) script to convert the USRBDX results into a TH2F histogram. + see the comments for the previous item.
* [usrsuw2root](https://github.com/kbat/mc-tools/blob/master/mctools/fluka/usrsuw2root.py) script to convertert the
Expand Down
4 changes: 2 additions & 2 deletions mctools/fluka/fluka2root.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys, re, os, argparse
import glob
from tempfile import NamedTemporaryFile
from distutils.spawn import find_executable
from shutil import which

def str2int(s):
try:
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(self, args):
self.verbose = args.verbose
self.keep = args.keep
self.clean = args.clean
self.parallel = find_executable("parallel") is not None
self.parallel = which("parallel") is not None
self.estimators = [Estimator("USRBDX", "usxsuw"),
Estimator("USRBIN", "usbsuw"),
Estimator("USRCOLL", "ustsuw"),
Expand Down

0 comments on commit ddb8dd8

Please sign in to comment.