From af95667ffbcba8b951ef72ee1d73bc985301bcd1 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 6 Jan 2022 18:02:04 +0100 Subject: [PATCH 1/3] feat: example 3 improved --- examples/03_pcac_example.ipynb | 51 +++++++++++++++------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/examples/03_pcac_example.ipynb b/examples/03_pcac_example.ipynb index ae605aaf..9b163317 100644 --- a/examples/03_pcac_example.ipynb +++ b/examples/03_pcac_example.ipynb @@ -25,14 +25,21 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Primary observables" + "In this example we look at the analysis of the current quark mass (PCAC mass) on a test gauge field ensemble with fixed Schrödinger functional boundary conditions in the temporal direction." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "We can load data from preprocessed files which contains lists of `pyerror` `Obs` and convert them to `Corr` objects. We use the parameters `padding_front` and `padding_back` to keep track of the fixed boundary conditions at both temporal ends of the lattice." + "## Loading data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can load data from preprocessed files which contains lists of `pyerror` `Obs` and convert them to `Corr` objects as explained in the previous example. We use the parameters `padding_front` and `padding_back` to keep track of the fixed boundary conditions at both temporal ends of the lattice. This allows us to specify absolut temporal positions without having to keep track of any shifts in the data." ] }, { @@ -107,7 +114,12 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "For the PCAC mass we now need to obtain the first derivative of f_A and the second derivative of f_P" + "The PCAC mass is defined as\n", + "\\begin{align*}\n", + "am(x_0)=\\frac{a\\tilde{\\partial}_0 f_\\mathrm{A}(x_0)+a^2c_\\mathrm{A}\\partial_0^{\\ast}\\partial_0^{}f_\\mathrm{P}(x_0)}{2f_\\mathrm{P}(x_0)}+\\mathrm{O}(a^2)\\,.\n", + "\\end{align*}\n", + "\n", + "We now need to obtain the first derivative of f_A and the second derivative of f_P" ] }, { @@ -176,26 +188,6 @@ "cell_type": "code", "execution_count": 9, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "24" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "am_pcac_impr.T" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, "outputs": [ { "data": { @@ -230,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -263,7 +255,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -292,8 +284,10 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": {}, + "execution_count": 12, + "metadata": { + "scrolled": false + }, "outputs": [ { "data": { @@ -321,10 +315,11 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ + "pcac_plateau.tag = \"O(a) improved PCAC mass extracted on the test ensemble\"\n", "pe.input.json.dump_to_json(pcac_plateau, \"pcac_plateau_test_ensemble\")" ] }, From cd0f38c77db57fd09ef3b6326ddc53923be938c6 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 7 Jan 2022 11:59:06 +0100 Subject: [PATCH 2/3] ci: macOS and windows added to pytest workflow --- .github/workflows/pytest.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0f3ae2f3..febcfcf3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -11,11 +11,17 @@ on: jobs: pytest: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: - fail-fast: true + fail-fast: true matrix: + os: [ubuntu-latest] python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + include: + - os: macos-latest + python-version: 3.9 + - os: windows-latest + python-version: 3.9 steps: - name: Checkout source From 88572c06a87933f14e831be8d7fd7ef8942d9e38 Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Fri, 7 Jan 2022 12:08:27 +0100 Subject: [PATCH 3/3] fix: DeprecationWarning in Corr.reweighted fixed --- pyerrors/correlators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyerrors/correlators.py b/pyerrors/correlators.py index 6759a49c..7f318976 100644 --- a/pyerrors/correlators.py +++ b/pyerrors/correlators.py @@ -74,7 +74,7 @@ class Corr: @property def reweighted(self): - bool_array = np.array([list(map(lambda x: x.reweighted, o)) for o in list(filter(None.__ne__, self.content))]) + bool_array = np.array([list(map(lambda x: x.reweighted, o)) for o in [x for x in self.content if x is not None]]) if np.all(bool_array == 1): return True elif np.all(bool_array == 0):