Skip to content

Commit

Permalink
Merge branch 'master' into unify_unittest_hdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
unoebauer authored Aug 23, 2018
2 parents 5ab2206 + 75d45ae commit 30137da
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ install:
- cd $TRAVIS_BUILD_DIR
- conda env create -f tardis_env27.yml
- source activate tardis
- conda install -y -c conda-forge codecov
#trouble with building due to segfault at cython (https://github.com/cython/cython/issues/2199)
#remove if we can get normal cython through conda
- git clone https://github.com/cython/cython
Expand All @@ -104,7 +105,8 @@ script:
- CC=$COMPILER python setup.py $SETUP_CMD

after_success:
- if [[ "$SAVE_COVERAGE" = true ]]; then coveralls; fi
- if [[ "$SAVE_COVERAGE" = true ]]; then codecov -t a876d307-9ed5-4f5d-a6c4-e58291ac4111; fi


after_failure:
- cat /home/travis/.pip/pip.log
3 changes: 3 additions & 0 deletions docs/workflow/development_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ to the Astropy team for designing it.

git_workflow
release_workflow

.. toctree::

update_refdata


14 changes: 11 additions & 3 deletions docs/workflow/update_refdata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ PR open.
#. clone tardis-refdata (`git clone tardis-refdata`; you need to have git lfs installed) then make a new branch named
the same as your new tardis feature branch.
#. Generate new reference data (in your tardis directory and right branch) offline using
`python setup.py test --args="--tardis-refdata=<path to refdata repo/with the right branch> --generate-reference"`

.. code-block:: None
python setup.py test --args="--tardis-refdata=<path to refdata repo/with the right branch> --generate-reference"
#. Rerun the tests and see if it does not fail using
`python setup.py test --args="--tardis-refdata=<path to refdata repo/with the right branch>"`

.. code-block:: None
python setup.py test --args="--tardis-refdata=<path to refdata repo/with the right branch>"
#. Switch to tardis-refdata. Commit the changed ref-data and open a PR on tardis-refdata
#. Make a copy of the refdata comparer notebook provided in TARDIS-refdata to check if there are
any unexpected changes in the updated reference data and the previous reference data
Expand All @@ -34,4 +42,4 @@ PR open.
- if [[ $TEST_MODE == 'spectrum' ]]; then git checkout origin/master; fi```
#. Then make sure that your TARDIS PR passes again.
#. Then merge your PR to TARDIS master
#. Congratulations - you updated TARDIS to be better. Have a beer and steak (or Tofu if you are vegetarian/vegan)
#. Congratulations - you updated TARDIS to be better. Have a beer and steak (or Tofu if you are vegetarian/vegan)
5 changes: 4 additions & 1 deletion tardis/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# functions that are important for the general usage of TARDIS

def run_tardis(config, atom_data=None):
def run_tardis(config, atom_data=None, simulation_callbacks=[]):
"""
This function is one of the core functions to run TARDIS from a given
config object.
Expand Down Expand Up @@ -35,6 +35,9 @@ def run_tardis(config, atom_data=None):
tardis_config = Configuration.from_config_dict(config)

simulation = Simulation.from_config(tardis_config, atom_data=atom_data)
for cb in simulation_callbacks:
simulation.add_callback(cb)

simulation.run()

return simulation
4 changes: 2 additions & 2 deletions tardis/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ def from_config(cls, config):
"""
if config.plasma.disable_electron_scattering:
logger.warn('Disabling electron scattering - this is not physical')
sigma_thomson = 1e-200 / (u.cm ** 2)
sigma_thomson = 1e-200 * (u.cm ** 2)
else:
logger.debug("Electron scattering switched on")
sigma_thomson = 6.652486e-25 / (u.cm ** 2)
sigma_thomson = const.sigma_T.cgs

spectrum_frequency = quantity_linspace(
config.spectrum.stop.to('Hz', u.spectral()),
Expand Down
1 change: 1 addition & 0 deletions tardis/montecarlo/tests/test_cmontecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import pytest
import numpy as np
import pandas as pd
from astropy import constants as const
from ctypes import (
CDLL,
byref,
Expand Down

0 comments on commit 30137da

Please sign in to comment.