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

Features/examples commandline script #227

Merged
merged 21 commits into from Nov 1, 2016

Conversation

Projects
None yet
3 participants
@gplssm
Copy link
Contributor

gplssm commented Oct 30, 2016

Created a script callable from command-line to execute examples after installation via pip3. All this is virtualenv-proof, but not proof in general.

In the end examples are callable by

usage: oemof_examples [-h] example

Choose one of the examples below listed examples!

positional arguments:
  example     Example name (from list of examples)

optional arguments:
  -h, --help  show this help message and exit

        List of examples

         * storage_invest
         * simple_least_costs
         * investment
         * flexible_modelling

Issue I had during implementation

  • #225
  • #226
  • import in files under examples/ because parent package is not imported

We should try to answer #225 until release of v0.1.

gplssm added some commits Oct 30, 2016

Harmonize call of example scripts
* put remaining example scripts in if __name__ == "__main__":
* create main function as run_<example name>_example()
* put all calls to new run-function
Install example files to site-packages
* create inits
* modif setup.py
* add package data
Create entry point
One script with examples as argument

gplssm added some commits Oct 30, 2016

@simnh

This comment has been minimized.

Copy link
Member

simnh commented Oct 31, 2016

Great! As I see it now, should we rename the examples for better 'self - description'? We discussed this somewhere already? Or can we do it later after the release?

@gplssm

This comment has been minimized.

Copy link
Contributor Author

gplssm commented Oct 31, 2016

I discussed with @uvchik... We decided to keep it as it is, keeping the issue in mind (see #226) and solve this by the next release with a more sophisticated solution.

I resolved merge conflicts and added operational example to examples script.
@uvchik please wait with merge of this PR until we have a final decision on #225

@gplssm

This comment has been minimized.

Copy link
Contributor Author

gplssm commented Oct 31, 2016

Arrrggg! Tests are failing now. I don't get why...!? Maybe oemof_full_test.py now executes operational_model because I added an init.py_ file there...

uvchik added some commits Oct 31, 2016

Merge branch 'release/v0.1' of github.com:oemof/oemof into features/e…
…xamples-commandline-script

Conflicts:
	README.rst
Merge branch 'release/v0.1' of github.com:oemof/oemof into features/e…
…xamples-commandline-script

Conflicts:

examples/solph/csv_reader/investment_example/investment_example.py
	examples/solph/flexible_modelling/add_constraints.py
	examples/solph/storage_optimization/storage_invest.py
@uvchik

This comment has been minimized.

Copy link
Member

uvchik commented Nov 1, 2016

All seems to work now. Thank you @gplssm for your work 🌻

@uvchik uvchik merged commit 6bd7b7c into release/v0.1 Nov 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@uvchik uvchik deleted the features/examples-commandline-script branch Nov 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment