madgraph5 / madgraph4gpu

GPU development for the Madgraph5_aMC@NLO event generator software package
30 stars 33 forks source link

"leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers" from '1.00.01' cudacpp version #1013

Closed valassi closed 3 days ago

valassi commented 4 days ago

I am doing some post-release tests.

I have upgraded 1,00,00 to 1,00,01 in init.py. This fails.

There are several issues:

Now, one could say that I should not have used 1,00,00 to start with, true. But I liked having more digits, and this worked ok. I will try to fix it.

(1) More details on point 1.

This is not user friendly

[avalassi@itscrd90 gcc11/usr] /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/mg5amcnlo> PYTHONPATH=../MG5aMC_PLUGIN ./bin/mg5_aMC -m CUDACPP_OUTPUT
Running MG5 in debug mode
ERROR: CUDACPP_OUTPUT is not present in the PLUGIN directory. Please install it first

Is it possible to expose the error message from import, at least in some cases?

This would be a small patch in bin/mg5amc

(2) More details on point 2

The real issue is here

[avalassi@itscrd90 gcc11/usr] /data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/mg5amcnlo> PYTHONPATH=../MG5aMC_PLUGIN/ python3
Python 3.9.18 (main, Jan 24 2024, 00:00:00) 
[GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('CUDACPP_OUTPUT')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/data/avalassi/GPU2023/madgraph4gpuX/MG5aMC/MG5aMC_PLUGIN/CUDACPP_OUTPUT/__init__.py", line 69
    __version__ = (1,00,01) # NB the release infrastructure expects 1-digit major and 2-digit minor and patch versions (n,nn,nn)
                         ^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers

I guess that there is no way out here. That statement in initpy is not good python

__version__ = (1,00,01)

The only way is to change this into

__version__ = (1,0,1)

and the delegate to the release scripts the fact that this should be called 1.00.01 and not 1.0.1.

So this second issue is a fix in gitTag.sh probably (no need to touch the archiver.sh/py/yml)