Skip to content

Commit

Permalink
docs: fix typo, add gitignore, remove obsolet MANIFEST.in
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschle committed Nov 8, 2024
1 parent 6a8ae3d commit 1d73557
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 247 deletions.
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,7 @@ repos:
- pyupgrade
args:
- --py39-plus
- repo: https://github.com/mgedmin/check-manifest
rev: '0.50'
hooks:
- id: check-manifest
args: [--no-build-isolation]
additional_dependencies: ['hatch-vcs', 'hatchling>=1.17.1']

- repo: https://github.com/sondrelg/pep585-upgrade
rev: v1.0
hooks:
Expand Down
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/_build/
/api/*.rst
2 changes: 1 addition & 1 deletion docs/api/static/zfit_physics.compwa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Import the module with:
import zfit_physics.compwa as zcompwa
This will enable that :py:function:`~ tensorwaves.estimator.Estimator`, can be used as a loss function in zfit minimizers as
This will enable that a :py:class:`~ tensorwaves.estimator.Estimator`, for example ``estimator`` in the following, can be used as a loss function in zfit minimizers as

.. code-block:: python
Expand Down
42 changes: 34 additions & 8 deletions docs/api/static/zfit_physics.roofit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,52 @@ For example via conda:
$ mamba install -c conda-forge root
.. jupyter-execute::
:hide-code:
:hide-output:

import numpy as np
from ROOT import RooArgSet, RooDataSet, RooGaussian, RooRealVar

data = np.random.normal(loc=2.0, scale=3.0, size=1000)

mur = RooRealVar("mu", "mu", 1.2, -4, 6)
sigmar = RooRealVar("sigma", "sigma", 1.3, 0.5, 10)
obsr = RooRealVar("x", "x", -2, 3)
RooFit_gauss = RooGaussian("gauss", "gauss", obsr, mur, sigmar)

RooFit_data = RooDataSet("data", "data", {obsr})
for d in data:
obsr.setVal(d)
RooFit_data.add(RooArgSet(obsr))

minimizer = zfit.minimize.Minuit()

Import the module with:

.. code-block:: python

import zfit_physics.roofit as ztfroofit

this will enable the RooFit functionality in zfit.
.. jupyter-execute::

We can create a RooFit NLL as ``RooFit_nll`` and use it as a loss function in zfit. For example, with a Gaussian model ``RooFit_gauss`` and a dataset ``RooFit_data``, both created with RooFit:
import zfit_physics.roofit as zroofit

this will enable the RooFit functionality in zfit and allow to automatically minimize the function using a zfit minimimzer as

.. code-block:: python
.. jupyter-execute::

RooFit_nll = RooFit_gauss.createNLL(RooFit_data)
minimizer.minimize(loss=RooFit_nll)

We can create a RooFit NLL as ``RooFit_nll`` and use it as a loss function in zfit. For example, with a Gaussian model ``RooFit_gauss`` and a dataset ``RooFit_data``, both created with RooFit:

.. jupyter-execute::

result = minimizer.minimize(loss=RooFit_nll)

More explicitly, the loss function can be created with

.. code-block:: python
.. jupyter-execute::

nll = zroofit.loss.nll_from_roofit(fcn)
nll = zroofit.loss.nll_from_roofit(RooFit_nll)


Variables
Expand Down
4 changes: 2 additions & 2 deletions docs/api/static/zfit_physics.tfpwa.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TF-PWA
=======================

TFPWA is a generic software package intended for Partial Wave Analysis (PWA). It can be connected with zfit,
TF-PWA is a generic software package intended for Partial Wave Analysis (PWA). It can be connected with zfit,
currently by providing a loss function that can be minimized by a zfit minimizer.

Import the module with:
Expand All @@ -10,7 +10,7 @@ Import the module with:
import zfit_physics.tfpwa as ztfpwa
This will enable that :py:function:`~tfpwa.model.FCN` can be used as a loss function in zfit minimizers as
This will enable that :py:class:`~tf_pwa.model.FCN` can be used as a loss function in zfit minimizers as

.. code-block:: python
Expand Down
7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_argus.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_cmsshape.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_conv.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_cruijff.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_erfexp.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_example.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_kde.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_novosibirsk.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_relbw.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.models.pdf_tsallis.rst

This file was deleted.

24 changes: 0 additions & 24 deletions docs/api/zfit_physics.models.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.pdf.rst

This file was deleted.

24 changes: 0 additions & 24 deletions docs/api/zfit_physics.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/api/zfit_physics.unstable.pdf.rst

This file was deleted.

15 changes: 0 additions & 15 deletions docs/api/zfit_physics.unstable.rst

This file was deleted.

5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@
"matplotlib": ("https://matplotlib.org/stable/", None),
"pandas": ("https://pandas.pydata.org/docs/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference/", None),
"tensorwaves": ("https://tensorwaves.readthedocs.io/latest/", None),
"zfit": ("https://zfit.readthedocs.io/en/latest/", None),
"tf_pwa": ("https://tf-pwa.readthedocs.io/en/latest/", None),
"pyhf": ("https://pyhf.readthedocs.io/en/latest/", None),
}

# -- Options for todo extension ----------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions docs/make_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ MAKE_DOCS_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
popd > /dev/null

# generate the ReST files
echo "debug"
echo ${MAKE_DOCS_PATH}/../zfit_physics
#echo ${MAKE_DOCS_PATH}/../zfit_physics
ls ${MAKE_DOCS_PATH}
ls .
sphinx-apidoc -o ${MAKE_DOCS_PATH}/api ${MAKE_DOCS_PATH}/../zfit_physics -fMeT && \
sphinx-apidoc -o ${MAKE_DOCS_PATH}/api ${MAKE_DOCS_PATH}/../src/zfit_physics -fMeT && \
python3 ${MAKE_DOCS_PATH}/api/tools/change_headline.py ${MAKE_DOCS_PATH}/api/zfit_physics.* && \
make -C ${MAKE_DOCS_PATH} clean && make -C ${MAKE_DOCS_PATH} html -j8 && \
echo "Documentation successfully built!" || echo "FAILED to build Documentation"
67 changes: 0 additions & 67 deletions tests/roofit/test_loss_compat.py

This file was deleted.

0 comments on commit 1d73557

Please sign in to comment.