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

Docs/reporting bugs #203

Merged
merged 2 commits into from
Dec 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions docs/bugs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Reporting Bugs
**************

Despite our best efforts TARDIS contains bugs. We want to make sure that fixing
these is quick and painless for users and developers.

When reporting bugs please use the mailing list
(`tardis-sn-user <http://groups.google.com/forum/#!forum/tardis-sn-users>`_) or
create an issue for TARDIS on github (??? ;preferred).

If there are very long ouputs needed to debug the problem, please use a website like
`pastebin <http://pastebin.com>`_ that way it is easier for us to look through it.


One of the major problems that we see are mismatches in installed versions of
third-party libraries (that's where virtualenvs really help -
see :doc:`workflow/python_environment`). To make sure that we can test this properly
please tell us the installed version of third party packages. The easiest way is::


$ pip freeze
Cython==0.20.2
Jinja2==2.7.2
MarkupSafe==0.21
PyYAML==3.11
Pygments==1.6
Sphinx==1.2.2
astropy==1.0.dev10065
astropy-helpers==0.4.2
backports.ssl-match-hostname==3.4.0.2
cov-core==1.11
coverage==3.7.1
docutils==0.11
execnet==1.2.0
h5py==2.4.0a0
ipdb==0.8
ipython==1.2.1
latexcodec==0.3.2
matplotlib==1.4.0
mock==1.0.1
nose==1.3.4
numexpr==2.4
numpy==1.9.0
numpydoc==0.4
oset==0.1.3
pandas==0.14.1
pep8==1.5.6
py==1.4.20
pybtex==0.17
pybtex-docutils==0.2.0
pyparsing==2.0.2
pytest==2.5.2
pytest-cache==1.0
pytest-cov==1.6
pytest-ipdb==0.1-prerelease
pytest-pep8==1.0.6
python-dateutil==2.2
pytz==2014.7
pyzmq==14.2.0
scipy==0.13.3
six==1.8.0
sphinx-bootstrap-theme==0.4.0
sphinxcontrib-bibtex==0.2.9
sphinxcontrib-tikz==0.4.1
tables==3.1.1
tornado==3.2
tox==1.7.1
virtualenv==1.11.6
wsgiref==0.1.2


and pasting the output in your error report, this will show us what packages are
installed and used.

The next thing that is useful to do if TARDIS is downloaded in a directory is to run
the test suites and find if any of the tests fail::

python setup.py test
running test
running build
running build_py
copying tardis/./macro_atom.c -> build/lib.macosx-10.9-x86_64-2.7/tardis/.
copying tardis/./montecarlo.c -> build/lib.macosx-10.9-x86_64-2.7/tardis/.
running build_ext
skipping 'tardis/montecarlo.c' Cython extension (up-to-date)
skipping 'tardis/macro_atom.c' Cython extension (up-to-date)
running build_scripts
============================= test session starts ==============================
platform darwin -- Python 2.7.8 -- pytest-2.5.1

Running tests in tardis /Users/wkerzend/scripts/python/tardis/docs.

Platform: Darwin-13.4.0-x86_64-i386-64bit

Executable: /Users/wkerzend/.virtualenvs/tardis-devel/bin/python

Full Python Version:
2.7.8 (default, Oct 15 2014, 22:04:42)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]

encodings: sys: ascii, locale: UTF-8, filesystem: utf-8, unicode bits: 15
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.9.1
Scipy: 0.13.3
astropy: 1.0.dev10065
yaml: 3.11
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also added some output about what versions of packages that we need are installed. this should make debugging easier.

cython: 0.20.2
h5py: 2.4.0a0
Matplotlib: 1.4.0
ipython: 1.2.1

plugins: cache, cov, ipdb, pep8
collected 107 items

tardis/io/tests/test_ascii_readers.py .......
tardis/io/tests/test_config_reader.py .............................
tardis/io/tests/test_config_validator.py ........................
tardis/io/tests/test_configuration_namespace.py .........
tardis/tests/test_atomic.py .....s
tardis/tests/test_lte_plasma.py ssssssssss
tardis/tests/test_plasma_nlte.py .....
tardis/tests/test_plasma_simple.py .
tardis/tests/test_tardis_full.py s
tardis/tests/test_util.py ...............

