forked from scikit-hep/iminuit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7301a0
commit 493003d
Showing
17 changed files
with
75 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from matplotlib import pyplot as plt | ||
import numpy as np | ||
|
||
|
||
def soft_l1(z): | ||
return 2 * ((1 + z) ** 0.5 - 1) | ||
|
||
|
||
x = np.linspace(-3, 3) | ||
z = x ** 2 | ||
plt.plot(x, z, label="linear $\\rho(z) = z$") | ||
plt.plot(x, soft_l1(z), label="soft L1-norm $\\rho(z) = 2(\\sqrt{1+z} - 1)$") | ||
plt.xlabel("studentized residual") | ||
plt.ylabel("cost") | ||
plt.legend() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from iminuit import Minuit | ||
|
||
|
||
def cost(x, y, z): | ||
return (x - 1) ** 2 + (y - x) ** 2 + (z - 2) ** 2 | ||
|
||
|
||
m = Minuit(cost, print_level=0, pedantic=False) | ||
m.migrad() | ||
m.draw_mncontour("x", "y", nsigma=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from iminuit import Minuit | ||
|
||
|
||
def f(x, y, z): | ||
def cost(x, y, z): | ||
return (x - 1) ** 2 + (y - x) ** 2 + (z - 2) ** 2 | ||
|
||
|
||
m = Minuit(f, print_level=0, pedantic=False) | ||
m = Minuit(cost, pedantic=False) | ||
m.migrad() | ||
m.draw_mnprofile("y") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Use CFLAGS="-g -Og -DDEBUG" python setup.py ... for debugging | ||
|
||
import os | ||
import sys | ||
import platform | ||
from os.path import dirname, join, exists | ||
from glob import glob | ||
|
@@ -122,7 +121,7 @@ def lazy_compile( | |
|
||
print("Minuit2 submodule is missing, attempting download...") | ||
subp.check_call(["git", "submodule", "update"]) | ||
except: | ||
except subp.CalledProcessError: | ||
raise SystemExit( | ||
"Could not download Minuit2 submodule, run `git submodule update` manually" | ||
) | ||
|
@@ -150,11 +149,11 @@ def lazy_compile( | |
|
||
|
||
# Getting the version number at this point is a bit tricky in Python: | ||
# https://packaging.python.org/en/latest/development.html#single-sourcing-the-version-across-setup-py-and-your-project | ||
# This is one of the recommended methods that works in Python 2 and 3: | ||
# https://packaging.python.org/guides/single-sourcing-package-version/?highlight=single%20sourcing | ||
with open(join(cwd, "src/iminuit/version.py")) as fp: | ||
exec(fp.read()) # this loads __version__ | ||
|
||
version = {} | ||
exec(fp.read(), version) # this loads __version__ | ||
version = version["__version__"] | ||
|
||
with open(join(cwd, "README.rst")) as readme_rst: | ||
txt = readme_rst.read() | ||
|
@@ -164,16 +163,18 @@ def lazy_compile( | |
|
||
setup( | ||
name="iminuit", | ||
version=__version__, | ||
version=version, | ||
description="Jupyter-friendly Python frontend for MINUIT2 in C++", | ||
long_description=long_description, | ||
long_description_content_type="text/x-rst", | ||
author="Piti Ongmongkolkul and the iminuit team", | ||
maintainer="Hans Dembinski", | ||
maintainer_email="[email protected]", | ||
url="https://github.com/scikit-hep/iminuit", | ||
download_url="http://pypi.python.org/packages/source/i/" | ||
"scikit-hep/iminuit-%s.tar.gz" % __version__, | ||
url="http://github.com/scikit-hep/iminuit", | ||
project_urls={ | ||
"Documentation": "https://iminuit.readthedocs.io", | ||
"Source Code": "http://github.com/scikit-hep/iminuit", | ||
}, | ||
packages=["iminuit", "iminuit.tests"], | ||
package_dir={"": "src"}, | ||
ext_modules=extensions, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters