-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Debugging relativity on numba_montecarlo #1136
Debugging relativity on numba_montecarlo #1136
Conversation
…emoved kwarg in MonteCarloConfiguration
…ace_vpacket, so that relativity attribute continues to get passed down
…on get called with this arg
…ancies between numba branch and master branch
I noticed that |
@harpolea This is just for debugging reasons — in |
…nsavel/tardis into relativity_numba_montecarlo
* 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
Description
I'm working to fix the relativity functionality on the numba_montecarlo branch.
montecarlo_configuration
arguments to function callsMonteCarloConfiguration
, as numba jitclass does not currently support kwargs.enable_full_relativity
is false.Motivation and Context
Full relativity currently isn't working on the numba_montecarlo branch, preventing it from being merged with master.
How Has This Been Tested?
Advanced unit tests are currently failing due to. I can write tests after I address these failings to ensure that the relativity portion runs as expected. No new bugs seem to be introduced.
Screenshots (if appropriate):
I can add screenshots if desired.
Types of changes
Checklist: