Closed pangtao22 closed 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
Reverted renaming /irs_lqr
to /algorithm
based on slack discussion.
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.py
needs to import fromirs_lqr.irs_lqr.quasistatic_dynamics
, but if I'm running it at the repo's root, it's going to confuse the package nameirs_lqr
with the subpackageirs_lqr
which has now been renamed toalgorithm
. 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