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

Numba formal integral #1549

Merged
merged 40 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
af53d15
Readded the numba formal integral changes
Rodot- Apr 23, 2021
007b2ba
Update base.py to match main
andrewfullard Apr 23, 2021
45681b8
Reverted formal integral instantiation to be more similar to the orig…
Rodot- Apr 26, 2021
e2741d4
Moved numba implimentation to the montecarlo_numba folder since this …
Rodot- Apr 26, 2021
41c86a4
Removed extra ravel
Rodot- Apr 26, 2021
1f9340b
Added back old formal integral for testing
Rodot- Apr 26, 2021
b413200
Added test for function in the numba formal integral
Rodot- Apr 26, 2021
f1f9818
Changed the way the shell size is computed, should be correct now
Rodot- Apr 26, 2021
da1285a
nevermind
Rodot- Apr 26, 2021
e22f921
Moved numba formal integral tests so that paths work out for testing …
Rodot- Apr 26, 2021
d683764
Moved pointer incrementation to the end of the loop
Rodot- Apr 26, 2021
c24b6a9
Fixed typo
Rodot- Apr 26, 2021
746c06e
Switched tests to use numba models
Rodot- Apr 26, 2021
96b1576
numba models instantiate with proper data types now
Rodot- Apr 26, 2021
ba5cb51
Fixed numba_formal_integral tests to instantiate numba models with nu…
Rodot- Apr 26, 2021
3f884d5
Added a couple docstrings with some notes about future improvements
Rodot- Apr 26, 2021
a2f315c
Streamlined the interface slightly to better catch bugs
Rodot- Apr 26, 2021
c1cafbf
Added some debug statements to watch array sizes in tests
Rodot- Apr 26, 2021
383ede1
Changed way size_line and size_shell are created using tau_sobolevs
Rodot- Apr 26, 2021
6da6f2e
Changed the most inner for-loop to be more similar to the C code and …
Rodot- Apr 26, 2021
007efab
Added back in the check for interpolate shells
Rodot- Apr 26, 2021
897fd97
Added back in old code for interpolate shells and now computes over t…
Rodot- Apr 27, 2021
9dee040
Fixed interpolate shells function and made sure dataframes are proper…
Rodot- Apr 27, 2021
c4923e9
Fixed bug in counter for Jred_lu pointer
Rodot- Apr 27, 2021
d07e710
More explicit about typing. the value for SIGMA_THOMSON now comes fr…
Rodot- Apr 27, 2021
85b5487
Finished tests for the numba formal integral helper functions
Rodot- Apr 28, 2021
82b9a9e
Added some docstrings and removed some commented out code
Rodot- Apr 28, 2021
3ff8827
Removed old import of C formal integral
Rodot- Apr 28, 2021
e1b86b3
Removed deprecated formal integral import
Rodot- Apr 28, 2021
f6ef06f
Changed test to generate a new numba model as to not interfere with o…
Rodot- Apr 28, 2021
a1f28ee
removed old C interface
Rodot- Apr 28, 2021
b01a615
Merge remote-tracking branch 'upstream/master' into numba_formal_inte…
Rodot- Apr 28, 2021
3039051
Updated tests and environment to exclude compilers and Cython
Rodot- Apr 28, 2021
f7184bd
Reformatted conftest so black doesn't complain
Rodot- Apr 28, 2021
2fb8ea9
Removed commented out lines, made cleaner
Rodot- Apr 28, 2021
034d7b3
Added back montecarlo tests since it apepars some r_packet tests are …
Rodot- Apr 28, 2021
6070cde
Removed commented out packages from the environment file
Rodot- Apr 28, 2021
fa404b8
Slight optimization and readability improvements
Rodot- Apr 29, 2021
467ae57
Further optimization, now pre-computes indices of next resonance point
Rodot- Apr 29, 2021
214c0d2
Removed old binary search, made formatting fixed
Rodot- Apr 30, 2021
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: 0 additions & 2 deletions tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@
PYTEST_HEADER_MODULES["Pandas"] = "pandas"
PYTEST_HEADER_MODULES["Astropy"] = "astropy"
PYTEST_HEADER_MODULES["Yaml"] = "yaml"
PYTEST_HEADER_MODULES["Cython"] = "cython"
PYTEST_HEADER_MODULES["h5py"] = "h5py"
PYTEST_HEADER_MODULES["Matplotlib"] = "matplotlib"
PYTEST_HEADER_MODULES["Ipython"] = "IPython"
# del PYTEST_HEADER_MODULES['h5py']
except (NameError, KeyError): # NameError is needed to support Astropy < 1.0
pass

Expand Down
13 changes: 9 additions & 4 deletions tardis/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from tardis.util.base import quantity_linspace
from tardis.io.util import HDFWriterMixin
from tardis.montecarlo import packet_source as source
from tardis.montecarlo.formal_integral import FormalIntegrator
from tardis.montecarlo.montecarlo_numba.formal_integral import FormalIntegrator
from tardis.montecarlo import montecarlo_configuration as mc_config_module


Expand Down Expand Up @@ -283,7 +283,6 @@ def run(

set_num_threads(nthreads)

self._integrator = FormalIntegrator(model, plasma, self)
self.time_of_simulation = self.calculate_time_of_simulation(model)
self.volume = model.volume

Expand All @@ -296,6 +295,7 @@ def run(

configuration_initialize(self, no_of_virtual_packets)
montecarlo_radial1d(model, plasma, self)
self._integrator = FormalIntegrator(model, plasma, self)
# montecarlo.montecarlo_radial1d(
# model, plasma, self,
# virtual_packet_flag=no_of_virtual_packets,
Expand Down Expand Up @@ -546,7 +546,9 @@ def calculate_f_lambda(self, wavelength):
pass

@classmethod
def from_config(cls, config, packet_source=None, virtual_packet_logging=False):
def from_config(
cls, config, packet_source=None, virtual_packet_logging=False
):
"""
Create a new MontecarloRunner instance from a Configuration object.

Expand Down Expand Up @@ -597,5 +599,8 @@ def from_config(cls, config, packet_source=None, virtual_packet_logging=False):
debug_packets=config.montecarlo.debug_packets,
logger_buffer=config.montecarlo.logger_buffer,
single_packet_seed=config.montecarlo.single_packet_seed,
virtual_packet_logging=(config.spectrum.virtual.virtual_packet_logging | virtual_packet_logging),
virtual_packet_logging=(
config.spectrum.virtual.virtual_packet_logging
| virtual_packet_logging
),
)
317 changes: 0 additions & 317 deletions tardis/montecarlo/montecarlo.pyx

This file was deleted.

Loading