diff --git a/README.md b/README.md index e1f124ca..225d8128 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![flake8](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![pytest](https://github.com/fjosw/pyerrors/actions/workflows/pytest.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/pytest.yml) [![examples](https://github.com/fjosw/pyerrors/actions/workflows/examples.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/examples.yml) [![docs](https://github.com/fjosw/pyerrors/actions/workflows/docs.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/docs.yml) [![](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![flake8](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/flake8.yml) [![pytest](https://github.com/fjosw/pyerrors/actions/workflows/pytest.yml/badge.svg)](https://github.com/fjosw/pyerrors/actions/workflows/pytest.yml) [![](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/fjosw/pyerrors/HEAD?labpath=examples) # pyerrors `pyerrors` is a python package for error computation and propagation of Markov chain Monte Carlo data. diff --git a/examples/01_basic_example.ipynb b/examples/01_basic_example.ipynb index 834f9d39..df1d76f2 100644 --- a/examples/01_basic_example.ipynb +++ b/examples/01_basic_example.ipynb @@ -21,6 +21,7 @@ "outputs": [], "source": [ "import numpy as np\n", + "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import pyerrors as pe" ] @@ -32,7 +33,8 @@ "outputs": [], "source": [ "plt.style.use('./base_style.mplstyle')\n", - "plt.rc('text', usetex=True)" + "usetex = matplotlib.checkdep_usetex(True)\n", + "plt.rc('text', usetex=usetex)" ] }, { diff --git a/examples/02_correlators.ipynb b/examples/02_correlators.ipynb index a647162e..e2d2a09a 100644 --- a/examples/02_correlators.ipynb +++ b/examples/02_correlators.ipynb @@ -8,6 +8,7 @@ "outputs": [], "source": [ "import numpy as np\n", + "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import pyerrors as pe" ] @@ -20,7 +21,8 @@ "outputs": [], "source": [ "plt.style.use('./base_style.mplstyle')\n", - "plt.rc('text', usetex=True)" + "usetex = matplotlib.checkdep_usetex(True)\n", + "plt.rc('text', usetex=usetex)" ] }, { @@ -480,7 +482,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -494,7 +496,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/examples/03_pcac_example.ipynb b/examples/03_pcac_example.ipynb index bf0f0b02..835062a8 100644 --- a/examples/03_pcac_example.ipynb +++ b/examples/03_pcac_example.ipynb @@ -7,6 +7,7 @@ "outputs": [], "source": [ "import numpy as np\n", + "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import pyerrors as pe" ] @@ -18,7 +19,8 @@ "outputs": [], "source": [ "plt.style.use('./base_style.mplstyle')\n", - "plt.rc('text', usetex=True)" + "usetex = matplotlib.checkdep_usetex(True)\n", + "plt.rc('text', usetex=usetex)" ] }, { diff --git a/examples/04_fit_example.ipynb b/examples/04_fit_example.ipynb index 026cca2d..72d62e9e 100644 --- a/examples/04_fit_example.ipynb +++ b/examples/04_fit_example.ipynb @@ -6,9 +6,10 @@ "metadata": {}, "outputs": [], "source": [ - "import pyerrors as pe\n", "import numpy as np\n", - "import matplotlib.pyplot as plt" + "import matplotlib\n", + "import matplotlib.pyplot as plt\n", + "import pyerrors as pe" ] }, { @@ -18,7 +19,8 @@ "outputs": [], "source": [ "plt.style.use('./base_style.mplstyle')\n", - "plt.rc('text', usetex=True)" + "usetex = matplotlib.checkdep_usetex(True)\n", + "plt.rc('text', usetex=usetex)" ] }, { @@ -439,7 +441,7 @@ "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" }, "kernelspec": { - "display_name": "Python 3.8.10 64-bit", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, diff --git a/examples/05_matrix_operations.ipynb b/examples/05_matrix_operations.ipynb index a49a7ee0..926d1734 100644 --- a/examples/05_matrix_operations.ipynb +++ b/examples/05_matrix_operations.ipynb @@ -393,7 +393,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -407,7 +407,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/examples/06_gevp.ipynb b/examples/06_gevp.ipynb index e969008c..268346f6 100644 --- a/examples/06_gevp.ipynb +++ b/examples/06_gevp.ipynb @@ -7,6 +7,7 @@ "metadata": {}, "outputs": [], "source": [ + "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import pyerrors as pe" ] @@ -18,7 +19,9 @@ "metadata": {}, "outputs": [], "source": [ - "plt.style.use('./base_style.mplstyle'); plt.rc('text', usetex=True)" + "plt.style.use('./base_style.mplstyle')\n", + "usetex = matplotlib.checkdep_usetex(True)\n", + "plt.rc('text', usetex=usetex)" ] }, { @@ -305,7 +308,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, diff --git a/pyerrors/__init__.py b/pyerrors/__init__.py index 6ec89a04..ef257c86 100644 --- a/pyerrors/__init__.py +++ b/pyerrors/__init__.py @@ -8,6 +8,8 @@ It is based on the gamma method [arXiv:hep-lat/0306017](https://arxiv.org/abs/he - non-linear fits with x- and y-errors and exact linear error propagation based on automatic differentiation as introduced in [arXiv:1809.01289](https://arxiv.org/abs/1809.01289). - real and complex matrix operations and their error propagation based on automatic differentiation (Matrix inverse, Cholesky decomposition, calculation of eigenvalues and eigenvectors, singular value decomposition...). +More detailed examples can found in the [GitHub repository](https://github.com/fjosw/pyerrors/tree/develop/examples) [![badge](https://img.shields.io/badge/-try%20it%20out-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+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PdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/fjosw/pyerrors/HEAD?labpath=examples). + There exist similar publicly available implementations of gamma method error analysis suites in [Fortran](https://gitlab.ift.uam-csic.es/alberto/aderrors), [Julia](https://gitlab.ift.uam-csic.es/alberto/aderrors.jl) and [Python](https://github.com/mbruno46/pyobs). ## Basic example @@ -443,8 +445,10 @@ Julia I/O routines for the json.gz format, compatible with [ADerrors.jl](https:/ # Citing If you use `pyerrors` for research that leads to a publication please consider citing: - Ulli Wolff, *Monte Carlo errors with less errors*. Comput.Phys.Commun. 156 (2004) 143-153, Comput.Phys.Commun. 176 (2007) 383 (erratum). -- Stefan Schaefer, Rainer Sommer, Francesco Virotta, *Critical slowing down and error analysis in lattice QCD simulations*. Nucl.Phys.B 845 (2011) 93-119. - Alberto Ramos, *Automatic differentiation for error analysis of Monte Carlo data*. Comput.Phys.Commun. 238 (2019) 19-35. +and +- Stefan Schaefer, Rainer Sommer, Francesco Virotta, *Critical slowing down and error analysis in lattice QCD simulations*. Nucl.Phys.B 845 (2011) 93-119. +where applicable. ''' from .obs import * from .correlators import *