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

Checking failing tests on Azure #995

Merged
merged 7 commits into from
Jan 20, 2020
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
2 changes: 1 addition & 1 deletion azure-pipelines/simple_test_framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
source activate tardis
conda install -y pytest-cov
pip install git+https://github.com/tonybaloney/pytest-azurepipelines.git
pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html
pytest -s tardis/tests/test_tardis_full_formal_integral.py --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html
displayName: 'TARDIS test'


Expand Down
8 changes: 5 additions & 3 deletions tardis/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ def spectrum_virtual(self):

@property
def spectrum_integrated(self):
if self._spectrum_integrated is None:
self._spectrum_integrated = self.integrator.calculate_spectrum(
self.spectrum_frequency[:-1], **self.integrator_settings)
self._spectrum_integrated = self.integrator.calculate_spectrum(
self.spectrum_frequency[:-1], **self.integrator_settings)
# if self._spectrum_integrated is None:
# self._spectrum_integrated = self.integrator.calculate_spectrum(
# self.spectrum_frequency[:-1], **self.integrator_settings)
return self._spectrum_integrated

@property
Expand Down
6 changes: 4 additions & 2 deletions tardis/montecarlo/src/integrator.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#define _USE_MATH_DEFINES

#include <inttypes.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
Expand Down Expand Up @@ -210,7 +211,7 @@ _formal_integral(
for (i = 0; i < size_tau; ++i) {
exp_tau[i] = exp( -storage->line_lists_tau_sobolevs_i[i]);
}
calculate_p_values(storage->r_outer_i[storage->no_of_shells_i - 1], N, pp);
calculate_p_values(R_max, N, pp);
// Done with the initialization

// Loop over wavelengths in spectrum
Expand Down Expand Up @@ -335,7 +336,8 @@ _formal_integral(
}
}
// Free everything allocated on heap
free(exp_tau);
printf("\n");
}
return L;
}
}
4 changes: 3 additions & 1 deletion tardis/tests/test_tardis_full_formal_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from tardis.simulation.base import Simulation
from tardis.io.config_reader import Configuration

import astropy

config_line_modes = ['downbranch', 'macroatom']
interpolate_shells = [-1, 30]
Expand All @@ -24,6 +24,7 @@ def base_config(request):
config["montecarlo"]["no_of_virtual_packets"] = 0
config["spectrum"]["method"] = "integrated"
config["spectrum"]["integrated"]["points"] = 200
print("config", config)

return config

Expand Down Expand Up @@ -92,6 +93,7 @@ def test_spectrum_integrated(self, runner, refdata):
luminosity = u.Quantity(
refdata('spectrum_integrated/luminosity'), 'erg /s')

print("actual, desired: ", luminosity, runner.spectrum_integrated.luminosity)
assert_quantity_allclose(
runner.spectrum_integrated.luminosity,
luminosity)
2 changes: 1 addition & 1 deletion tardis_env3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- numpy=1.15
- scipy=1.1
- pandas=0.24
- astropy=3
- astropy=3.2.1

- numba=0.43
- numexpr
Expand Down