Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #285 +/- ##
==========================================
- Coverage 91.25% 91.11% -0.14%
==========================================
Files 106 107 +1
Lines 3863 3881 +18
Branches 839 844 +5
==========================================
+ Hits 3525 3536 +11
- Misses 208 212 +4
- Partials 130 133 +3
🚀 New features to boost your workflow:
|
| # from indsl.validations import validate_series_is_not_empty | ||
|
|
||
|
|
||
| # @check_types |
There was a problem hiding this comment.
Check types is required for functions that should be exposed in the UI. Thin function checks that the provided types are matching expected types.
| input_time = np.array([time_.timestamp() for time_ in input_time_pd]) | ||
| input_y = np.sin((input_time - input_time[0]) / (input_time[-1] - input_time[0]) * 2 * np.pi) | ||
|
|
||
| ts_series = user_specified_timeseries(input_time_str, input_y.tolist()) |
There was a problem hiding this comment.
I assume here check_types fails because input_time_str is a [str], but in the function definition the input is specified as a [float]
| def user_specified_timeseries( | ||
| input_time: List[float] = [0.0, 1.0], input_values: List[float] = [0.0, 1.0] | ||
| ) -> pd.Series: | ||
| """Convert input to a timeseries. |
There was a problem hiding this comment.
How would this work in the UI? user manually copy pastes all the values into the parameters of the nodes?
|
Hi @gunnarstaff ! |
| ) -> pd.Series: | ||
| """Convert input to a timeseries. | ||
|
|
||
| The input is converted to a time series, assuning the input time is provied as Unix time, in seconds. |
There was a problem hiding this comment.
I am thinking about closing this PR @tuanng-cognite.
tuanng-cognite
left a comment
There was a problem hiding this comment.
look good. What is the rational behind this function? I think this is quite simple
| @pytest.mark.core | ||
| def test_user_specified_timeseries(): | ||
| """Timestamp given as Unix time in sec""" | ||
| import pickle |
There was a problem hiding this comment.
we can have global import
Description
Allow the user to provide a timeseries as input
Motivation and Context
Many users want to overlay a timeseries on the plots in Charts. It can be a measurement that is not in cdf, or a separate model/curvefit that cannot be performed in Charts.
This is a common request.
It is a crude workaround, but it will solve the clients problem until we have a better solution
How Has This Been Tested?
Win11, python 3.10.7
Screenshots (if appropriate):
Types of changes
Contributor Checklist:
fix: <description>,feat: <description>, etc.Reviewer Checklist for Charts compliant functions: