Skip to content

Commit

Permalink
Added docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodot- committed Jul 29, 2024
1 parent 76a2602 commit 54cf624
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tardis/transport/montecarlo/numba_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ def __init__(
self.k_packet_idx = k_packet_idx

def __getitem__(self, i):
"""Get a shell or slice of shells of the attributes of the opacity state
Args:
i (int, slice): shell index or slice
Returns:
OpacityState a shallow copy of the current instance
"""
return OpacityState(
self.electron_density[i],
self.t_electrons[i],
Expand All @@ -135,7 +143,8 @@ def __getitem__(self, i):
self.ff_opacity_factor,
self.emissivities,
self.photo_ion_activation_idx,
self.k_packet_idx,)
self.k_packet_idx,
)

def slice(self, i, j):
return OpacityState(
Expand All @@ -160,7 +169,8 @@ def slice(self, i, j):
self.ff_opacity_factor,
self.emissivities,
self.photo_ion_activation_idx,
self.k_packet_idx,)
self.k_packet_idx,
)


def opacity_state_initialize(
Expand Down

0 comments on commit 54cf624

Please sign in to comment.