Closed manuelfs closed 3 years ago
For tabgen.py
, it uses an external library, tabulate
to generate LaTeX tables. So far my idea has been: If you need to have minor tweaks of the .tex
table, paste it to an actual .tex
file and change there.
It does feel like we probably should move tabgen.py
to this repository: lhcb-ntuples-gen/tools
.
I suspect if we want to have the generated .tex
file to really be the final final version, we probably should roll our own LaTeX table generation.
BTW, the scripts
directory is already exported to PATH
, so you probably can replace ./scripts/cutflow_output_yml_gen.py
with just cutflow_output_yml_gen.py
.
Also, we probably should update Makefile
so that the cutflow generation is just calling your run_cutflows.py
. In this case, I'm in favor of remove the actual cutflow generation procedure in the Makefile
itself, and use the Makefile
just like a registry/pointer.
To summarize, I'd like to do the following:
tabgen.py
from pyTuplingUtils
to the tools
folder of this projectrun_cutflows.py
to workflows/rdx-cutflows.py
Makefile
so that make rdx-cutflow
is just running your cutflow scriptI have some other ideas to simplify the scripts
, tools
and workflows
directories. Let's discuss this on Tue.
Great, those all sound good, but let's discuss on Tuesday indeed.
BTW, the scripts directory is already exported to PATH, so you probably can replace ./scripts/cutflow_output_yml_gen.py with just cutflow_output_yml_gen.py.
In this case it doesn't make much of a difference because it is the primary script, but in general I find that not writing out the full path obfuscate the location of the code for the casual developers, so I'd prefer to use full paths as much as possible.
I finalized my commits to the cutflows, and moved run_cutflows.py
to workflows/
.
Yipeng and I also discussed today
PATH
to make clear to developers less familiar with the code where the code istools
and scripts
can be mergedscripts
and wrapper scripts such as run_cutflows.py
in workflows
scripts
would be moved to a studies
folderI've updated the project as we discussed, including documentations. @manuelfs feel free to close the issue after taking a look.
Did you accidentally delete workflows/rdx-cutflows.py
?
Yes I did. I forgot to add it back after renaming.
Can we close this issue now? @manuelfs
I want to be able to run this package natively in my mac. I finally figured out how to bind python
to python3
in macOS without anaconda (which was giving problems because compiling ROOT
picked up the native python version of 3.9.1, but conda
had 3.8.8): I simply added soft links. I also installed the latest python 3.9.6 with brew
as suggested here, but I'm not sure that was needed.
Also, macOS couldn't find the scripts in the MakeFile
despite theirs folders being added to the PATH
. In any case, I think it is better to be explicit so that we know quickly where these scripts are (workflows
? scripts
? test
?) so I added the paths, and now it all runs natively in mac 🙂
If @yipengsun is happy with this change, you can close the issue.
The only problem is: You still cannot run MuonPID natively, but once we have caching set up, it should be no problem normally.
We have been having issues running several tasks such as cutflows or ntuple-making when the commands are encoded in a
MakeFile
: they are difficult to parse and understand, and to run subsets of.We discussed using simpler scripts, and here's a possible template:
scripts/run_cutflows.py
. It produces thebare
,Dstmu
, anddata
cutflows with the following partial printoutSome features that I think are useful to help developers understand and modify as needed
cat gen/cutflow_bare-sig/cutflow.md
) that allows checking results quicklyFor instance, the command printout was useful several times when I just wanted to change the format of the tables, and I could just copy/paste the
./scripts/cutflow_gen.py
command easily without re-running the time-consuming./scripts/cutflow_output_yml_gen.py
steps where the yields are calculated.A couple of things I found cumbersome
.tex
files do not have preambles, so they cannot quickly visualized withpdflatex cutflow.tex
, and had to be inserted somewhere else..tex
tables in these cutflows I may have had to modify thetabgen.py
command, which is inpyTuplingUtils
.