MNT: Rename radius to radius_function in CylindricalTank and SphericalTank#957
Draft
MNT: Rename radius to radius_function in CylindricalTank and SphericalTank#957
radius to radius_function in CylindricalTank and SphericalTank#957Conversation
…lTank Agent-Logs-Url: https://github.com/RocketPy-Team/RocketPy/sessions/34182dad-3a90-44dc-96a2-e29c6a9b9f55 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
…ion parameter Agent-Logs-Url: https://github.com/RocketPy-Team/RocketPy/sessions/34182dad-3a90-44dc-96a2-e29c6a9b9f55 Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix name conflict in radius property and input of TankGeometry
MNT: Rename Apr 29, 2026
radius to radius_function in CylindricalTank and SphericalTank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
CylindricalTankandSphericalTankstored their scalar radius input privately (__input_radius) while theTankGeometry.radiusproperty returns aPiecewiseFunction. This meantStochasticModel(which callsgetattr(obj, input_name)) would get theFunctioninstead of the original scalar when accessingobj.radius.Changes
CylindricalTank/SphericalTank: Renamed constructor parameterradius→radius_function; stored asself.radius_function(public), replacing the private__input_radiusradius=keyword arg accepted via**kwargswith aDeprecationWarningpointing toradius_functionto_dict()now emits"radius_function"key;from_dict()handles both keys (deprecated"radius"triggersDeprecationWarning)to_dictkey nameMigration
After this change,
obj.radius_functionreturns the original scalar input whileobj.radiuscontinues to return thePiecewiseFunctionof height.Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest tests -m slow --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
CylindricalTank(radius=0.1, height=2.0).radiusreturns aPiecewiseFunction, not0.1.StochasticModelsthat callgetattr(obj, 'radius')to retrieve the nominal scalar value get the wrong type.New behavior
obj.radius_functionexposes the original scalar input.obj.radiusis unchanged (still thePiecewiseFunction). Oldradius=usage triggersDeprecationWarning.Breaking change
Keyword-argument callers using
radius=will see aDeprecationWarning. Serialized data with a"radius"key into_dict()output will trigger aDeprecationWarningonfrom_dict(). Positional callers are unaffected.