Skip to content

Commit 0c6fce1

Browse files
committed
BUG: Readd SourceType enumeration for function source types and clean up imports
1 parent 556afaf commit 0c6fce1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

rocketpy/mathutils/function.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from bisect import bisect_left
1111
from collections.abc import Iterable
1212
from copy import deepcopy
13+
from enum import Enum
1314
from functools import cached_property
1415
from inspect import signature
1516
from pathlib import Path
@@ -25,7 +26,7 @@
2526
)
2627

2728
from rocketpy.plots.plot_helpers import show_or_save_plot
28-
from rocketpy.tools import deprecated
29+
from rocketpy.tools import deprecated, from_hex_decode, to_hex_encode
2930

3031
# Numpy 1.x compatibility,
3132
# TODO: remove these lines when all dependencies support numpy>=2.0.0
@@ -47,6 +48,13 @@
4748
}
4849
EXTRAPOLATION_TYPES = {"zero": 0, "natural": 1, "constant": 2}
4950

51+
class SourceType(Enum):
52+
"""Enumeration of the source types for the Function class.
53+
The source can be either a callable or an array.
54+
"""
55+
56+
CALLABLE = 0
57+
ARRAY = 1
5058

5159
class Function: # pylint: disable=too-many-public-methods
5260
"""Class converts a python function or a data sequence into an object

0 commit comments

Comments
 (0)