Skip to content

Commit

Permalink
Add versionadded directive to SolutionArray sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber authored and ischoegl committed May 26, 2022
1 parent 532e60c commit 790b507
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions interfaces/cython/cantera/composite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is part of Cantera. See License.txt in the top-level directory or
# at https://cantera.org/license.txt for license and copyright information.
from __future__ import annotations

from ._cantera import *
import numpy as np
Expand Down Expand Up @@ -661,14 +662,16 @@ def __len__(self) -> int:
def ndim(self) -> int:
"""The number of dimensions in the SolutionArray.
:return: `int`
.. versionadded:: 3.0
"""
return len(self.shape)

@property
def shape(self) -> tuple[int, ...]:
"""The shape of the SolutionArray.
.. versionadded: 3.0
:return: A tuple of integers with the number of elements in each dimension.
"""
return self._shape
Expand All @@ -677,7 +680,7 @@ def shape(self) -> tuple[int, ...]:
def size(self) -> int:
"""The number of elements in the SolutionArray.
:return: `int`
.. versionadded: 3.0
"""
return np.prod(self.shape)

Expand Down

0 comments on commit 790b507

Please sign in to comment.