Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CagtayFabry committed Dec 4, 2024
1 parent 8a70169 commit f14f6df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
21 changes: 14 additions & 7 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,20 +46,25 @@
" 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) # noqa: T201\n",
" try:\n",
" all_widgets.append(cls(**_mock_args))\n",
" except TypeError as te:\n",
" print(cls, te)\n",
" print(cls, te) # noqa: T201\n",
" continue"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
Expand All @@ -75,7 +82,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "weldx real",
"display_name": "weldx",
"language": "python",
"name": "weldx"
},
Expand All @@ -89,7 +96,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Physics",
]

Expand Down

0 comments on commit f14f6df

Please sign in to comment.