Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Shields <[email protected]>
Co-authored-by: Jack O'Brien <[email protected]>
  • Loading branch information
3 people committed Jul 15, 2024
1 parent d70b0e2 commit 55bd472
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 36 deletions.
10 changes: 5 additions & 5 deletions tardis/transport/montecarlo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
montecarlo_globals,
)
from tardis.transport.montecarlo.configuration.base import (
configuration_initialize,
initialize_configuration,
MonteCarloConfiguration,
)
from tardis.transport.montecarlo.estimators.radfield_mc_estimators import (
Expand Down Expand Up @@ -187,9 +187,9 @@ def run(
montecarlo_configuration=self.montecarlo_configuration,
)

transport_state._montecarlo_virtual_luminosity.value[
:
] = v_packets_energy_hist
transport_state._montecarlo_virtual_luminosity.value[:] = (
v_packets_energy_hist
)
transport_state.last_interaction_type = last_interaction_tracker.types
transport_state.last_interaction_in_nu = last_interaction_tracker.in_nus
transport_state.last_line_interaction_in_id = (
Expand Down Expand Up @@ -276,7 +276,7 @@ def from_config(
)

montecarlo_configuration = MonteCarloConfiguration()
configuration_initialize(
initialize_configuration(
montecarlo_configuration, config, enable_virtual_packet_logging
)

Expand Down
29 changes: 16 additions & 13 deletions tardis/transport/montecarlo/configuration/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ def __init__(self):
self.SURVIVAL_PROBABILITY = 0.0
self.VPACKET_TAU_RUSSIAN = 10.0

self.INITIAL_TRACKING_ARRAY_LENGTH = 0
self.INITIAL_TRACKING_ARRAY_LENGTH = 1

self.VPACKET_SPAWN_START_FREQUENCY = 0
self.VPACKET_SPAWN_END_FREQUENCY = 1e200


def configuration_initialize(
def initialize_configuration(
montecarlo_configuration, config, enable_virtual_packet_logging
):
# set globals
if config.plasma.line_interaction_type == "macroatom":
montecarlo_globals.LINE_INTERACTION_TYPE = LineInteractionType.MACROATOM
elif config.plasma.line_interaction_type == "downbranch":
Expand All @@ -59,17 +60,6 @@ def configuration_initialize(
montecarlo_globals.ENABLE_FULL_RELATIVITY = (
config.montecarlo.enable_full_relativity
)
montecarlo_configuration.MONTECARLO_SEED = config.montecarlo.seed
montecarlo_configuration.VPACKET_SPAWN_START_FREQUENCY = (
config.montecarlo.virtual_spectrum_spawn_range.end.to(
u.Hz, equivalencies=u.spectral()
).value
)
montecarlo_configuration.VPACKET_SPAWN_END_FREQUENCY = (
config.montecarlo.virtual_spectrum_spawn_range.start.to(
u.Hz, equivalencies=u.spectral()
).value
)
montecarlo_globals.ENABLE_VPACKET_TRACKING = (
config.spectrum.virtual.virtual_packet_logging
| enable_virtual_packet_logging
Expand All @@ -84,3 +74,16 @@ def configuration_initialize(
montecarlo_globals.DISABLE_LINE_SCATTERING = (
config.plasma.disable_line_scattering
)

# non-globals
montecarlo_configuration.MONTECARLO_SEED = config.montecarlo.seed
montecarlo_configuration.VPACKET_SPAWN_START_FREQUENCY = (
config.montecarlo.virtual_spectrum_spawn_range.end.to(
u.Hz, equivalencies=u.spectral()
).value
)
montecarlo_configuration.VPACKET_SPAWN_END_FREQUENCY = (
config.montecarlo.virtual_spectrum_spawn_range.start.to(
u.Hz, equivalencies=u.spectral()
).value
)
16 changes: 0 additions & 16 deletions tardis/transport/montecarlo/configuration/configuration_handler.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@
ENABLE_RPACKET_TRACKING = False
CONTINUUM_PROCESSES_ENABLED = False
ENABLE_VPACKET_TRACKING = False

RECOMPILE_FLAG = False

0 comments on commit 55bd472

Please sign in to comment.