Skip to content
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

improve setup for running tool #109

Closed
bstabler opened this issue Feb 10, 2020 · 4 comments
Closed

improve setup for running tool #109

bstabler opened this issue Feb 10, 2020 · 4 comments

Comments

@bstabler
Copy link
Contributor

see ActivitySim/activitysim#287

@blakerosenthal
Copy link
Contributor

blakerosenthal commented Feb 10, 2020

CLI spec

Some proposed/in-progress changes for an easy command-line tool can be found on the cli branch of this repo. Our next step would be to move these changes over to the main ActivitySim package, where it could be reimported into BCA, PopSim, AsimTBM, etc.

Commands:

  • bca create ... will copy an example from the installed package into a user-specified directory. This will allow us to templatize certain setups and allow the user to easily configure their own settings. The user will not be required to copy files around between example/test folders, and the package will not need to include multiple copies of input files.
  • bca run ...: will run the program on a specified project directory. This tool would allow us to remove all the run_bca.py, simulation.py scripts from the examples and consolidate them into a single command.

TODOs:

@bstabler @toliwaga if this sounds like a promising approach, I can update BCA to use this instead of all the run scripts. This would involve

  • updating the docs with the new run instructions
  • updating Travis to use the cli tool
  • add some useful command line extras like a --version option

Then if we like how BCA is working we can

  • move the cli module to ActivitySim
  • integrate the existing handle_standard_args code from Asim
  • update the ActivitySim docs
  • make sure the example folders are on PyPi
  • add back into BCA and other packages

A few things I'd like to do which would be very easy with this setup:

  • give each affiliated package their own command line tool (ActivitySim would be activitysim run ..., PopSim would be populationsim run ..., etc. but they'd share the same core code
  • give each package a standard version.py that could be incorporated into the cli tool
  • maybe add a settings cli option that would allow the user to set/view arbitrary settings without needing to open their config files whenever they want to tweak something
  • maybe add a logging level option (like a -q quiet flag?) that would suppress console output

@bstabler
Copy link
Contributor Author

bstabler commented Feb 11, 2020

This looks good. For now let's just get the bca example working and then do a bit of testing. We can post bca on pypi as well, which we should do anyway. We can suggest moving this into activitysim if the bca example works well.

@blakerosenthal blakerosenthal mentioned this issue Feb 12, 2020
Merged
@bstabler
Copy link
Contributor Author

bstabler commented Feb 14, 2020

bca4abm create --list doesn't return anything (on Windows?). bca4abm -h, --version, and run all work.

image

@blakerosenthal
Copy link
Contributor

blakerosenthal commented Feb 14, 2020

fixed! thanks for catching that @bstabler 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants