Skip to content

Commit

Permalink
Merge pull request #543 from hoetmaaiers/master
Browse files Browse the repository at this point in the history
Use generic type definition in the openeo_process decorator
  • Loading branch information
soxofaan authored Feb 27, 2024
2 parents b7f9478 + 3b65e6f commit e55624b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions openeo/internal/documentation.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
"""
Utilities to build/automate/extend documentation
"""

import collections
import inspect
import textwrap
from functools import partial
from typing import Callable, Optional, Tuple
from typing import Callable, Optional, Tuple, TypeVar

# TODO: give this a proper public API?
_process_registry = collections.defaultdict(list)


def openeo_process(f: Optional[Callable] = None, process_id: Optional[str] = None, mode: Optional[str] = None):
T = TypeVar("T", bound=Callable)


def openeo_process(
f: Optional[T] = None, process_id: Optional[str] = None, mode: Optional[str] = None
) -> T:
"""
Decorator for function or method to associate it with a standard openEO process
Expand Down

0 comments on commit e55624b

Please sign in to comment.