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

Restructure/separate transport state #2492

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
314cf30
restructure of geometry
wkerzendorf Sep 28, 2023
d353133
add radial1d boundary logic
wkerzendorf Oct 4, 2023
2475551
black format
wkerzendorf Oct 4, 2023
e6d1697
several fixes
wkerzendorf Oct 4, 2023
3c53cda
fix epsilon
wkerzendorf Oct 4, 2023
6dce2b4
add testing of boundaries
wkerzendorf Oct 4, 2023
1fdcea8
change the r_inner_active
wkerzendorf Oct 4, 2023
56e9da5
first integration with `from_config` working
wkerzendorf Oct 7, 2023
f6743d7
hunting down density indexing bug
wkerzendorf Oct 8, 2023
b55b21d
all model tests (without csvy) pass
wkerzendorf Oct 8, 2023
ed978d9
more fixes
wkerzendorf Oct 9, 2023
cae9c19
fix of model to simulation_state
wkerzendorf Oct 9, 2023
d829e73
fix inner boundary packet error
wkerzendorf Oct 9, 2023
9592a97
fix some leftovers
wkerzendorf Oct 10, 2023
4da6869
final fix for csvy
wkerzendorf Oct 10, 2023
f381d2e
blackify
wkerzendorf Oct 10, 2023
e59741d
restructure to readers and remove some leftover code
wkerzendorf Oct 11, 2023
a42dd55
further cleanup
wkerzendorf Oct 11, 2023
3288c6c
first start of the restructure
wkerzendorf Oct 11, 2023
518a8f9
add comment about removing quantitiness
wkerzendorf Oct 11, 2023
c78b6de
add velocity check
wkerzendorf Oct 11, 2023
006ca9d
add new abundance functions
wkerzendorf Oct 12, 2023
9c680a8
remove default units
wkerzendorf Oct 12, 2023
268bd23
add new matter module
wkerzendorf Oct 12, 2023
6b03e93
several restructures. move decay from io to tardis/model/matter
wkerzendorf Oct 12, 2023
3114413
mid restructure
wkerzendorf Oct 13, 2023
217dcf2
slow progress on abundance refactor
wkerzendorf Oct 16, 2023
78055b4
include effective_element_masses
wkerzendorf Oct 22, 2023
73f5175
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Oct 22, 2023
b96d717
further updates
wkerzendorf Nov 2, 2023
08ea21d
fix of csvy readers
wkerzendorf Nov 2, 2023
f0fc7c2
last fixes to custom abundance widget
wkerzendorf Nov 4, 2023
fe7c415
restructuring the radiation field
wkerzendorf Nov 5, 2023
226fb57
some cleanup
wkerzendorf Nov 5, 2023
cbd025e
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Nov 5, 2023
afb9613
cleanup
wkerzendorf Nov 5, 2023
daf12a5
further cleanup
wkerzendorf Nov 5, 2023
f2d26a8
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Nov 5, 2023
7575512
clearnup
wkerzendorf Nov 5, 2023
dc34343
changes
wkerzendorf Nov 6, 2023
37d36e1
remove matter base.py
wkerzendorf Nov 8, 2023
4a77a4a
removing matter
wkerzendorf Nov 8, 2023
dbd47cc
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Nov 8, 2023
d1792bf
fixed last tests
wkerzendorf Nov 20, 2023
c757848
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Nov 20, 2023
1f42760
first commit for regression_data
wkerzendorf Nov 20, 2023
5b1c7b2
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Nov 20, 2023
398631a
add several parsers
wkerzendorf Nov 20, 2023
ed60c0f
add composition
wkerzendorf Nov 20, 2023
8723fdf
remove isotopemassfractions
wkerzendorf Nov 20, 2023
08874ca
some small fixes
wkerzendorf Nov 20, 2023
d89b957
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Nov 20, 2023
1da7ed0
fixed w, t_rad to dilution_factor, t_radiative
wkerzendorf Nov 20, 2023
9f28ecd
add setters for w, t_rad
wkerzendorf Nov 20, 2023
0d85540
several fixes for instantiating the right t_rads.
wkerzendorf Nov 21, 2023
7161791
add the from_config atom_data
wkerzendorf Nov 21, 2023
4f4aad6
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Nov 21, 2023
f65a2d7
fixing model.ipynb
wkerzendorf Nov 21, 2023
cbfe685
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Nov 21, 2023
b961734
fix some more tests
wkerzendorf Nov 21, 2023
63a86fb
start of montecarlo restructure
wkerzendorf Nov 21, 2023
1d46d45
large scale changes
wkerzendorf Nov 22, 2023
9a21714
further disentangling state and solver
wkerzendorf Nov 23, 2023
1c38607
fix tests
wkerzendorf Nov 23, 2023
c99e9d4
fix some of the issues wdigets
wkerzendorf Nov 23, 2023
4c0b49a
assert mass fractions positive.
wkerzendorf Nov 23, 2023
7474e66
update estimators
wkerzendorf Nov 23, 2023
6735fad
add packet collection
wkerzendorf Nov 23, 2023
2135c5a
move spectrum to mct_state
wkerzendorf Nov 23, 2023
8e0de5c
add radiation_field_state
wkerzendorf Nov 23, 2023
ba9cdf6
Merge branch 'restructure/radiation_field' into restructure/transport…
wkerzendorf Nov 23, 2023
8fd5633
Refactor packet initialization in
wkerzendorf Nov 24, 2023
305e89d
Update model_nparray_attrs in test_base.py and fix
wkerzendorf Nov 24, 2023
de63d0f
Fix temperature assertion in
wkerzendorf Nov 24, 2023
0f4608a
Fix Integrator
wkerzendorf Nov 26, 2023
098cc76
Fix SDEC plot for MCTState
wkerzendorf Nov 26, 2023
455a820
Fix variable names in transport module
wkerzendorf Nov 26, 2023
9de8b34
Refactor the to_hdf code.
wkerzendorf Nov 27, 2023
5159c30
Refactor Monte Carlo transport solver
wkerzendorf Nov 27, 2023
fcd34bb
Fix isotope mass fraction typo and t_radiatve duplicate definition
wkerzendorf Nov 27, 2023
1e3a035
Document remove functionality for effective element masses
wkerzendorf Nov 27, 2023
af1f114
Fix variable name in
wkerzendorf Nov 27, 2023
203bae0
Refactor test names and variable names in
wkerzendorf Nov 27, 2023
56aaa8c
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Nov 27, 2023
1f419b6
restructuring montecarlo state
wkerzendorf Nov 28, 2023
2a50667
Refactor gamma ray simulation setup and test
wkerzendorf Nov 29, 2023
b17b7c7
fix gamma ray tests
wkerzendorf Nov 29, 2023
a479cf6
Add model_isotope_time_0 property to abundances
wkerzendorf Nov 29, 2023
6d64b2d
Add test for montecarlo main loop with vpacket
wkerzendorf Nov 29, 2023
b92158d
Refactor config_reader and config_validator
wkerzendorf Nov 29, 2023
e56ddcc
Fix model_isotope_time_0 property in
wkerzendorf Nov 29, 2023
29fa091
Refactor simulation module to use pathlib
wkerzendorf Nov 29, 2023
8dff14e
remove bad comment and refactor with ruff
wkerzendorf Nov 29, 2023
fcb5dba
Fix variable name in test_simulation_state_mass()
wkerzendorf Nov 29, 2023
7da18f3
Fix unit conversion in calculate_cell_masses
wkerzendorf Nov 29, 2023
1bb7266
Fix logger debug message in CSV reader and update
wkerzendorf Nov 29, 2023
821f4ce
black formatting
wkerzendorf Nov 29, 2023
2257093
Refactor code to use composition variable in
wkerzendorf Nov 29, 2023
e105e71
Merge remote-tracking branch 'upstream/master' into restructure/abund…
wkerzendorf Nov 30, 2023
75840d3
Refactor imports in atom_web_download.py and
wkerzendorf Nov 30, 2023
59d5eff
fix for documentation not builiding
wkerzendorf Dec 4, 2023
1f65771
add fix for model_isotope_time_0
wkerzendorf Dec 4, 2023
dd6ba4f
fix grid test
wkerzendorf Dec 4, 2023
5391968
restructure the grid
wkerzendorf Dec 4, 2023
9706437
final change
wkerzendorf Dec 4, 2023
512d737
Merge branch 'restructure/abundance' into restructure/radiation_field
wkerzendorf Dec 4, 2023
c6d3a59
add stuff
wkerzendorf Dec 4, 2023
d9a191c
add vpacket_log
wkerzendorf Dec 4, 2023
ee4e6c6
transfer over to VPacketCollection constructor
wkerzendorf Dec 4, 2023
b31561e
Refactor model_reader.py and shell_info.py
wkerzendorf Dec 4, 2023
f438ec3
Update damping constants and variable names
wkerzendorf Dec 4, 2023
e7acaac
Refactor vpacket tracking in montecarlo_radial1d
wkerzendorf Dec 4, 2023
ef8cf30
fix w in several places in tardis
wkerzendorf Dec 4, 2023
361e0b7
slowly fixing radiation_field changes
wkerzendorf Dec 4, 2023
bfcf19a
fixing montecarlo tests
wkerzendorf Dec 4, 2023
d5cb35d
Merge remote-tracking branch 'origin/restructure/radiation_field' int…
wkerzendorf Dec 4, 2023
ca4b267
slowly fixing vpacket_tracker
wkerzendorf Dec 4, 2023
6244535
last fix
wkerzendorf Dec 4, 2023
3c8f3da
change hdf from model to simulation_state
wkerzendorf Dec 4, 2023
815b0d8
fixing model->simulation-state
wkerzendorf Dec 4, 2023
5925f6e
Merge remote-tracking branch 'upstream/master' into restructure/radia…
wkerzendorf Dec 4, 2023
81ebd21
Fix model_reader.py imports and formatting issues
wkerzendorf Dec 4, 2023
e24f1fa
Refactor variable names for clarity and
wkerzendorf Dec 4, 2023
50d3ec3
Update variable names in model.ipynb
wkerzendorf Dec 4, 2023
566d279
Update variable name for average temperature
wkerzendorf Dec 4, 2023
f068e64
Merge branch 'restructure/radiation_field' into restructure/transport…
wkerzendorf Dec 5, 2023
86a4974
Fix file paths in test_grid.py, test_base.py,
wkerzendorf Dec 5, 2023
145a9fc
Fix transport dictionary comparison
wkerzendorf Dec 5, 2023
871b849
Merge branch 'restructure/radiation_field' into tests/regression_data
wkerzendorf Dec 7, 2023
eb0e055
Implement regression data configurations
wkerzendorf Dec 9, 2023
d0c26dd
Refactor snapshot fixtures and add regression data
wkerzendorf Dec 9, 2023
67236a4
Update to new testing framework
wkerzendorf Dec 10, 2023
5e04422
Merge remote-tracking branch 'origin/restructure/radiation_field' int…
wkerzendorf Dec 10, 2023
e18bfe0
Refactor imports and fixtures in conftest.py and
wkerzendorf Dec 10, 2023
a68a006
Make regression-data optional
wkerzendorf Dec 10, 2023
f219356
Fix regression data synchronization in plasma
wkerzendorf Dec 10, 2023
a949f49
Refactor variable names in model reader and
wkerzendorf Dec 10, 2023
56a948d
Refactor store_model_to_hdf to
wkerzendorf Dec 10, 2023
2e6caac
Refactor HDF file handling and model reader
wkerzendorf Dec 11, 2023
1cc8004
add docstr
wkerzendorf Dec 11, 2023
e5dedcc
Merge branch 'restructure/radiation_field' into tests/regression_data
wkerzendorf Dec 11, 2023
537e7d3
Merge branch 'tests/regression_data' into restructure/transport_solver
wkerzendorf Dec 11, 2023
051a62b
Merge branch 'restructure/transport_solver' into restructure/separate…
wkerzendorf Dec 11, 2023
0044907
Merge remote-tracking branch 'upstream/master' into tests/regression_…
wkerzendorf Dec 11, 2023
f1151c3
Remove syrupy_extensions.py
wkerzendorf Dec 11, 2023
c85d64e
Refactor code and remove unused imports and
wkerzendorf Dec 14, 2023
dc1cffe
Merge remote-tracking branch 'upstream/master' into restructure/trans…
wkerzendorf Dec 15, 2023
5a902a4
Fix test_base and test_simulation
wkerzendorf Dec 15, 2023
a7c1c1e
Merge branch 'restructure/transport_solver' into restructure/separate…
wkerzendorf Dec 15, 2023
b0e6eac
setting up regression with github actions
wkerzendorf Dec 15, 2023
6cc25b7
Update LFS cache IDs for refdata and regression
wkerzendorf Dec 16, 2023
ccf0a99
Fix test_montecarlo_radial1d function
wkerzendorf Dec 16, 2023
71f1317
Update sync_hdf_store method in RegressionData class
wkerzendorf Dec 16, 2023
0a1ae4a
Refactor test_base.py for improved accuracy and precision
wkerzendorf Dec 16, 2023
74cf7a2
update docstrings
wkerzendorf Dec 16, 2023
173b0f0
Merge branch 'tests/regression_data' into restructure/transport_solver
wkerzendorf Dec 16, 2023
57d4055
Refactor transport state access in test_base.py
wkerzendorf Dec 20, 2023
fb09b33
Fix warnings and add HDF output in sdec_plot.ipynb and cleanup regres…
wkerzendorf Dec 20, 2023
3e86d61
Update demo.hdf file
wkerzendorf Dec 21, 2023
c9c9ee0
Fix negative values in last_interaction_types
wkerzendorf Dec 24, 2023
69e85cf
Update URL for atomic data repository
wkerzendorf Dec 24, 2023
8c7759a
Refactor code for improved readability and maintainability
wkerzendorf Dec 24, 2023
a0a23a0
Refactor code to remove unnecessary array conversion
wkerzendorf Dec 24, 2023
5ff5432
Refactor code to remove unnecessary conversion to numpy array in test…
wkerzendorf Dec 24, 2023
16afba3
Merge branch 'tests/regression_data' into restructure/transport_solver
wkerzendorf Dec 24, 2023
e541eb2
Merge branch 'restructure/transport_solver' into restructure/separate…
wkerzendorf Dec 24, 2023
829d609
Refactor vpacket tracking in montecarlo_main_loop
wkerzendorf Dec 26, 2023
a49c259
Update packet_collection and vpacket_tracker
wkerzendorf Dec 29, 2023
45eb023
fixup of code
wkerzendorf Dec 30, 2023
0c36b9b
Add packet functionality to VPacketCollection
wkerzendorf Dec 30, 2023
c1137e0
ruffify test_sdec_plot
wkerzendorf Dec 30, 2023
97683a8
Remove unused import in parse_input.py
wkerzendorf Jan 6, 2024
0cceb79
Update VPACKET_TAU_RUSSIAN constant
wkerzendorf Jan 6, 2024
ca18310
Refactor montecarlo_main_loop and FormalIntegrator classes
wkerzendorf Jan 6, 2024
1363d65
Merge branch 'master' into pr/wkerzendorf/2492
andrewfullard Jan 17, 2024
2a0fb9b
Fixes most tests
andrewfullard Jan 18, 2024
f3bd12f
Removes old montecarlo_state file added in merge
andrewfullard Jan 18, 2024
d7307f5
Fixes docs build
andrewfullard Jan 18, 2024
a6cfa3d
Fix virtual packet tracking for main loop
andrewfullard Jan 19, 2024
559e279
Restructure vpacket log storage
andrewfullard Jan 22, 2024
0d3f48d
Remove some data from testing
andrewfullard Jan 22, 2024
b9b1772
Applied black formatting
andrewfullard Jan 22, 2024
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
26 changes: 13 additions & 13 deletions docs/io/output/rpacket_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(sim.transport.rpacket_tracker)"
"type(sim.transport.transport_state.rpacket_tracker)"
]
},
{
Expand Down Expand Up @@ -243,7 +243,7 @@
"metadata": {},
"outputs": [],
"source": [
"len(sim.transport.rpacket_tracker)"
"len(sim.transport.transport_state.rpacket_tracker)"
]
},
{
Expand Down Expand Up @@ -281,7 +281,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker[10].index"
"sim.transport.transport_state.rpacket_tracker[10].index"
]
},
{
Expand All @@ -300,7 +300,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker[10].seed"
"sim.transport.transport_state.rpacket_tracker[10].seed"
]
},
{
Expand All @@ -319,7 +319,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker[10].status"
"sim.transport.transport_state.rpacket_tracker[10].status"
]
},
{
Expand Down Expand Up @@ -347,7 +347,7 @@
"metadata": {},
"outputs": [],
"source": [
"len(sim.transport.rpacket_tracker[10].shell_id)"
"len(sim.transport.transport_state.rpacket_tracker[10].shell_id)"
]
},
{
Expand Down Expand Up @@ -403,7 +403,7 @@
"metadata": {},
"outputs": [],
"source": [
"type(sim.transport.rpacket_tracker_df)"
"type(sim.transport.transport_state.rpacket_tracker_df)"
]
},
{
Expand Down Expand Up @@ -461,7 +461,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker_df"
"sim.transport.transport_state.rpacket_tracker_df"
]
},
{
Expand Down Expand Up @@ -490,7 +490,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker_df.loc[10]"
"sim.transport.transport_state.rpacket_tracker_df.loc[10]"
]
},
{
Expand All @@ -509,7 +509,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker_df.loc[10][\"energy\"]"
"sim.transport.transport_state.rpacket_tracker_df.loc[10][\"energy\"]"
]
},
{
Expand All @@ -528,7 +528,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker_df.loc[10,5][\"energy\"]"
"sim.transport.transport_state.rpacket_tracker_df.loc[10,5][\"energy\"]"
]
},
{
Expand All @@ -538,7 +538,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.transport.rpacket_tracker_df.loc[10][\"energy\"][5]"
"sim.transport.transport_state.rpacket_tracker_df.loc[10][\"energy\"][5]"
]
},
{
Expand Down Expand Up @@ -567,7 +567,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.11.5"
},
"vscode": {
"interpreter": {
Expand Down
10 changes: 5 additions & 5 deletions docs/io/visualization/montecarlo_packet_visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"outputs": [],
"source": [
"# accessing the rpacket_tracker dataframe\n",
"sim.transport.rpacket_tracker_df"
"sim.transport.transport_state.rpacket_tracker_df"
]
},
{
Expand Down Expand Up @@ -191,11 +191,11 @@
"source": [
"# function for getting coordinates of all packets\n",
"def get_coordinates_multiple_packets_ints(r_packet_tracker,time):\n",
" thetas = np.linspace(0, 2*math.pi,sim.transport.rpacket_tracker_df.index[-1][0]+2)\n",
" thetas = np.linspace(0, 2*math.pi,sim.transport.transport_state.rpacket_tracker_df.index[-1][0]+2)\n",
" x = []\n",
" y = []\n",
" inters = []\n",
" for i in range(sim.transport.rpacket_tracker_df.index[-1][0]+1):\n",
" for i in range(sim.transport.transport_state.rpacket_tracker_df.index[-1][0]+1):\n",
" xs,ys,ints = get_x_y_ints_with_theta_init(r_packet_tracker.loc[i][\"r\"],r_packet_tracker.loc[i][\"mu\"],time,r_packet_tracker.loc[i][\"interaction_type\"],'n',thetas[i])\n",
" x.append(xs)\n",
" y.append(ys)\n",
Expand Down Expand Up @@ -236,7 +236,7 @@
"# animated plot\n",
"\n",
"v_shells = sim.simulation_state.radius.value * 1e-5 / sim.simulation_state.time_explosion.value\n",
"xs,ys,ints = get_coordinates_multiple_packets_ints(sim.transport.rpacket_tracker_df,sim.simulation_state.time_explosion.value)\n",
"xs,ys,ints = get_coordinates_multiple_packets_ints(sim.transport.transport_state.rpacket_tracker_df,sim.simulation_state.time_explosion.value)\n",
"xs,ys,ints,max_size = get_equal_array_size(xs,ys,ints)\n",
"\n",
"fig = go.Figure()\n",
Expand Down Expand Up @@ -273,7 +273,7 @@
"\n",
"#Add the packet trajectory\n",
"\n",
"df = sim.transport.rpacket_tracker_df\n",
"df = sim.transport.transport_state.rpacket_tracker_df\n",
"interaction_from_num = {0: \"No Interaction\", 1: \"EScattering\", 2: \"Line\"}\n",
"interaction_color_from_num = {0: \"darkslategrey\", 1: \"#3366FF\", 2: \"#FF3300\"}\n",
"interaction_opacity_from_num = {0: 0, 1: 1, 2: 1}\n",
Expand Down
21 changes: 11 additions & 10 deletions tardis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
"""

import re
import os

from astropy import units as u
from tardis import constants
import numpy as np
import pandas as pd
from astropy import units as u

from tardis import constants

INVALID_ION_ERROR_MSG = "Atomic number, ion_number pair not present in model"


class LastLineInteraction(object):
class LastLineInteraction:
@classmethod
def from_simulation(cls, simulation, packet_filter_mode="packet_out_nu"):
transport_state = simulation.transport.transport_state
return cls(
simulation.transport.last_line_interaction_in_id,
simulation.transport.last_line_interaction_out_id,
simulation.transport.last_line_interaction_shell_id,
simulation.transport.transport_state.packet_collection.output_nus,
simulation.transport.last_interaction_in_nu,
transport_state.last_line_interaction_in_id,
transport_state.last_line_interaction_out_id,
transport_state.last_line_interaction_shell_id,
transport_state.packet_collection.output_nus,
transport_state.last_interaction_in_nu,
simulation.plasma.atomic_data.lines,
packet_filter_mode,
)
Expand Down Expand Up @@ -260,7 +261,7 @@ def onpress(event):
fig.canvas.mpl_connect("on_press", onpress)


class TARDISHistory(object):
class TARDISHistory:
"""
Records the history of the model
"""
Expand Down
11 changes: 11 additions & 0 deletions tardis/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,14 @@ def simulation_verysimple(config_verysimple, atomic_dataset):
sim = Simulation.from_config(config_verysimple, atom_data=atomic_data)
sim.iterate(4000)
return sim


@pytest.fixture(scope="session")
def simulation_verysimple_vpacket_tracking(config_verysimple, atomic_dataset):
atomic_data = deepcopy(atomic_dataset)
sim = Simulation.from_config(
config_verysimple, atom_data=atomic_data, virtual_packet_logging=True
)
sim.last_no_of_packets = 4000
sim.run_final()
return sim
3 changes: 3 additions & 0 deletions tardis/grid/tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import pandas as pd

import tardis

from pathlib import Path
import tardis.grid as grid


DATA_PATH = Path(tardis.__path__[0]) / "grid" / "tests" / "data"


Expand Down
8 changes: 8 additions & 0 deletions tardis/model/parse_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@
ValueError
If both t_inner and luminosity_requested are None.
"""
if config.montecarlo.enable_full_relativity:
packet_source = BlackBodySimpleSourceRelativistic(

Check warning on line 602 in tardis/model/parse_input.py

View check run for this annotation

Codecov / codecov/patch

tardis/model/parse_input.py#L602

Added line #L602 was not covered by tests
base_seed=config.montecarlo.seed,
time_explosion=config.supernova.time_explosion,
)
else:
packet_source = BlackBodySimpleSource(base_seed=config.montecarlo.seed)

luminosity_requested = config.supernova.luminosity_requested
if config.plasma.initial_t_inner > 0.0 * u.K:
packet_source.radius = geometry.r_inner[0]
Expand Down
Loading
Loading