ENH: Added Crop and Clip Methods to Function Class - #817
Merged
Gui-FernandesBR merged 2 commits intoAug 13, 2025
Merged
Gui-FernandesBR merged 2 commits into
Gui-FernandesBR merged 2 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request type
Checklist
Current behavior
RocketPy Function class has no methods to crop or clip the input and output values of a function to a specific range.
This PR is related to the following issue:
ENH: give me a scissor or apply
Function.clipandFunction.crop- #546New behavior
It is now possible to specify a limited range of values for input or output variables for an object created from the Function class at any point after initialization of the object by using the
cropandclipmethods respectively. These methods work for any type of allowed Function source.Breaking change
No
Additional information
To use the new methods, some examples are provided below to exemplify their syntax in brief:
f.crop([(-1, 1), (-2, 2)])- For two input variablesf.clip([(-2, 2)])- For output variable