Working on the RevHack2020 effort, I wanted to run the eVTOL trajectory optimization provided by Shamsheer Chauhan. This code was written for OpenMDAO V2, and I had V3 installed on my machine. While there were no API backwards incompatibilities in V3 that I ran into, the code did use the BSplineComp from the V2.10 standard library which doesn’t exist in V3.
So I couldn’t run the model in my V3 install. I could have installed V2.10 as a separate conda environment, but that seems like overkill. Instead, here are two better options. Both take less than 5 minutes total time:
Fix 1: Update to the latest APIS
We provide an upgrade guide from 2.10 to 3.0, in which there is an example of how to update to SplineComp (V2.10 is in red, V3 is in green).
You can see that it wouldn’t take major changes to get it updated, and the results should be identical but if you would rather not hack on the code at all… maybe you just want to run it exactly as is.
Fix 2: Pull the old component into your model
We deprecated the older BsplineComp, in favor of the newer SplineComp because the newer one has a more consistent API and offers more features. Still, you might be totally happy with the BsplineComp, or perhaps in some other situation there is some missing functionality in the new component thats a problem for you. You just want to use the old component!
One of the best things about using an open source project is that … you have access to the source! You can go back to the last V2 release (V2.10.1) and grab the component code there, then pull it into your own repo.
First go to the tags at the top of the OM repo
Next pick the specific version you want to grab code from, by clicking on the commit hash for that version.
Next follow the “Browse Files” link to get to the code
Then you can navigate the repo, go get the code you want and pull it into your own project. The upside is that you now don’t have to change your code (except to change where you imported the component from). The downside is that you now how to maintain this component yourself if you need any changes in the future.