==================== 95 passed, 12 skipped in 8.53 seconds =====================



This will hopefully help us to identify us the problem. We will continue to
update this document with other techniques.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rapid spectral modelling of supernovae. The code is described in this documentat
installation
running
uses
bugs
configuration/index
examples/examples
testing
Expand Down Expand Up @@ -45,7 +46,7 @@ please mention the website and cite Kerzendorf & Sim 2014.
User modifications and additions that lead to publications need to be handed back to the community by incorporating them
into this publicly available version of TARDIS.

The current stable version of TARDIS is 0.9 and can be downloaded `here <https://pypi.python.org/pypi/tardis-sn>`_, further installation instructions are
The current stable version of TARDIS is 0.9.2 and can be downloaded `here <https://pypi.python.org/pypi/tardis-sn>`_, further installation instructions are
available here :ref:`installation`.

A file containing an example configuration file and an atomic database can be found in the section :ref:`running`
Expand Down
102 changes: 102 additions & 0 deletions tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,105 @@ def pytest_addoption(parser):
default=False)

parser.addoption("--atomic-dataset", dest='atomic-dataset', default=None, help="filename for atomic dataset")

def pytest_report_header(config):

stdoutencoding = getattr(sys.stdout, 'encoding') or 'ascii'

s = "\n"
if six.PY2:
args = [x.decode('utf-8') for x in config.args]
elif six.PY3:
args = config.args
s += "Running tests in {0}.\n\n".format(" ".join(args))

from platform import platform
plat = platform()
if isinstance(plat, bytes):
plat = plat.decode(stdoutencoding, 'replace')
s += "Platform: {0}\n\n".format(plat)
s += "Executable: {0}\n\n".format(sys.executable)
s += "Full Python Version: \n{0}\n\n".format(sys.version)

s += "encodings: sys: {0}, locale: {1}, filesystem: {2}".format(
sys.getdefaultencoding(),
locale.getpreferredencoding(),
sys.getfilesystemencoding())
if sys.version_info < (3, 3, 0):
s += ", unicode bits: {0}".format(
int(math.log(sys.maxunicode, 2)))
s += '\n'

s += "byteorder: {0}\n".format(sys.byteorder)
s += "float info: dig: {0.dig}, mant_dig: {0.dig}\n\n".format(
sys.float_info)

import numpy
s += "Numpy: {0}\n".format(numpy.__version__)

try:
import scipy
s += "Scipy: {0}\n".format(scipy.__version__)
except:
s += "Scipy: not available\n"

try:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also added some output about what versions of packages that we need are installed. this should make debugging easier.

import astropy
except:
s += "astropy: not available\n"
else:
s += "astropy: {0}\n".format(astropy.__version__)

try:
import yaml
except:
s += "yaml: not available\n"
else:
s += "yaml: {0}\n".format(yaml.__version__)


try:
import cython
except:
s += "cython: not available\n"
else:
s += "cython: {0}\n".format(cython.__version__)



try:
import h5py.version
s += "h5py: {0}\n".format(h5py.version.version)
except:
s += "h5py: not available\n"


try:
import matplotlib
s += "Matplotlib: {0}\n".format(matplotlib.__version__)
except:
s += "Matplotlib: not available\n"

try:
import IPython
except:
s += "ipython: not available\n"
else:
s += "ipython: {0}\n".format(IPython.__version__)


special_opts = ["remote_data", "pep8"]
opts = []
for op in special_opts:
if getattr(config.option, op, None):
opts.append(op)
if opts:
s += "Using Astropy options: {0}.\n".format(" ".join(opts))

if six.PY3 and (config.getini('doctest_rst') or config.option.doctest_rst):
s += "Running doctests in .rst files is not supported on Python 3.x\n"

if not six.PY3:
s = s.encode(stdoutencoding, 'replace')

return s