From c947ad6c4da4fa36c3937b9263d72aa9cb8ab2d1 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Tue, 8 Oct 2024 18:38:07 +0200 Subject: [PATCH] apply --- doc/conf.py | 11 +++++++---- examples/derivative.ipynb | 1 - fiddy/derivative.py | 1 + fiddy/extensions/amici/amici.py | 2 +- tests/test_derivative.py | 6 +++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 0f5cb71..a06bba4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,7 +1,6 @@ import os import sys - -import mock +from unittest import mock # Configuration file for the Sphinx documentation builder. # @@ -61,8 +60,12 @@ autodoc_mock_imports = [ - "amici", "amici.amici", "amici.petab", "amici.petab.simulations", - "amici.petab.parameter_mapping", "amici.petab.conditions" + "amici", + "amici.amici", + "amici.petab", + "amici.petab.simulations", + "amici.petab.parameter_mapping", + "amici.petab.conditions", ] for mod_name in autodoc_mock_imports: sys.modules[mod_name] = mock.MagicMock() diff --git a/examples/derivative.ipynb b/examples/derivative.ipynb index d28686f..3ba790b 100644 --- a/examples/derivative.ipynb +++ b/examples/derivative.ipynb @@ -30,7 +30,6 @@ ], "source": [ "import numpy as np\n", - "import pandas as pd\n", "from scipy.optimize import rosen, rosen_der\n", "\n", "from fiddy import MethodId, get_derivative\n", diff --git a/fiddy/derivative.py b/fiddy/derivative.py index 4b03406..65508ac 100644 --- a/fiddy/derivative.py +++ b/fiddy/derivative.py @@ -45,6 +45,7 @@ class Derivative: success: Whether the derivative was successfully computed. """ + hide_columns = [ "pending_computers", "computers", diff --git a/fiddy/extensions/amici/amici.py b/fiddy/extensions/amici/amici.py index aeb2e31..0ff6192 100644 --- a/fiddy/extensions/amici/amici.py +++ b/fiddy/extensions/amici/amici.py @@ -6,9 +6,9 @@ import amici.petab.simulations import numpy as np import petab.v1 as petab +from amici.petab.conditions import create_edatas from amici.petab.parameter_mapping import create_parameter_mapping from amici.petab.simulations import LLH, SLLH -from amici.petab.conditions import create_edatas from petab.v1.C import LIN, LOG, LOG10 from ...constants import Type diff --git a/tests/test_derivative.py b/tests/test_derivative.py index e5ab637..37bc9a4 100644 --- a/tests/test_derivative.py +++ b/tests/test_derivative.py @@ -142,9 +142,9 @@ def test_get_derivative_relative(): ) # cardinal direction, simplifies to this, but usually need dot product g_a = (f_a - f_0) / size - g_r = (f_r - f_0) / ( - point * direction * size - ).sum() # cardinal direction, simplifies to this, but usually need dot product + g_r = ( + (f_r - f_0) / (point * direction * size).sum() + ) # cardinal direction, simplifies to this, but usually need dot product # Fiddy finite difference derivatives kwargs = {