Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix typo, add gitignore, remove obsolet MANIFEST.in #100

Merged
merged 7 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "mambaforge-22.9"



# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

formats: [ ]
conda:
environment: docs/environment.yml

python:
install:
- requirements: docs/additional_requirements.txt
- method: pip
path: .
extra_requirements:
- dev
formats: [ ]
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
43 changes: 35 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,53 @@ For example via conda:

$ mamba install -c conda-forge root

.. jupyter-execute::
:hide-code:
:hide-output:

import numpy as np
import zfit
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
10 changes: 10 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: rtd38
channels:
- conda-forge
- defaults
dependencies:
- python=3.9
- root<=6.30
- uv
- pip:
- ../[dev]
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.

Loading