Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Aug 14, 2024
1 parent 8bce28c commit 872b01b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
8 changes: 0 additions & 8 deletions pineappl_py/docs/source/implementation.rst

This file was deleted.

3 changes: 1 addition & 2 deletions pineappl_py/docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Welcome to PineAPPL
===================

This is the Python wrapper for the `Rust PineAPPL library <https://nnpdf.github.io/pineappl/>`_.
This is the Python wrapper for the `Rust PineAPPL library <https://nnpdf.github.io/pineappl/>`_ using `PyO3 <https://pyo3.rs>`_.

PineAPPL is a computer library that makes it possible to produce fast-interpolation grids for fitting parton distribution functions (PDFs) including corrections of strong and electroweak origin.

Expand All @@ -18,6 +18,5 @@ We also list some common :doc:`recipes` here.

installation
recipes
implementation
API <modules/pineappl>
indices
14 changes: 4 additions & 10 deletions pineappl_py/docs/source/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ How can I convolve a given PineAPPL grid with my PDF?
import lhapdf
g = pineappl.grid.Grid.read("path/to/grid.pineappl.lz4")
pdf = lhapdf.mkPDF("YourPDF", 0)
bins = g.convolve(pdf.xfxQ2, pdf.xfxQ2, pdf.alphasQ2)
bins = g.convolve_with_one(2212, pdf.xfxQ2, pdf.alphasQ2)
If the grid is actually an FkTable just replace

Expand All @@ -23,16 +23,11 @@ If the grid is actually an FkTable just replace
.. note::

For the :meth:`pineappl.pineappl.PyGrid.read` function, both ``.pineappl``
For the :meth:`pineappl.grid.Grid.read` function, both ``.pineappl``
and ``.pineappl.lz4`` extensions are acceptable, as long as they are
consistent (without ``.lz4`` the grid is assumed not to be compressed, with
it is assumed compressed).

This is asymmetric with respect to the
:meth:`pineappl.pineappl.PyGrid.write` function, in which the function will
refuse to guess, so another version is provided to write a compressed grid,
:meth:`pineappl.pineappl.PyGrid.write_lz4`

How can I edit a grid?
----------------------

Expand Down Expand Up @@ -60,9 +55,8 @@ change even the bins themselves.
remapper = pineappl.bin.BinRemapper(normalizations, limits)
g.set_remapper(remapper)
For more details about :class:`pineappl.bin.BinRemapper` check also the `Rust
documentation
<https://docs.rs/pineappl/latest/pineappl/bin/struct.BinRemapper.html>`_, e.g.
For more details about :class:`pineappl.bin.BinRemapper` check also
the Rust documentation of :rustdoc:`pineappl::bin::BinRemapper <bin/struct.BinRemapper.html>`, e.g.
on how to treat multidimensional distributions.

How can I get the bin configurations from a given PineAPPL grid?
Expand Down

0 comments on commit 872b01b

Please sign in to comment.