Skip to content

Commit

Permalink
Support iterables and sequences when converting function inputs (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stellabelin committed Jul 4, 2024
1 parent e95f6bd commit b7e0b27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/func_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import re
import textwrap
from collections.abc import Mapping
from collections.abc import Iterable, Mapping, Sequence
from typing import List, Union, get_args, get_origin, get_type_hints

import pharmpy.model
Expand Down Expand Up @@ -150,7 +150,7 @@ def _get_conversion_str(key, args, origin):
origin = get_origin(args)
if args is int:
return f'{key} <- convert_input({key}, "int")'
elif origin is list or args == (List[str], str):
elif origin in (list, Iterable, Sequence) or args == (List[str], str):
return f'{key} <- convert_input({key}, "list")'
elif args is pd.Series:
return f'{key} <- convert_input({key}, "pd.Series")'
Expand Down

0 comments on commit b7e0b27

Please sign in to comment.