plot_timeseries does not handle returns type properly #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull requests adresses #61
Summary of changes
Test evidences
To keep scope of the fix limited behavior of
reports.full
when strategy / returnes are passed aspd.DataFrame
is kept as-is. Subject to a further bug report / inverstigationAny questions / suggestions let me know.
Sergey
Description by Korbit AI
What change is being made?
Add type annotations and input validation to
plot_timeseries
andfull
functions to ensurereturns
is a pandas Series or DataFrame andbenchmark
is either None or a pandas Series.Why are these changes being made?
These changes improve the robustness of the code by enforcing type constraints, which helps prevent runtime errors due to incorrect input types. This approach enhances code readability and maintainability by clearly specifying expected input types and handling invalid inputs gracefully.