ccaprani / pycba

Python Continuous Beam Analysis
https://ccaprani.github.io/pycba/
Apache License 2.0
64 stars 29 forks source link

Vehicle object has no attribute 'reverse' #30

Closed connorferster closed 1 year ago

connorferster commented 1 year ago

Hi Colin,

Working through an example bridge analysis and noticed that the Vehicle object seems to be missing some documented methods. It's weird, because I clicked through to the source code and the published source shows a reverse method.

Source code link: https://ccaprani.github.io/pycba/_modules/pycba/bridge.html#Vehicle.reverse

Here is what I did:

axle_spacings = [4.3, 6.5]
axle_loads = [35, 145, 145]
aashto_truck = cba.Vehicle(axle_spacings=axle_spacings, axle_weights=axle_loads)
aashto_truck.reverse()

PyCBA 0.1.1

Also, a design thought: could the method return a new vehicle that represents the original vehicle reversed? This would be instead of modifying the existing vehicle in place. Your thoughts?

ccaprani commented 1 year ago

Thanks @connorferster ! I think it's just that there is no v0.1.1 release - the reverse method is not part of v0.1 release. I'll do a v0.2 release shortly which will capture it.

Regarding returning a vehicle object from calling reverse(), it's certainly possible; I'm just wondering the use case...I could add an in_place argument ala pandas to govern returning a reversed copy or reversing in place. That seems to hit both points.

ccaprani commented 1 year ago

This is included in the new v0.2 release @connorferster . Enjoy!