Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugging relativity on numba_montecarlo (tardis-sn#1136)
* removing kwarg from MonteCarloConfiguration, as jitclass does not support them * need to pass enable_full_relativity to configuration_initialize, as removed kwarg in MonteCarloConfiguration * move_r_packet and trace_packet both require montecarlo_configuration arg * r_packet object used in distance calculation in place of r_packet.r value * the full_relativity bool was being passed as a different kwarg * added montecarlo_configuration to args of trace_vpacket_volley and trace_vpacket, so that relativity attribute continues to get passed down * making sure the vpacket funcs that now require montecarlo_configuration get called with this arg * Added random seed; does not work with numba * Changed to numpy random seed * Commented out MonteCarloException block; will test how this impacts output * Need the MonteCarloException block to be run, otherwise large discrepancies between numba branch and master branch * Adding custom seeds to vpackets; few line adjustments * changed from njit to jit to ease debugging * More descriptive montecarloexception, with optional printing beforehand * Changed njit to jit in single_loop to ease debugging * Added single-packet debugging capabilities to MonteCarloRunner. * Removing plotting funcs from montecarlo * Added basic logging capabilities to montecarlo_numba * Generalized logger to *args * Tweaking configuration of logging in module * Logger can now handle kwargs * Renamed logger * Make logging more in line with other TARDIS loggers. * Share global variable DEBUG_MODE across modules with montecarlo init. * No longer calling removed plot_single_packet; also referring to __init__ DEBUG_MODE * Now referring to montecarlo __init__ DEBUG_MODE global * Remove dangling else statement * no longer need plotting in montecarlo_numba base.py * Remove import of function that no longer exists. * No longer holding global variables in montecarlo init * Importing mc_logger for global variables now * Moving log_decorator from base.py * Adding logger to new montecarlo_logger file * Add new logger to, remove print statements from r_packet.py * Ensure that DEBUG_MODE is referenced within the montecarlo_logger file * Allow the function being decorated to take its kwargs. * Apply wraps correctly * Make else block logic more apparent * Get rid of extra blank line * Got rid of a few todos * Add note about why decorator behavior will not change according to config * removing reference to logger in base * Added crude buffer * Increase buffer; check DEBUG_MODE checked during call, not init * Set default buffer in montecarlo logger to stated default * Allow specification of buffer in montecarlo yml * Make sure logger_buffer is passed through to montecarlo logger * Remove todo, question from log_decorator * Adding better docstrings to log_decorator * Add newline at end of montecarlo_logger file * Make logger config happen outside of decorator * Moved print statement to exception; * Added logging to file * No longer profiling calculate_distance_line * Add functionality to profile incomplete packet runs * Rename previous debug mode, as it was not for single packets * Added single packet seed to yml * Propagate single_packet_seed throughout configurations * Reference single packet seed from montecarloconfiguration * Add bool type to single packet seed type * Catch exception better, catch extra random seed * Set whole index, including energies, not just random seed * Change where loop is broken. * Move close_line_threshold check past montecarloexception * Add single-packet debug documentation and script * Add jitclass arg for single packet seed in montecarloconfiguration * Now the default for single_packet_seed cannot be a bool * Added new debug page to developer part of documentation * Now the single_packet_seed has to be not 1, not not False * Pause using log_decorator, remove try/except for nopython * Vpacket jitclass now allows for an int64 index * Exceptions args must be compile-time constants in nopython mode * Allow 0 nu_diff to not throw exception. * v_packets should have the same random seed as their r_packet * Fix MonteCarloException throw * Fix estimator typos * Make sure return is not made before relativity block * Rename esitmators to keep them consistent * Also rename the estimators in montecarlo.pyx * Rename estimators in numba_interface * Clean up estimator typos; change back to njit * Include Doppler factor in energy calculation for full_relativity * Add back not statement * Added relativistic Doppler factor * Add in Doppler factor relativity for interaction * Add angle aberration * add angle aberration to interactions * Update numba version * Remove relativity branching * Logger no longer prints to console if printing to file * Initialize configuration with external module, not jitclass * Remove extra repr of logger.handlers * Ensure the angle aberration is called on vpacket, remove jitclass reference * Convert montecarloconfiguration refs from jitclass to module * Add more references to global module, complete relativistic branching * Pass r_packet.mu to angle aberration calculation * Clarify angle aberration calc, include doppler factor to distance calc * Remove reference to MonteCarloConfiguration * Trying to delete C tests * Remove C montecarlo * Remove references to C module * Alter formal integral tests for python version * Rewrite formal integral in python
- Loading branch information