Skip to content

Commit

Permalink
Merge branch 'develop' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschle authored Mar 21, 2019
2 parents 6b8a3be + e8f5417 commit 6977565
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
7 changes: 6 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
History
=======

0.0.0 (2018-03-22)
0.3.0 (2019-03-20)
------------------

Beta stage and first pip release

0.0.1 (2018-03-22)
------------------

* First creation of the package.
7 changes: 5 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

===============================
zfit: scalable pythonic fitting
===============================



.. image:: https://img.shields.io/pypi/v/zfit.svg
:target: https://pypi.python.org/pypi/zfit

Expand Down Expand Up @@ -78,6 +80,7 @@ The domain of the PDF is defined by an *observable space*, which is created usin
obs = zfit.Space('x', limits=(-10, 10))
Using this domain, we can now create a simple Gaussian PDF. To do this, we define its parameters and their limits using the ``zfit.Parameter`` class and we instantiate the PDF from the zfit library:

.. code-block:: python
Expand Down Expand Up @@ -146,10 +149,10 @@ Contributions are always welcome, please have a look at the `Contributing guide`

.. _Contributing guide: CONTRIBUTING.rst


Acknowledgements
----------------

zfit has been developed with support from the University of Zürich and the Swiss National Science Foundation (SNSF) under contracts 168169 and 174182.

The zfit structure is based on the `TensorFlowAnalysis <https://gitlab.cern.ch/poluekt/TensorFlowAnalysis>`_ framework developed by Anton Poluektov using the TensorFlow open source library.
The idea of zfit is inspired by the `TensorFlowAnalysis <https://gitlab.cern.ch/poluekt/TensorFlowAnalysis>`_ framework developed by Anton Poluektov using the TensorFlow open source library.

18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,37 @@
test_requirements = requirements_dev[requirements_dev_split + 1:] # +1: skip empty line

setup(
author="zfit",
author_email='zfit@physik.uzh.ch',
author="Jonas Eschle",
# author_email='zfit@physik.uzh.ch',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: MacOS',
'Operating System :: Unix',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Physics',
],
description="Pythonic, scalable, fitting library for high energy physics",

maintainer="zfit",
maintainer_email='zfit@physik.uzh.ch',
description="Scalable, pythonic fitting for high energy physics",
install_requires=requirements,
license="BSD 3-Clause",
long_description=readme + '\n\n' + history,
include_package_data=True,
keywords='zfit',
keywords='TensorFlow, model, fitting, scalable, HEP',
name='zfit',
python_requires=">=3.5",
python_requires=">=3.6",
packages=find_packages(include=['zfit', 'zfit.ztf',
'zfit.util', 'zfit.core', "zfit.minimizers", 'zfit.models']),
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/zfit/zfit',
version='0.0.0',
version='0.3.0',
zip_safe=False,
)
15 changes: 13 additions & 2 deletions zfit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# -*- coding: utf-8 -*-
"""Top-level package for zfit."""

__author__ = """zfit"""
__version__ = '0.3.0'

__license__ = "BSD 3-Clause"
__copyright__ = "Copyright 2018, zfit"
__status__ = "Beta"

__author__ = "Jonas Eschle"
__maintainer__ = "zfit"
__email__ = 'zfit@physik.uzh.ch'
__version__ = '0.0.0'
__credits__ = ["Jonas Eschle <jonas.eschle@cern.ch>",
"Albert Puig <albert.puig@cern.ch",
"Rafael Silva Coutinho <rafael.silva.coutinho@cern.ch>", ]

__all__ = ["ztf", "constraint", "pdf", "minimize", "loss", "core", "data", "func",
"Parameter", "ComposedParameter", "ComplexParameter", "convert_to_parameter",
"Space", "convert_to_space", "supports",
"run", "settings"]

from . import ztf
from .settings import ztypes

import tensorflow as tf

tf.get_variable_scope().set_use_resource(True)
tf.get_variable_scope().set_dtype(ztypes.float)

from . import constraint, pdf, minimize, loss, core, data, func
from .core.parameter import Parameter, ComposedParameter, ComplexParameter, convert_to_parameter
Expand Down
8 changes: 7 additions & 1 deletion zfit/core/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,13 @@ def integrate(self, limits: ztyping.LimitsType, norm_range: ztyping.LimitsType =
limits = self._check_input_limits(limits=limits)
integral = self._single_hook_integrate(limits=limits, norm_range=norm_range, name=name)
if isinstance(integral, tf.Tensor):
assert integral.shape.as_list() == [], "Error in integral creation, should return with shape ()"
if not integral.shape.as_list() == []:
raise ShapeIncompatibleError("Error in integral creation, should return an integral "
"with shape () (resp. [] as list), current shape "
"{}. If you registered an analytic integral which is used"
"now, make sure to return a scalar and not a tensor "
"(typically: shape is (1,) insead of () -> return tensor[0] "
"instead of tensor)".format(integral.shape.as_list()))
return integral

def _single_hook_integrate(self, limits, norm_range, name):
Expand Down

0 comments on commit 6977565

Please sign in to comment.