What is the status of Python 3 migration?

Asked by Matthew Feickert

Hi. Myself and a group of people that I work with are curious about the state of Python 3 support for MadGraph5_aMC@NLO as it isn't clear from the site (to a newcomer like myself) what the status of development is.

From the Blueprint "path to python3" (https://blueprints.launchpad.net/mg5amcnlo/+spec/pythonversion) it is clear that the dev team has thought about this but that post was from 2018-03-01 and there doesn't seem to be any clear public discussion related to it. Searching the questions and answers page for "Python 3" also doesn't seem to return any discussion either.

There is a milestone for beta release v3.2 (https://launchpad.net/mg5amcnlo/+milestone/3.2.x) called "Python 3" but the current release of the v3 series is MG5aMC_3.0.1_beta.tar.gz at (https://launchpad.net/mg5amcnlo/2.0/2.6.x), so it seems that Python 3 support isn't in the near future.

Can the developers explain a bit about the Python 3 migration goals, challenges, and timelines? At the moment, our main interest in using MG5aMC in Python 3 is to be able to integrate into workflows and containers that utilize parallelism from Parsl (http://parsl-project.org/), which is Python 3 only. None of the people I work with are in formal positions to commit to making contributions to the Python 3 development (if it would even be desired from the dev team) but we are interested to know the general thoughts on the migration from the dev team.

Best,
Matthew

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

I'm working on the conversion of the code when I have time (the nominal time is one afternoon per week dedicated to this project).

The current status is the you can now generate events at LO and NLO.
But we still have a lot of tests of our test suite that fails (either with python2 or python3).
And we have only run 2 of the 3 tests suite so far (unittest and acceptance tests are in progress and we have no clue of the status of the parralel test within this version).

In term of time line, I have no idea. In principle we are close but it is impossible for me to evaluate how much serious are the remaining failing tests. Some of them might need only 1 min of my time and some others up to 16h of works (which means 4 weeks at this speeds).
This range is based on the time that I have taken so for to move forward in this stage of tests running.

When all the tests will be passing with both python2 and python3. Then we will have
three phases
1) internal running of the code to discover to MANY bug expected in this version (both in python2 and python3)
2) a closed beta phase (including the MC group of CMS)
3) an open beta phase

In term of release number, the support of python2 will first be done for our current MG5aMC version 2 code (we will likely release two version of it called 2.7.0 and 2.7.0_py3)
and then we will start the same move for our version 3 (likely the same idean with 3.2.0 and 3.2.0_py3)

Cheers,

Olivier

> On 21 Sep 2019, at 08:13, Matthew Feickert <email address hidden> wrote:
>
> New question #684089 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/684089
>
> Hi. Myself and a group of people that I work with are curious about the state of Python 3 support for MadGraph5_aMC@NLO as it isn't clear from the site (to a newcomer like myself) what the status of development is.
>
>> From the Blueprint "path to python3" (https://blueprints.launchpad.net/mg5amcnlo/+spec/pythonversion) it is clear that the dev team has thought about this but that post was from 2018-03-01 and there doesn't seem to be any clear public discussion related to it. Searching the questions and answers page for "Python 3" also doesn't seem to return any discussion either.
>
> There is a milestone for beta release v3.2 (https://launchpad.net/mg5amcnlo/+milestone/3.2.x) called "Python 3" but the current release of the v3 series is MG5aMC_3.0.1_beta.tar.gz at (https://launchpad.net/mg5amcnlo/2.0/2.6.x), so it seems that Python 3 support isn't in the near future.
>
> Can the developers explain a bit about the Python 3 migration goals, challenges, and timelines? At the moment, our main interest in using MG5aMC in Python 3 is to be able to integrate into workflows and containers that utilize parallelism from Parsl (http://parsl-project.org/), which is Python 3 only. None of the people I work with are in formal positions to commit to making contributions to the Python 3 development (if it would even be desired from the dev team) but we are interested to know the general thoughts on the migration from the dev team.
>
> Best,
> Matthew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Matthew Feickert (feickert) said :
#2

Hi Olivier and All,

Following up on this again, I see now that release MadGraph5_aMC@NLO py3.0.2 (https://launchpad.net/mg5amcnlo/+milestone/py3.0.2) is out --- belated congratulations on that! I'll give this release a go with Python 3.7 but I thought I might already ask you if there are known issues or rough corners that I should be on the lookout for.

Best,
Matthew

Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#3

you can look at the UpdateNotes files within your release.
It indicates such information.

Cheers,

Olivier

> On 4 Aug 2020, at 01:05, Matthew Feickert <email address hidden> wrote:
>
> Question #684089 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/684089
>
> Matthew Feickert posted a new comment:
> Hi Olivier and All,
>
> Following up on this again, I see now that release MadGraph5_aMC@NLO
> py3.0.2 (https://launchpad.net/mg5amcnlo/+milestone/py3.0.2) is out ---
> belated congratulations on that! I'll give this release a go with Python
> 3.7 but I thought I might already ask you if there are known issues or
> rough corners that I should be on the lookout for.
>
> Best,
> Matthew
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Matthew Feickert (feickert) said :
#4

Thanks Olivier Mattelaer, that solved my question.

Revision history for this message
Darrell A. Cooney (sonfrai223) said :
#5

Python 3 migration has been underway for several years, and as of September 2021, Python 3 is the primary focus of development and support for the language. Python 2 officially reached its end-of-life on January 1, 2020, and is no longer receiving updates or bug fixes.

The vast majority of Python packages and libraries have already migrated to Python 3, and many have dropped support for Python 2. In addition, many operating systems and cloud platforms now default to Python 3 as their preferred version, making it easier for developers to adopt the latest version of the language.

However, there are still some legacy systems and applications that rely on Python 2, and some developers may encounter compatibility issues when attempting to migrate to Python 3. To help with the transition, there are tools and resources available to aid in the migration process, such as automated code conversion tools and guides on how to update code to be compatible with Python 3.
 https://resijnt.id/

Overall, while the transition to Python 3 has been ongoing for several years, there are still some systems and applications that need to be updated. However, the vast majority of the Python ecosystem has already migrated to Python 3, and it is now the primary focus of development and support for the language.