Skip to content

Commit

Permalink
Minor edits (#166)
Browse files Browse the repository at this point in the history
* fix : .keys() removed

* fix : autpep8 scripts updated

* fix : setup.py author section updated

* fix : minor edit in helper.py
  • Loading branch information
sepandhaghighi authored Dec 20, 2023
1 parent 9cb8af6 commit b3c6c09
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions autopep8.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python -m autopep8 gopem --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 rsrc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 gopem --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
python -m autopep8 rsrc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
6 changes: 3 additions & 3 deletions autopep8.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
python -m autopep8 gopem --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 rsrc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --verbose
python -m autopep8 gopem --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
python -m autopep8 setup.py --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
python -m autopep8 rsrc --recursive --aggressive --aggressive --in-place --pep8-passes 2000 --max-line-length 120 --verbose
4 changes: 2 additions & 2 deletions gopem/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@
"Vline": "|",
"Hline": "_",
"None": ""}
MarkerList = list(sorted(MarkerTable.keys()))
MarkerList = sorted(MarkerTable)
MarkerList.insert(0, MarkerList.pop(MarkerList.index("None")))

StyleTable = {"Solid": "-", "Dashed": "--", "Dash-Dot": "-.", "Dotted": ":"}
StyleList = list(sorted(StyleTable.keys()))
StyleList = sorted(StyleTable)
StyleList.insert(0, StyleList.pop(StyleList.index("Solid")))

ScaleList = ["Linear", "Log"]
Expand Down
18 changes: 9 additions & 9 deletions gopem/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def __init__(self):
"Padulles_Hauer Analysis (Dynamic)": Padulles_Hauer_Analysis,
"Padulles_Amphlett Analysis (Dynamic)": Padulles_Amphlett_Analysis,
"Chakraborty_Analysis (Dynamic)": Chakraborty_Analysis}
self.menuKey = list(self.menu.keys())
self.menuKey = list(self.menu)
self.menuKey.sort()
self.super = QHBoxLayout()
self.main = QVBoxLayout()

self.initial_modes(self.menu.keys())
self.initial_modes(self.menu)
for mode in self.mode:
mode.setVisible(False)
self.mode[0].setVisible(True)
Expand Down Expand Up @@ -163,7 +163,7 @@ def plot_bar_config(self, ratio=0.1):
for size in gopem.helper.FontSizeList:
self.font_title.addItem(str(size))
self.font_axes.addItem(str(size))
for item in self.default_setting.keys():
for item in self.default_setting:
item.setCurrentText(str(self.default_setting[item]))
min_width = int(self.min_width * ratio)
self.x_ax.setMinimumWidth(min_width)
Expand Down Expand Up @@ -429,7 +429,7 @@ def get_attr_fields(self, mode):
input_param = gopem.helper.InputParam[self.menuKey[mode]]
name = self.menuKey[mode]
self.attributes[name] = {}
inputs_list = list(input_param.keys())
inputs_list = list(input_param)
for item in sorted(inputs_list):
field = QHBoxLayout()
label = QLabel(item + ' ( ' + input_param[item] + ' ) : ')
Expand All @@ -451,7 +451,7 @@ def reset_slt(self):
:return: None
"""
for k in self.attributes[self.menuKey[self.selectedMode]].keys():
for k in self.attributes[self.menuKey[self.selectedMode]]:
self.attributes[self.menuKey[self.selectedMode]][k].setValue(0.0)
self.reportChkBox.setChecked(False)
self.test_checkbox.setChecked(False)
Expand All @@ -474,7 +474,7 @@ def output_update(self, output):
self.output = output
self.x_ax.clear()
self.y_ax.clear()
for k in output.keys():
for k in output:
if isinstance(output[k], list):
self.x_ax.addItem(str(k))
self.y_ax.addItem(str(k))
Expand All @@ -497,7 +497,7 @@ def analyze(self, menu, attributes):

name = self.menuKey[self.selectedMode]
input_attr = {"Name": name}
for k in self.attributes[name].keys():
for k in self.attributes[name]:
input_attr[k] = self.attributes[name][k].value()
if report_flag:
options = QFileDialog.Options()
Expand Down Expand Up @@ -619,8 +619,8 @@ def test_slt(self, state):
"""
if state == 2:
name = self.menuKey[self.selectedMode]
for k in self.attributes[name].keys():
if k in Vectors[name].keys():
for k in self.attributes[name]:
if k in Vectors[name]:
self.attributes[name][k].setValue(Vectors[name][k])

def axis_changed(self):
Expand Down
6 changes: 3 additions & 3 deletions gopem/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def update_plot(
"""
self.axes.cla()
self.axes.grid(True, linestyle='-.', which='both')
if x_axis in data.keys() and y_axis in data.keys():
if x_axis in data and y_axis in data:
x_unit = ""
y_unit = ""
title = ""
Expand All @@ -74,11 +74,11 @@ def update_plot(
marker=marker,
linestyle=style,
linewidth=linewidth)
if y_axis in gopem.helper.UnitTable.keys():
if y_axis in gopem.helper.UnitTable:
title += gopem.helper.UnitTable[y_axis][0] + "~"
if gopem.helper.UnitTable[y_axis][1] is not None:
y_unit = "({0})".format(gopem.helper.UnitTable[y_axis][1])
if x_axis in gopem.helper.UnitTable.keys():
if x_axis in gopem.helper.UnitTable:
if title:
title += gopem.helper.UnitTable[x_axis][0]
self.axes.set_title(title, fontsize=font_title)
Expand Down
4 changes: 2 additions & 2 deletions rsrc/version_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"GOPEM.iss": INNO_ITEMS,
"GOPEM.spec": SPEC_ITEMS}

TEST_NUMBER = len(FILES.keys()) + 1
TEST_NUMBER = len(FILES) + 1


def print_result(failed=False):
Expand All @@ -65,7 +65,7 @@ def print_result(failed=False):


if __name__ == "__main__":
for file_name in FILES.keys():
for file_name in FILES:
try:
file_content = codecs.open(
file_name, "r", "utf-8", 'ignore').read()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def read_description():
description='GOPEM is a graphical user interface of OPEM',
long_description=read_description(),
long_description_content_type='text/markdown',
author='Mohammad Mahdi Rahimi,Sepand Haghighi,Kasra Askari,Sarmin Hamidi',
author='ECSIM Development Team',
author_email='[email protected]',
url='https://github.com/ecsim/gopem',
download_url='https://github.com/ecsim/gopem/tarball/v0.7',
Expand Down

0 comments on commit b3c6c09

Please sign in to comment.