hjsuh94 / irs_mpc

iRS-LQR: iterative Randomized Smoothing LQR
MIT License
7 stars 0 forks source link

Add quasistatic 2D hand-ball examples. #4

Closed pangtao22 closed 3 years ago

pangtao22 commented 3 years ago

A global change I made in PR is renaming /irs_lqr to /algorithm, which makes importing easier. For example, under the old naming convention, /examples/quasistatic/dynamics_gradient_worker.pyneeds to import from irs_lqr.irs_lqr.quasistatic_dynamics, but if I'm running it at the repo's root, it's going to confuse the package name irs_lqr with the subpackage irs_lqr which has now been renamed to algorithm. I used PyCharm's refactoring to make the changes, so it should not have broken your code. Let me know if there's any problems!


This change is Reviewable

hjsuh94 commented 3 years ago

Oop - before the review, let's discuss this global change. The convention that I am used for python packages is that the root of the github folder (irs_lqr) gets added to PYTHONPATH, and import irs_lqr should automatically import the folder that was renamed algorithms.

Some examples: numpy has numpy folder within repo, and import numpy imports the folder. cvxpy has cvxpy folder. gym has gym folder.

Maybe it has to do with how things get packaged into pip later on? I am not sure :) I am fine with this change if it's causing lots of trouble with the IDE, but would prefer to keep irs_lqr folder.

The import should call irs_lqr.quasistatic_dynamics because the high-level irs_lqr should be on the path. Essentially, the problem seems like I am adding pythonpaths from folder to folder while you are collecting them all under PycharmProjects :P

pangtao22 commented 3 years ago

Reverted renaming /irs_lqr to /algorithm based on slack discussion.