Skip to content

Commit a2dd24a

Browse files
committed
- Removed unnecessary variable
1 parent 41784f2 commit a2dd24a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

NSE_Option_Chain_Analyzer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def main_win(self) -> None:
864864

865865
self.root.mainloop()
866866

867-
def get_dataframe(self) -> Optional[Tuple[pandas.DataFrame, str, str, float]]:
867+
def get_dataframe(self) -> Optional[Tuple[pandas.DataFrame, str, float]]:
868868
try:
869869
response: Optional[requests.Response]
870870
json_data: Any
@@ -885,7 +885,6 @@ def get_dataframe(self) -> Optional[Tuple[pandas.DataFrame, str, str, float]]:
885885
"CE" in data and str(data['expiryDate'].lower() == str(self.expiry_date).lower())]
886886
pe_values: List[dict] = [data['PE'] for data in json_data['records']['data'] if
887887
"PE" in data and str(data['expiryDate'].lower() == str(self.expiry_date).lower())]
888-
underlying_stock: str = ce_values[0]['underlying']
889888
points: float = pe_values[0]['underlyingValue']
890889
if points == 0:
891890
for item in pe_values:
@@ -916,11 +915,12 @@ def get_dataframe(self) -> Optional[Tuple[pandas.DataFrame, str, str, float]]:
916915
'Ask Quantity', 'Net Change', 'Last Traded Price', 'Implied Volatility',
917916
'Traded Volume', 'Change in Open Interest', 'Open Interest']
918917
current_time: str = df['timestamp']['records']
919-
return merged_inner, current_time, underlying_stock, points
918+
return merged_inner, current_time, points
920919

921920
def set_values(self) -> None:
922921
if self.first_run:
923-
self.root.title(f"NSE-Option-Chain-Analyzer - {self.underlying_stock} - {self.expiry_date} - {self.sp}")
922+
self.root.title(f"NSE-Option-Chain-Analyzer - {self.index if self.option_mode == 'Index' else self.stock} "
923+
f"- {self.expiry_date} - {self.sp}")
924924

925925
self.old_max_call_oi_sp: numpy.float64
926926
self.old_max_call_oi_sp_2: numpy.float64
@@ -1190,9 +1190,8 @@ def main(self) -> None:
11901190
try:
11911191
entire_oc: pandas.DataFrame
11921192
current_time: str
1193-
self.underlying_stock: str
11941193
self.points: float
1195-
entire_oc, current_time, self.underlying_stock, self.points = self.get_dataframe()
1194+
entire_oc, current_time, self.points = self.get_dataframe()
11961195
except TypeError:
11971196
self.root.after((self.seconds * 1000), self.main)
11981197
return

0 commit comments

Comments
 (0)