snoplusuk / echidna

MIT License
4 stars 12 forks source link

Adds getting started tutorial. #91

Closed ashleyrback closed 9 years ago

ashleyrback commented 9 years ago

Partially fulfills #78.

Tutorial covers:

The tutorial is created in an ipython notebook, and also as a separate script in the scripts directory and on the wiki.

ashleyrback commented 9 years ago

@arushanova there are details on the wiki explaining how to run the tutorial with ipython notebook.

arushanova commented 9 years ago

Thank you Ashley, this is a very nice tutorial. I just have a couple of comments for getting_started.ipynb. 1) The plots are not shown in ipython. Please see the detailed comments bellow the lines. 2) I think it will be more consistent to say either "we, our" or "you" throughout the tutorial.

arushanova commented 9 years ago

Could you please add init to the getting_started.py, the documentation doesn't appear online

ashleyrback commented 9 years ago

@arushanova changes pushed but still need to solve segmentation violation problem. See comment inline.

ashleyrback commented 9 years ago

@arushanova the segmentation violation problem has now been fixed, so all should be in place for you to give it a final check-over, please.

arushanova commented 9 years ago

I've tried to build the document and could see the documentation online. These are the warnings I get when make the doc:

sphinx-build -b html -d _build/doctrees   . html/docs
Running Sphinx v1.3b2
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 10 source files that are out of date
updating environment: 1 added, 10 changed, 0 removed
RAT: Libraries loaded.7%] echidna.core                                                                                         
reading sources... [100%] modules                                                                                              
/.data/snoplus/evelina/virtual_echidna/echidna/docs/echidna.scripts.tutorials.rst:10: WARNING: autodoc: failed to import module u'echidna.scripts.tutorials.getting_started'; the following exception was raised:
Traceback (most recent call last):
  File "/.data/snoplus/evelina/virtual_echidna/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 378, in import_object
    __import__(self.modname)
  File "/data/snoplus/softwareSL6/root-5.34.30/lib/ROOT.py", line 352, in _importhook
    return _orig_ihook( name, *args, **kwds )
  File "/.data/snoplus/evelina/virtual_echidna/echidna/echidna/scripts/tutorials/getting_started.py", line 55, in <module>
    config = spectra.SpectraConfig.load_from_file("echidna/config/example.yml")
  File "/.data/snoplus/evelina/virtual_echidna/echidna/echidna/core/spectra.py", line 129, in load_from_file
    config = yaml.load(open(filename, 'r'))
IOError: [Errno 2] No such file or directory: 'echidna/config/example.yml'
looking for now-outdated files... none found
pickling environment... done
checking consistency... /.data/snoplus/evelina/virtual_echidna/echidna/docs/modules.rst:: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] modules                                                                                               
generating indices... genindex py-modindex
highlighting module code... [100%] echidna.scripts.multi_ntuple_spectrum                                                       
writing additional pages... search
copying static files... WARNING: html_static_path entry u'/.data/snoplus/evelina/virtual_echidna/echidna/docs/_static' does not exist
done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 3 warnings.

Build finished. The HTML pages are in html/docs.
arushanova commented 9 years ago

Here's pep8 output:

getting_started.py:87:1: E402 module level import not at top of file
getting_started.py:149:1: E402 module level import not at top of file
getting_started.py:150:1: E402 module level import not at top of file
getting_started.py:230:1: E402 module level import not at top of file
getting_started.py:265:1: E402 module level import not at top of file
getting_started.py:266:1: E402 module level import not at top of file

But I guess this is not a problem in this case?

ashleyrback commented 9 years ago

@arushanova, correct. In this case the module imports are part of the tutorial, so they are not all grouped at the top of the file. Well spotted though :+1:

arushanova commented 9 years ago

@ashleyrback The plots are nicely shown in ipython now.

ashleyrback commented 9 years ago

@arushanova, that should fix the docs.

ashleyrback commented 9 years ago

@arushanova, fixes plots displayed whilst building docs issue.

arushanova commented 9 years ago

merging!