Skip to content

Commit

Permalink
Formatted series.py
Browse files Browse the repository at this point in the history
  • Loading branch information
80sVectorz authored and 80sVectorz committed Jul 24, 2023
1 parent 07490bb commit 2b613ca
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/pyne_script/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ def __getitem__(
}.items():
if slice_index == None:
indices[index_type] = slice_index
if self.track_history_mode in [1,2]:
if self.track_history_mode in [1, 2]:
values = self.history
elif self.track_history_mode == 0:
values = self.values[
-min(self.window_size, self.head_position[0]) :]
if self.window_size == self.head_position[0]+1:
-min(self.window_size, self.head_position[0]) :
]
if self.window_size == self.head_position[0] + 1:
values = self.values
continue
index_checked = self.index(slice_index, error=True)
Expand All @@ -103,8 +104,9 @@ def __getitem__(
and not overflow_window
):
values = self.values[
-min(self.window_size, self.head_position[0]) :]
if self.window_size == self.head_position[0]+1:
-min(self.window_size, self.head_position[0]) :
]
if self.window_size == self.head_position[0] + 1:
values = self.values
else:
values = self.history
Expand Down Expand Up @@ -337,7 +339,6 @@ def __init__(
key_value_pairs[key][:-1]
)


if self.track_history_mode in [
0,
2,
Expand All @@ -354,9 +355,17 @@ def __init__(
)

if length_ticker > 2:
B = np.pad(np.array(key_value_pairs[key][
-min(window_size+1, length_ticker) : -1]),(max(window_size-(length_ticker-1),0),0),"constant",constant_values=(0))
self.values[series_type][i]+=B # type: ignore
B = np.pad(
np.array(
key_value_pairs[key][
-min(window_size + 1, length_ticker) : -1
]
),
(max(window_size - (length_ticker - 1), 0), 0),
"constant",
constant_values=(0),
)
self.values[series_type][i] += B # type: ignore

if initial_update:
self.update()
Expand Down

0 comments on commit 2b613ca

Please sign in to comment.