From 8bceeec7972db7ba65060e62fbbce3221014cb56 Mon Sep 17 00:00:00 2001 From: Vitor Shen <17490173+shenvitor@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:31:19 +0200 Subject: [PATCH 1/3] replace nbstripout by nbclean using the example https://github.com/srstevenson/nb-clean --- .pre-commit-config.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b883c2..f0c9997 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,17 +33,16 @@ repos: .*\.py )$ - - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 + - repo: https://github.com/srstevenson/nb-clean + rev: 3.3.0 hooks: - - id: nbstripout + - id: nb-clean args: - - --extra-keys - - | - cell.attachments - cell.metadata.editable - cell.metadata.id - cell.metadata.slideshow + - --remove-empty-cells + - --preserve-cell-metadata + - tags + - slideshow + - -- - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 From 4420106723e3560b8f1754e7ee442ac684ddff9a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:34:36 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/eta-pi-p/automated.ipynb | 39 +------------- docs/eta-pi-p/manual.ipynb | 24 +-------- docs/eta-pi-p/pgamma-state.ipynb | 16 +----- docs/lambda-k-pi/ampform-dpd.ipynb | 81 ++---------------------------- docs/lambda-k-pi/ampform.ipynb | 45 +---------------- 5 files changed, 9 insertions(+), 196 deletions(-) diff --git a/docs/eta-pi-p/automated.ipynb b/docs/eta-pi-p/automated.ipynb index e71ea69..b1c3288 100644 --- a/docs/eta-pi-p/automated.ipynb +++ b/docs/eta-pi-p/automated.ipynb @@ -18,12 +18,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, "tags": [ "hide-input" ] @@ -133,9 +127,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -183,9 +174,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -201,9 +189,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -222,9 +207,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -291,9 +273,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "scroll-input" @@ -326,12 +305,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Collect resonances for each subsystem" - }, "tags": [ "hide-input" ] @@ -353,12 +326,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Design slider UI" - }, "tags": [ "hide-input" ] @@ -400,9 +367,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width", @@ -502,8 +466,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/docs/eta-pi-p/manual.ipynb b/docs/eta-pi-p/manual.ipynb index af29991..503e3fd 100644 --- a/docs/eta-pi-p/manual.ipynb +++ b/docs/eta-pi-p/manual.ipynb @@ -41,9 +41,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, "tags": [ "hide-cell" ] @@ -320,9 +317,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-cell" ] @@ -431,9 +425,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -516,9 +507,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "scroll-input", @@ -569,9 +557,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -628,9 +613,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -670,9 +652,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -743,8 +722,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/docs/eta-pi-p/pgamma-state.ipynb b/docs/eta-pi-p/pgamma-state.ipynb index 97a3e35..bc7056b 100644 --- a/docs/eta-pi-p/pgamma-state.ipynb +++ b/docs/eta-pi-p/pgamma-state.ipynb @@ -39,12 +39,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, "tags": [ "hide-cell" ] @@ -562,13 +556,6 @@ "print(\"found\", len(reaction.transitions), \"solutions!\")\n", "reaction.get_intermediate_particles().names" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -586,8 +573,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.4" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/docs/lambda-k-pi/ampform-dpd.ipynb b/docs/lambda-k-pi/ampform-dpd.ipynb index 51635bd..1a08bdf 100644 --- a/docs/lambda-k-pi/ampform-dpd.ipynb +++ b/docs/lambda-k-pi/ampform-dpd.ipynb @@ -19,12 +19,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, "tags": [ "hide-input" ] @@ -88,9 +82,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "scroll-output", "full-width", @@ -273,9 +264,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -289,11 +277,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "decay = to_three_body_decay(reaction.transitions)\n", @@ -337,11 +321,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "def formulate_breit_wigner(\n", @@ -403,9 +383,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "scroll-output" @@ -421,12 +398,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Model parameters" - }, "tags": [ "scroll-output", "hide-input" @@ -443,9 +414,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "mystnb": { - "code_prompt_show": "Kinematic variable definitions" - }, "tags": [ "hide-input", "scroll-output" @@ -480,11 +448,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "i, j = 3, 1\n", @@ -497,12 +461,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Define meshgrid" - }, "tags": [ "hide-input" ] @@ -531,12 +489,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Define data transformer" - }, "tags": [ "hide-input" ] @@ -562,12 +514,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Collect resonance names per sub-system" - }, "tags": [ "hide-output", "hide-input", @@ -591,12 +537,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Design slider UI" - }, "tags": [ "hide-input" ] @@ -716,12 +656,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Define functions for inserting phase" - }, "tags": [ "hide-input" ] @@ -746,9 +680,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -797,9 +728,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width", @@ -897,8 +825,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "pygments_lexer": "ipython3" } }, "nbformat": 4, diff --git a/docs/lambda-k-pi/ampform.ipynb b/docs/lambda-k-pi/ampform.ipynb index 20f95dc..4d12224 100644 --- a/docs/lambda-k-pi/ampform.ipynb +++ b/docs/lambda-k-pi/ampform.ipynb @@ -19,12 +19,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Import Python libraries" - }, "tags": [ "hide-input" ] @@ -88,9 +82,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "scroll-output", "full-width", @@ -272,9 +263,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input" ] @@ -330,9 +318,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "scroll-output" @@ -348,9 +333,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "mystnb": { - "code_prompt_show": "Model parameters" - }, "tags": [ "scroll-output", "hide-input" @@ -365,9 +347,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "mystnb": { - "code_prompt_show": "Kinematic variable definitions" - }, "tags": [ "hide-input", "scroll-output" @@ -435,9 +414,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-output", "hide-input" @@ -460,12 +436,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, - "mystnb": { - "code_prompt_show": "Design slider UI" - }, "tags": [ "hide-input" ] @@ -583,11 +553,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "jupyter": { - "source_hidden": true - } - }, + "metadata": {}, "outputs": [], "source": [ "def insert_phi(parameters: dict) -> dict:\n", @@ -608,9 +574,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width" @@ -666,9 +629,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "jupyter": { - "source_hidden": true - }, "tags": [ "hide-input", "full-width", @@ -765,8 +725,7 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "pygments_lexer": "ipython3" } }, "nbformat": 4, From fc60498126a6044910d6530f866f0613f8932836 Mon Sep 17 00:00:00 2001 From: Vitor Shen <17490173+shenvitor@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:51:20 +0200 Subject: [PATCH 3/3] update --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0c9997..8c247e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,8 @@ repos: - --remove-empty-cells - --preserve-cell-metadata - tags - - slideshow + - jupyter + - mystnb - -- - repo: https://github.com/pre-commit/mirrors-prettier