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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding command line interface to model #31

Merged
merged 7 commits into from
May 19, 2020

Commits on May 18, 2020

  1. feat: add command line hook for deltaRCM

    I agree with Andrew, that the command line would be a good way to 
    interface with the model, especially if configuration files could be 
    passed from the command line.
    
    In this commit, I add that feature using a console_scripts entrypoint in 
    setup.py to a special new function called run_model, and this function 
    runs the model for a given number of timesteps. This number of timesteps 
    is set by the config file, which now accepts an additional timesteps 
    parameter.
    ericbarefoot committed May 18, 2020
    Configuration menu
    Copy the full SHA
    76f73f1 View commit details
    Browse the repository at this point in the history
  2. tests: add unit tests for new command line function

    Basically, since we don't get a model instance to work with when we test 
    from command line, I just hacked this together to save an output image, 
    and check if that image exists. This is enabled with a new 
    test_output.yaml file.
    
    I also added a test to make sure the versions match when we query from 
    command line.
    ericbarefoot committed May 18, 2020
    Configuration menu
    Copy the full SHA
    c83c2f2 View commit details
    Browse the repository at this point in the history
  3. feat: add __main__.py for execution from command line python

    now execution from a config file can be initiated either from a bash 
    entrypoint or from a main file when called via 'python -m pyDeltaRCM' 
    This change addresses DeltaRCM#22.
    ericbarefoot committed May 18, 2020
    Configuration menu
    Copy the full SHA
    4f9a021 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b5a19c2 View commit details
    Browse the repository at this point in the history
  5. fix: make test for command line compatible with python 3.6

    Issue was with the subprocess package. I was using kw arguments that 
    were introduced in 3.7, so I reverted the call to the 3.6 version, now 
    it should run on both.
    ericbarefoot committed May 18, 2020
    Configuration menu
    Copy the full SHA
    16470b8 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2020

  1. fix: some bugs and style changes

    @amoodie pointed out some issues with the PR. changed some importing 
    code, and one order of operations problem.
    ericbarefoot committed May 19, 2020
    Configuration menu
    Copy the full SHA
    572efb5 View commit details
    Browse the repository at this point in the history
  2. fix: no package import needed for console_scripts!

    Surprise! I didn't know how this worked. Turns out you don't need to 
    import the whole package anyway. derp derp
    ericbarefoot committed May 19, 2020
    Configuration menu
    Copy the full SHA
    7265a3d View commit details
    Browse the repository at this point in the history