Experimenting with re-organizing the scripts directory #611
tobeycarman
started this conversation in
Ideas
Replies: 1 comment
-
I think it's looking good so far. My initial inclination would be to have a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Have been needing to do this for a while, but finally made a breakthrough with understanding Python's import mechanism. The goal is to cleanup the
scripts/
directory, making it easier to find the right info and easier to understand how all the pieces fit together. With this initial stab - see branch "reorganize" I chose the following layout:With this arrangement I was able to get all the tests to run, from the main directory of the repo by doing the following:
Really just setting the
PYTHONPATH
environment variable before calling the test script so that within the script, the module importing will work. This means that in order to use the utility modules in your own script you might do something like this:And then call your script like so:
My hunch now is that setting the environment variable is preferable to using relative imports or hacking around with
sys.path
.Hoping to fix a bunch of things with this re-organization:
_util.py
while others were plural_utils.py
A few outstanding concerns:
calibration_viewer.py
util
directory, or kept separate (a bunch of the existing utility scripts are a mixture of plotting and utility functions)Further discussion welcome!
Beta Was this translation helpful? Give feedback.
All reactions