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

Streamline dependencies and installation #129

Open
mfripp opened this issue Nov 1, 2019 · 1 comment
Open

Streamline dependencies and installation #129

mfripp opened this issue Nov 1, 2019 · 1 comment

Comments

@mfripp
Copy link
Member

mfripp commented Nov 1, 2019

There are a number of ideas in pull request #115 that won't make it into the 2.0.6 release, so I'm gathering them here for future consideration.

First, unaddressed goals from the start of that pull request:

  • simplify dependencies
    • group optional dependencies into one additional set? (conda install switch_model_extras / pip install switch_model[extras])
    • require users to explicitly install some specialized dependencies ad hoc? (rpy2 and numpy for iterative demand response, psycopg2-binary or eventually google-cloud-bigquery for accessing the Hawaii back-end database)
    • should we include testing-oriented packages (pint, maybe testfixtures?) in extras, or just list them as something to add ad hoc if running tests? (may be moot if we can figure out a way to get our tests to run without needing pint, which pyomo needs during testing but does not include in the distribution)
  • streamline installation instructions
    • recommend this sequence for most users?
      1. conda install -c defaults -c conda-forge switch_model or pip install switch_model (+find glpk somewhere) for most users?
      • these users can look at the source code on github or in their system install directory if needed, which is how I interact with Pyomo
      • in my experience long-term dependcy problems are reduced by making conda-forge the top-priority channel (conda config --add channels new_channel). Should we recommend this for all users, or would that be too much meddling in people's system configuration?
    • recommend this sequence only for people who want to edit the source code and contribute back?
      1. git clone https://github.com/switch-model/switch.git && cd switch
      2. if running anaconda: conda install --only-deps switch_model
      3. pip install --editable . or python setup.py develop (note: conda develop doesn't install command-line scripts or dependencies; see how to use conda develop? conda/conda-build#1992 (comment))
  • maybe add some commands to give easier access to source code hidden in a site-packages directory:
    • switch find <module>: report file path to specified module (possibly just a submodule within switch_model)
      • then users can view or edit source code via commands like atom `switch find switch_model` , mate `switch find pyomo` or maybe atom `switch find discrete_commit` .
    • switch install examples: copy examples directory to local directory
    • switch solve --trace [[<module>|<file>[:<function>|<line>]], [<module>[:<function>]], ...]: invoke the debugger (a) when particular callbacks are called, (b) when any callback in the specified module is called (if no function specified), or (c) whenever any callback is called (if no modules specified).
      • This could be implemented either via tests when we call callbacks, or by creating tracing wrappers for the specified callbacks, or by subclassing Pdb and setting breakpoints in the right places (that is nice and general but may run slower and ties us to Pdb?)
@mfripp
Copy link
Member Author

mfripp commented Nov 1, 2019

@josiahjohnston made several suggestions in this comment:

  • recommend including support for testing (testfixtures) in the bundle of extra dependencies
  • recommend installing the extra dependencies via an [extras] section in setup.py, not ad hoc installation of individual packages
    • MF note: conda doesn't provide this option, but presumably Josiah would be happy with a separate conda install switch_model_extras for this.
  • support the idea of switch find <module>
  • support the idea of switch solve --trace [[<module>|<file>[:<function>|<line>]], [<module>[:<function>]], ...]
  • switch install examples is more opaque and no easier than copying explicitly from the repository

@mfripp mfripp mentioned this issue Nov 1, 2019
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

1 participant