Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add UiField as the new intermediate object representing widget parameters #475

Merged
merged 57 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
24b5b84
wip
tlambert03 Aug 24, 2022
59aafa5
tests working
tlambert03 Aug 25, 2022
1de6d47
more bugs and tests
tlambert03 Aug 25, 2022
3c4c3aa
remove notes file
tlambert03 Aug 25, 2022
fbbe3d5
Merge branch 'main' into new-typemap
tlambert03 Aug 25, 2022
a7945a5
remove typemap2
tlambert03 Aug 25, 2022
e788fca
fix docs and types
tlambert03 Aug 25, 2022
3d05563
add another test
tlambert03 Aug 25, 2022
1ebee77
update doc
tlambert03 Aug 25, 2022
ea1e6cd
move sentinel
tlambert03 Aug 25, 2022
a6f094e
docstring
tlambert03 Aug 25, 2022
7605a5e
undo change in signature
tlambert03 Aug 25, 2022
c8175fa
reduce code
tlambert03 Aug 25, 2022
d1b7285
wip: starting on schema
tlambert03 Aug 25, 2022
e60bb08
make func
tlambert03 Aug 25, 2022
19fe7c8
fix py3.8
tlambert03 Aug 25, 2022
3dbfb52
Merge branch 'new-typemap' into widget-field
tlambert03 Aug 25, 2022
90d3bbb
improving compat
tlambert03 Aug 25, 2022
1ba837a
tests passing (cheating)
tlambert03 Aug 25, 2022
8eb8346
fill out UiField func
tlambert03 Aug 26, 2022
9ae0f1a
star
tlambert03 Aug 26, 2022
bada3b0
playing with GUIField
tlambert03 Aug 26, 2022
36e91e3
wip
tlambert03 Aug 26, 2022
be799e4
Merge branch 'main' into widget-field
tlambert03 Sep 11, 2022
57f60de
Merge branch 'main' into new-typemap
tlambert03 Sep 11, 2022
52f9ec9
Merge branch 'main' into widget-field
tlambert03 Sep 21, 2022
299a9fa
Merge branch 'main' into new-typemap
tlambert03 Oct 10, 2022
46e4b71
wip
tlambert03 Oct 18, 2022
583ae0d
wip
tlambert03 Oct 18, 2022
c2d9d08
feat: support annotated types
tlambert03 Oct 19, 2022
700366d
Merge branch 'main' into new-typemap
tlambert03 Oct 19, 2022
205d477
fix merge
tlambert03 Oct 19, 2022
1cee0ac
Merge branch 'new-typemap' into uifield
tlambert03 Oct 19, 2022
90b2f7a
starting on create method
tlambert03 Oct 20, 2022
f411b77
Merge branch 'main' into new-typemap
tlambert03 Oct 20, 2022
360c7cb
wip
tlambert03 Oct 21, 2022
ffe5aa9
Merge branch 'main' into new-typemap
tlambert03 Oct 22, 2022
cfa00f0
Merge branch 'main' into new-typemap
tlambert03 Oct 23, 2022
a949b17
Merge branch 'new-typemap' into uifield
tlambert03 Oct 23, 2022
b539966
chore: Merge branch 'main' into uifield
tlambert03 Oct 29, 2022
e6e0881
Merge branch 'main' into uifield
tlambert03 Oct 29, 2022
fa56dbc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 29, 2022
8b85cf7
fix tests
tlambert03 Oct 29, 2022
d35a827
cleanup a bit
tlambert03 Oct 29, 2022
5525eac
Merge branch 'main' into uifield
tlambert03 Oct 30, 2022
c7cbf6a
Merge branch 'main' into uifield
tlambert03 Nov 2, 2022
0d086ee
refactor: make uifield generic
tlambert03 Nov 3, 2022
4767c22
misc
tlambert03 Nov 3, 2022
b23a27e
minimize test
tlambert03 Nov 3, 2022
113594c
Merge branch 'uifield' of https://github.com/tlambert03/magicgui into…
tlambert03 Nov 6, 2022
3f6e58f
add values and more annotations support
tlambert03 Nov 6, 2022
dd89495
Merge branch 'main' into uifield
tlambert03 Nov 9, 2022
516fef4
Merge branch 'main' into uifield
tlambert03 Nov 9, 2022
95020e3
Merge branch 'uifield' of https://github.com/tlambert03/magicgui into…
tlambert03 Nov 9, 2022
e4d44c7
Merge branch 'main' into uifield
tlambert03 Nov 10, 2022
7479539
Merge branch 'main' into uifield
tlambert03 Nov 11, 2022
b3a6c39
refactor: rename file
tlambert03 Nov 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions magicgui/_type_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from copy import copy
from functools import lru_cache, partial
from importlib import import_module
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union, get_type_hints
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union

# required for python 3.8 to strip annotations
from typing_extensions import get_type_hints

try:
from toolz import curry
Expand Down Expand Up @@ -53,7 +56,7 @@ def resolve_types(
obj = _unwrap_partial(obj)

try:
hints = get_type_hints(obj, globalns=globalns, localns=localns)
hints = get_type_hints(obj, globalns=globalns, localns=localns) # type: ignore
except NameError as e:
if do_imports:
# try to import the top level name and try again
Expand Down Expand Up @@ -106,7 +109,7 @@ def resolve_single_type(
return hints["obj"]


_cached_resolve = lru_cache(maxsize=1)(resolve_single_type)
_cached_resolve = lru_cache(maxsize=None)(resolve_single_type)


def _try_cached_resolve(v):
Expand Down
Loading