Skip to content

Commit

Permalink
Update docstrings of _plumbing
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Aug 26, 2024
1 parent 03e0c9f commit 164d96a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/oemof/solph/_plumbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

def sequence(iterable_or_scalar):
"""Checks if an object is iterable (except string) or scalar and returns
the original sequence if object is an iterable and an 'emulated'
sequence object of class _Sequence if object is a scalar or string.
the an numpy array of the sequence if object is an iterable or an
'emulated' sequence object of class _FakeSequence if object is a scalar.
Parameters
----------
Expand Down Expand Up @@ -57,6 +57,11 @@ def sequence(iterable_or_scalar):


def valid_sequence(sequence, length: int) -> bool:
"""Checks if an object is a numpy array of at least the given length
or an 'emulated' sequence object of class _FakeSequence.
The latter is set to the required lenght.
"""
if sequence[0] is None:
return False

Expand Down

0 comments on commit 164d96a

Please sign in to comment.