Skip to content

Commit

Permalink
Doc changes for RPacketTracker (#2795)
Browse files Browse the repository at this point in the history
* Doc changes

* Remove Output

* Fix TYpo

* Changed doc without any change to meta data
  • Loading branch information
Sumit112192 authored Aug 23, 2024
1 parent 8d79980 commit 13b87ce
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/io/output/how_to_rpacket_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"id": "c103617c",
"metadata": {},
"source": [
"**TARDIS** has the functionality to track the properties of the *RPackets* that are generated when running the Simulation. The `rpacket_tracker` can track all the interactions a packet undergoes & thus keeps a track of the various properties, a packet may have.<br>Currently, the `rpacket_tracker` tracks the properties of all the rpackets in the *Last Iteration of the Simulation*. It generates a `List` that contains the individual instances of `RPacketCollection`{`Numba JITClass`}, for storing all the interaction properties as listed below."
"**TARDIS** has the functionality to track the properties of the *RPackets* that are generated when running the Simulation. The `rpacket_tracker` can track all the interactions a packet undergoes & thus keeps a track of the various properties, a packet may have.<br>Currently, the `rpacket_tracker` tracks the properties of all the rpackets in the *Last Iteration of the Simulation*. It generates a `List` that contains the individual instances of `RPacketTracker`{`Numba JITClass`}, for storing all the interaction properties as listed below."
]
},
{
Expand All @@ -37,6 +37,7 @@
" <li><b>energy</b> - Energy of the Packet</li>\n",
" <li><b>shell_id</b> - Current Shell Id where the Packet is present</li>\n",
" <li><b>interaction_type</b> - Last Interaction type of the packet</li>\n",
" <li><b>boundary_interaction</b> - Boundary interactions data in the format <b>(event_id, current_shell_id, next_shell_id)</b> of the packet</li>\n",
" </ol>\n",
" </body>\n",
"</html>"
Expand Down Expand Up @@ -192,7 +193,7 @@
"id": "532bfafc",
"metadata": {},
"source": [
"Now, the `tracked` properties can be accessed via the `rpacket_tracker` attribute of the `sim.transport` object. "
"Now, the `tracked` properties can be accessed via the `rpacket_tracker` attribute of the `sim.transport.transport_state` object. "
]
},
{
Expand All @@ -211,7 +212,7 @@
"id": "4771d92a",
"metadata": {},
"source": [
"It can be seen from the above code, that the `sim.transport.rpacket_tracker` is an instance of the `List` specifically *Numba Typed List*. The `RPacketCollection` class has the following structure for the properties : {More information in the **TARDIS API** for `RPacketCollection` class}"
"It can be seen from the above code, that the `sim.transport.transport_state.rpacket_tracker` is an instance of the `List` specifically *Numba Typed List*. The `RPacketTracker` class has the following structure for the properties : {More information in the **TARDIS API** for `RPacketTracker` class}"
]
},
{
Expand All @@ -221,8 +222,8 @@
"metadata": {},
"source": [
"```python\n",
"# Basic structure for the RPacketCollection Class\n",
"class RPacketCollection:\n",
"# Basic structure for the RPacketTracker Class\n",
"class RPacketTracker:\n",
" # Properties\n",
" index\n",
" seed\n",
Expand All @@ -233,6 +234,7 @@
" energy\n",
" shell_id\n",
" interaction_type\n",
" boundary_interaction\n",
"```"
]
},
Expand Down Expand Up @@ -328,7 +330,7 @@
"id": "ea308a55",
"metadata": {},
"source": [
"Thus, all other properties (`r`, `nu`, `mu`, `energy`, `shell_id`,`interaction_type`) can be accessed accordingly."
"Thus, all other properties (`r`, `nu`, `mu`, `energy`, `shell_id`,`interaction_type`, `boundary_interaction`) can be accessed accordingly."
]
},
{
Expand Down Expand Up @@ -360,7 +362,7 @@
"\n",
"Warning\n",
"\n",
"If we try to access `sim.transport.rpacket_tracker` property when we have the `track_rpacket` property in the `tracking` subsection of `montecarlo` config, turned off as follows `config[\"montecarlo\"][\"tracking\"][\"track_rpacket\"] = False`, it will return `None`. Error will be raised if we try to access the properties i.e. `seed`, `index`, etc.\n",
"If we try to access `sim.transport.transport_state.rpacket_tracker` property when we have the `track_rpacket` property in the `tracking` subsection of `montecarlo` config, turned off as follows `config[\"montecarlo\"][\"tracking\"][\"track_rpacket\"] = False`, it will return `None`. Error will be raised if we try to access the properties i.e. `seed`, `index`, etc.\n",
"</div>"
]
},
Expand All @@ -374,7 +376,7 @@
"\n",
"Note\n",
" \n",
"When we initialise the `RPacketCollection()` class, the properties arrays {`index`, `seed`, `status`, etc} are allocated certain length based on the `initial_array_length` parameter that can be set via the `initial_array_length` property under `montecarlo -> tracking` section of the configuration. The default size of the array is `10`. This variable is important as the number of interactions a packet may have is variable, thus we need to allocate space dynamically. This variable is used to compute the size and expand the array such that the properties are able to hold these values for the packet interaction. Higher number, allocates more space initially leading to lesser times the arrays expands and vice versa. It can be set in the following manner `config[\"montecarlo\"][\"tracking\"][\"initial_array_length\"] = {value}`.\n",
"When we initialise the `RPacketTracker()` class, the properties arrays {`index`, `seed`, `status`, etc} are allocated certain length based on the `initial_array_length` parameter that can be set via the `initial_array_length` property under `montecarlo -> tracking` section of the configuration. The default size of the array is `10`. This variable is important as the number of interactions a packet may have is variable, thus we need to allocate space dynamically. This variable is used to compute the size and expand the array such that the properties are able to hold these values for the packet interaction. Higher number, allocates more space initially leading to lesser times the arrays expands and vice versa. It can be set in the following manner `config[\"montecarlo\"][\"tracking\"][\"initial_array_length\"] = {value}`.\n",
"</div>"
]
},
Expand Down

0 comments on commit 13b87ce

Please sign in to comment.