Skip to content

Compatibility with pineappl >= 1.0#106

Merged
felixhekhorn merged 15 commits intomainfrom
pineappl_v1
Oct 7, 2025
Merged

Compatibility with pineappl >= 1.0#106
felixhekhorn merged 15 commits intomainfrom
pineappl_v1

Conversation

@giacomomagni
Copy link
Contributor

This PR aims to update the integrability and positivity scripts to be compatible with pineappl v 1.0.

@giacomomagni giacomomagni marked this pull request as draft July 23, 2025 14:39
@felixhekhorn felixhekhorn changed the title Compatibility with pineapple == 1.1.0 Compatibility with pineappl == 1.1.0 Aug 6, 2025
@felixhekhorn felixhekhorn changed the title Compatibility with pineappl == 1.1.0 Compatibility with pineappl >= 1.0 Aug 6, 2025
@felixhekhorn
Copy link
Contributor

felixhekhorn commented Sep 15, 2025

Let's try to merge this! but there are still issues:

  1. somehow pylint doesn't seem to understand pineappl, see e.g. here . As a temporary fix I simply deactivate it, but this is surely not the right solution. I can reproduce that error locally, but I can also do poetry run python -c "import pineappl; help(pineappl.grid.Grid.read)" and get something sane back. What is the problem?
  2. vrap needs to be adjusted as well, see here
  3. there are some cyclic imports going round, which might be an issue - see here

help would be appreciated @giacomomagni @Radonirinaunimi 😇

EDIT: PS: the local pylint command even generates a core dump 🤯

@Radonirinaunimi
Copy link
Member

Radonirinaunimi commented Sep 17, 2025

Thanks a lot @felixhekhorn for this!

1. somehow `pylint` doesn't seem to understand pineappl, see e.g. [here](https://github.com/NNPDF/pinefarm/actions/runs/17730698648/job/50381068173#step:10:30) . As a temporary fix I simply deactivate it, but this is surely not the right solution. I can reproduce that error locally, but I can also do `poetry run python -c "import pineappl; help(pineappl.grid.Grid.read)"` and get something sane back. What is the problem?

This is always a problem with compiled extensions and dynamically generated modules. PyO3 doesn't generate static files but compiled libraries. The problem is that pylint checks module hierarchies statically and therefore cannot understand the module structure, classes, and functions $-$ which in this case only exists at runtime.

The solutions are basically:

For the sake of not delaying this PR, perhaps we can live with the first option for the time being and implement the correct fix soon later.

@felixhekhorn
Copy link
Contributor

The solutions are basically:

* instruct `pylint` to ignore the `pineappl` modules

you're right of course - stupid me; done in 4d7c8c3

pylint still correctly complaints about vrap

@Radonirinaunimi
Copy link
Member

Apologies, I haven't had the chance to look into this yet (last week was very hectic). I will try to do so either later today or tomorrow.

@Radonirinaunimi Radonirinaunimi marked this pull request as ready for review September 30, 2025 17:14
Copy link
Member

@Radonirinaunimi Radonirinaunimi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be merged so that people could consistently produce grids/fks from this. I would address the Cyclic in another PR (as main is plagued with same warnings anyway).

@felixhekhorn felixhekhorn merged commit f3c4423 into main Oct 7, 2025
5 checks passed
tmp_grid.write(tmp_output)
# Now merge it into the main grid!
main_grid.merge_from_file(tmp_output)
main_grid.merge(tmp_grid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Radonirinaunimi actually, I just noticed this change: I guess line 195 is no longer needed and so is line 190? (i.e. temporarily writing to disk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants