Skip to content

Commit

Permalink
Merge branch master into v1-file-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Oct 18, 2024
2 parents cbc74ae + 99de965 commit ca1df43
Show file tree
Hide file tree
Showing 25 changed files with 1,431 additions and 337 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/cache@v4
with:
path: test-data
key: test-data-v13
key: test-data-v14
- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: |
Expand All @@ -38,6 +38,7 @@ jobs:
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/E906nlo_bin_00.tar'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/FK_ATLASTTBARTOT13TEV.dat'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/FK_POSXDQ.dat'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/LHC8-Mtt-HT4-173_3-bin1.tab.gz'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/LHCBWZMU7TEV_PI_part1.appl'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/LHCB_DY_8TEV.pineappl.lz4'
curl -s -C - -O 'https://data.nnpdf.science/pineappl/test-data/LHCB_DY_8TEV.tar'
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
of the respective class instead
- removed the constructor `Grid::with_subgrid_type`

## [0.8.6] - 18/10/2024

### Fixed

- fixed [Issue #318](https://github.com/NNPDF/pineappl/issues/318) that caused
fastNLO tables with `NPDFDim = 2` to be incorrectly imported

## [0.8.5] - 07/10/2024

### Fixed

- fixed a bug in `pineappl_applgrid` that lead to linking problems with ROOT
and `gfortran`

## [0.8.4] - 04/10/2024

### Fixed

- fixed a bug that lead to inconsistent convolution metadata
(https://github.com/NNPDF/pineappl/issues/316)

## [0.8.3] - 30/08/2024

### Fixed

- fixed the scale-variation label in the plotting script produced by `pineappl
Expand Down Expand Up @@ -689,9 +712,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- first release

[Unreleased]: https://github.com/NNPDF/pineappl/compare/v0.8.2...HEAD
[0.8.4]: https://github.com/NNPDF/pineappl/compare/v0.8.3...v0.8.4
[0.8.3]: https://github.com/NNPDF/pineappl/compare/v0.8.2...v0.8.3
[0.8.2]: https://github.com/NNPDF/pineappl/compare/v0.8.1...v0.8.2
[0.8.1]: https://github.com/NNPDF/pineappl/compare/v0.8.0...v0.8.1
[0.8.0]: https://github.com/NNPDF/pineappl/compare/v0.7.4...v0.8.0
[0.7.5]: https://github.com/NNPDF/pineappl/compare/v0.7.4...v0.7.5
[0.7.4]: https://github.com/NNPDF/pineappl/compare/v0.7.3...v0.7.4
[0.7.3]: https://github.com/NNPDF/pineappl/compare/v0.7.2...v0.7.3
[0.7.2]: https://github.com/NNPDF/pineappl/compare/v0.7.1...v0.7.2
Expand Down
7 changes: 7 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ To update the CLI simply repeat the `cargo install` step; if a newer version is
available it will be automatically downloaded, otherwise `cargo` will exit with
a message saying that the most recent version is already installed.

If `LHAPDF` is not found, you need to update your `PKG_CONFIG_PATH` variable,
which must point to the directory where LHAPDF's `.pc` file is installed:

export PKG_CONFIG_PATH=${lhapdf_prefix}/lib/pkgconfig:$PKG_CONFIG_PATH

(replace `${lhapdf_prefix}` with your LHAPDF installation root).

#### Optional: APPLgrid exporter/importer

If you'd like to convert APPLgrids to PineAPPL grids, or vice versa, make sure
Expand Down
4 changes: 3 additions & 1 deletion docs/maintainers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
is pushed to the repository. It then uploads pre-compiled libraries of the
CAPI for Linux, MacOS and Windows to Github, publishes the crates to
<https://crates.io/> and the Python wheels to <https://pypi.org/>. Finally,
it creates a new release on PineAPPL's Github [release page]
it creates a new release on PineAPPL's Github [release page]. You can
manually run this workflow from any branch to check whether it works, if
there's no tag no actual release will be made.
- `rust.yml`: checks whether the Rust code succesfully compiles and generates
code coverage
- `.github/codecov.yml`: configuration file for PineAPPL's [codecov page]
Expand Down
184 changes: 0 additions & 184 deletions examples/python/dyaa.py

This file was deleted.

21 changes: 12 additions & 9 deletions examples/python/positivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ def main(filename, Q2):
pid = 4

# init pineappl objects
lumi_entries = [pineappl.lumi.LumiEntry([(pid, lepton_pid, 1.0)])]
lumi_entries = [pineappl.boc.Channel([(pid, lepton_pid, 1.0)])]
orders = [pineappl.grid.Order(0, 0, 0, 0)]
bins = len(xgrid)
bin_limits = list(map(float, range(0, bins + 1)))
# NOTE: `bin_limits` have to be `np.ndarray`
bin_limits = np.array([float(i) for i in range(0, bins + 1)])
# subgrid params - default is just sufficient
params = pineappl.subgrid.SubgridParams()
# inti grid
grid = pineappl.grid.Grid.create(lumi_entries, orders, bin_limits, params)
grid = pineappl.grid.Grid(lumi_entries, orders, bin_limits, params)
limits = []
# add each point as a bin
for bin_, x in enumerate(xgrid):
Expand All @@ -31,13 +32,15 @@ def main(filename, Q2):
# create and set
subgrid = pineappl.import_only_subgrid.ImportOnlySubgridV1(
array[np.newaxis, :, np.newaxis],
[Q2],
xgrid,
[1.0],
np.array([Q2]), # `q2_grid` has to be `np.ndarrary`
np.array(xgrid), # `x_grid` has to be `np.ndarrary`
np.array([1.0]), # `x_grid` has to be `np.ndarrary`
)
grid.set_subgrid(0, bin_, 0, subgrid)
grid.set_subgrid(0, bin_, 0, subgrid.into())
# set the correct observables
normalizations = [1.0] * bins
normalizations = np.array(
[1.0] * bins
) # `normalizations` has to be `np.ndarray`
remapper = pineappl.bin.BinRemapper(normalizations, limits)
grid.set_remapper(remapper)

Expand All @@ -55,4 +58,4 @@ def main(filename, Q2):


if __name__ == "__main__":
main("charm-positivity.pineappl", 1.5 ** 2)
main("charm-positivity.pineappl", 1.5**2)
6 changes: 4 additions & 2 deletions maintainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
- `generate-coverage.sh`: generates code coverage locally
- `make-release.sh`: this script is supposed to be run by the maintainer to
create a new release. The only argument is the version number
- `test-ploughshare-conversion.sh`: downloads APPLgrids and fastNLO tables from
[Ploughshare] and tests PineAPPL's CLI `import` subcommand with them
- `test-cli-import.sh`: downloads APPLgrids and fastNLO tables from
[Ploughshare] and [Mitov's ttbar page] and tests PineAPPL's CLI `import`
subcommand with them

[Ploughshare]: https://ploughshare.web.cern.ch/ploughshare/
[Mitov's ttbar page]: https://www.precision.hep.phy.cam.ac.uk/results/ttbar-fastnlo/
1 change: 1 addition & 0 deletions maintainer/generate-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/E906nlo_bin_00.tar'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/FK_ATLASTTBARTOT13TEV.dat'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/FK_POSXDQ.dat'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/LHC8-Mtt-HT4-173_3-bin1.tab.gz'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/LHCBWZMU7TEV_PI_part1.appl'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/LHCB_DY_8TEV.pineappl.lz4'
wget --no-verbose --no-clobber -P test-data 'https://data.nnpdf.science/pineappl/test-data/LHCB_DY_8TEV.tar'
Expand Down
12 changes: 6 additions & 6 deletions maintainer/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ for feature in ${features[@]}; do
cargo test --release --features=${feature}
done

echo ">>> Testing if 'pineappl' can be published ..."

cd pineappl
cargo publish --dry-run
cd ..

echo ">>> Updating version strings ..."

# we don't want to create a changelog entry for prereleases, which are solely
Expand Down Expand Up @@ -107,6 +101,12 @@ echo ">>> Updating Cargo.lock ..."
echo ${crates[@]} | xargs printf ' -p %s' | xargs cargo update
git add Cargo.lock

echo ">>> Testing if 'pineappl' can be published ..."

cd pineappl
cargo publish --dry-run
cd ..

echo ">>> Commiting and pushing changes ..."

git commit -m "Release v${version}"
Expand Down
Loading

0 comments on commit ca1df43

Please sign in to comment.