Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 4cb5158 commit d930c0e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"metadata": {},
"outputs": [],
"source": [
"import abc\n",
"%load_ext autoreload\n",
"%autoreload 2"
]
Expand All @@ -19,11 +18,14 @@
"source": [
"import inspect\n",
"from unittest.mock import MagicMock\n",
"\n",
"from weldx_widgets.widget_base import WidgetBase as base\n",
"\n",
"\n",
"def all_subclasses(cls):\n",
" return set(cls.__subclasses__()).union(\n",
" [s for c in cls.__subclasses__() for s in all_subclasses(c)])"
" [s for c in cls.__subclasses__() for s in all_subclasses(c)]\n",
" )"
]
},
{
Expand All @@ -44,9 +46,13 @@
" for k, v in args.parameters.items():\n",
" if k == \"self\":\n",
" continue\n",
" if k!= \"kwargs\" and v.POSITIONAL_OR_KEYWORD and v.default is inspect.Parameter.empty:\n",
" if (\n",
" k != \"kwargs\"\n",
" and v.POSITIONAL_OR_KEYWORD\n",
" and v.default is inspect.Parameter.empty\n",
" ):\n",
" _mock_args[k] = MagicMock()\n",
" print(\"mocked \",k,v)\n",
" print(\"mocked \", k, v)\n",
" try:\n",
" all_widgets.append(cls(**_mock_args))\n",
" except TypeError as te:\n",
Expand Down

0 comments on commit d930c0e

Please sign in to comment.