Skip to content

Commit

Permalink
Correct Tuple type hints in nexus.py.
Browse files Browse the repository at this point in the history
Correcting typing hints declaring use of Tuple['T'] (for some T) but
intending a tuple having any number of T objects (i.e. Tuple['T', ...].
  • Loading branch information
robertbartel committed Jul 3, 2023
1 parent 9096c8f commit bb8c23c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/hypy/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Nexus():
"""

@classmethod
def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tuple['Catchment']:
def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tuple['Catchment', ...]:
"""
Convenience method to accept a ``Catchments_Collection``, which is a union of several possible types, and to
output a tuple of catchments (or an empty tuple).
Expand All @@ -20,7 +20,7 @@ def _convert_collection_to_tuple(cls, collection: 'Catchments_Collection') -> Tu
a single catchment object itself.
Returns
-------
Tuple['Catchment']
Tuple['Catchment', ...]
A tuple containing the catchments included directly or in the container parameter object.
"""
if isinstance(collection, list):
Expand Down Expand Up @@ -69,23 +69,23 @@ def id(self) -> str:
return self._id

@property
def receiving_catchments (self) -> Tuple['Catchment']:
def receiving_catchments (self) -> Tuple['Catchment', ...]:
"""Tuple of Catchment object(s) receiving water from nexus
Returns
-------
Tuple['Catchment']
Tuple['Catchment', ...]
Tuple of Catchment object(s) receiving water from nexus
"""
return self._receiving_catchments

@property
def contributing_catchments (self) -> Tuple['Catchment']:
def contributing_catchments (self) -> Tuple['Catchment', ...]:
"""Tuple of Catchment object(s) contributing water to nexus
Returns
-------
Tuple['Catchment']
Tuple['Catchment', ...]
Tuple of Catchment object(s) contributing water to nexus
"""
return self._contributing_catchments

0 comments on commit bb8c23c

Please sign in to comment.