Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Apr 16, 2024
1 parent 3ef331a commit 4c0843f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions python/sdist/amici/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ def get_model(self) -> amici.Model:
"""Create a model instance."""
...

AmiciModel = Union[amici.Model, amici.ModelPtr]


class add_path:
"""Context manager for temporarily changing PYTHONPATH"""
Expand Down
12 changes: 6 additions & 6 deletions swig/amici.i
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ if sys.platform == 'win32' and (dll_dirs := os.environ.get('AMICI_DLL_DIRS')):
// import additional types for typehints
// also import np for use in __repr__ functions
%pythonbegin %{
from typing import TYPE_CHECKING, Iterable
from typing import TYPE_CHECKING, Iterable, Union
from collections.abc import Sequence
import numpy as np
if TYPE_CHECKING:
Expand All @@ -372,11 +372,11 @@ __all__ = [
and x not in {"np", "sys", "os", "numpy", "IntEnum", "enum", "pi", "TYPE_CHECKING", "Iterable", "Sequence"}
]

AmiciModel = Model | ModelPtr
AmiciSolver = Solver | SolverPtr
AmiciExpData = ExpData | ExpDataPtr
AmiciReturnData = ReturnData | ReturnDataPtr
AmiciExpDataVector = ExpDataPtrVector | Sequence[AmiciExpData]
AmiciModel = Union['Model', 'ModelPtr']
AmiciSolver = Union['Solver', 'SolverPtr']
AmiciExpData = Union['ExpData', 'ExpDataPtr']
AmiciReturnData = Union['ReturnData', 'ReturnDataPtr']
AmiciExpDataVector = Union['ExpDataPtrVector', Sequence['AmiciExpData']]

def _get_ptr(
obj: AmiciModel | AmiciExpData | AmiciSolver | AmiciReturnData,
Expand Down

0 comments on commit 4c0843f

Please sign in to comment.