-
Notifications
You must be signed in to change notification settings - Fork 15
Fix command line runs #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
k8culver
commented
Aug 28, 2025
- Fixed command line runs
- Renamed a bunch of stuff from job shop to flow shop
- Made NL default for command line runs
- Added print statements to command line runs to clarify solver use
src/utils/greedy.py
Outdated
| sys.path.append("./src") | ||
| from model_data import JobShopData | ||
| from model_data import FlowShopData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps out of scope for this PR, but manual python path tweaks like this are extremely finicky and fragile. In the example above, src is added to the lookup path, but relative to cwd! So, the python interpreter will fail to find src when directory changes.
You can either anchor it relative to __file__, or better yet, convert src to a "package", since you're already treating it like that -- so, just add __init__.py to src and src/utils. The relative imports will also work:
from .model_data import FlowShopDataFor max reliability you could also create a real package under e.g. src/flow_shop_utils, and then install it as part of requirements:
-e src/flow_shop_utils
That way it's available for import from anywhere.
Btw, I used the latter approach in https://github.com/dwave-examples/mvrp-demo/ (as it required cythonization and compilation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Rad! In the other demos I've been using from src.file_name is this ok or would you prefer one of the solutions above?
Co-authored-by: Theodor Isacsson <[email protected]>
thisac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @k8culver!