Skip to content

Commit

Permalink
Remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Feb 3, 2025
1 parent 4d0b85c commit 764886e
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 29 deletions.
1 change: 0 additions & 1 deletion pyiron_base/database/filetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ def _get_jobs(
for key in columns:
dictionary[key] = list()
return dictionary
# return {key: list() for key in columns}
dictionary = {}
for key in df.keys():
dictionary[key] = df[
Expand Down
2 changes: 1 addition & 1 deletion pyiron_base/jobs/job/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def get_job_id(
if job_specifier is not None:
return self.project.get_job_id(
job_specifier
) # , sub_job_name=self.project_hdf5.h5_path)
)
where_dict = {
"job": str(self._name),
"project": str(self.project_hdf5.project_path),
Expand Down
3 changes: 0 additions & 3 deletions pyiron_base/jobs/job/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,6 @@ def interactive_store_in_cache(self, key: str, value: Any) -> None:
"""
self.interactive_cache[key] = value

# def __del__(self):
# self.interactive_close()

def run_if_interactive(self) -> None:
raise NotImplementedError("run_if_interactive() is not implemented!")

Expand Down
2 changes: 1 addition & 1 deletion pyiron_base/jobs/master/flexible.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def run_if_refresh(self):
"""
if self.is_finished():
self.status.collect = True
self.run() # self.run_if_collect()
self.run()
elif (
self.server.run_mode.non_modal
or self.server.run_mode.queue
Expand Down
2 changes: 0 additions & 2 deletions pyiron_base/jobs/master/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def is_finished(self):
"""
if self.status.finished:
return True
# self.status.busy = True
self.submission_status.refresh()
if not self.submission_status.finished:
return False
Expand All @@ -150,7 +149,6 @@ def is_finished(self):
for child_id in self.child_ids
]
)
# status_set = set([job.get_status() for job in self.iter_jobs(convert_to_object=False)])
if "finished" in status_set:
return len(status_set) == 1
else:
Expand Down
5 changes: 2 additions & 3 deletions pyiron_base/jobs/master/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def run_if_refresh(self):
self._logger.info(log_str)
if self.is_finished():
self.status.collect = True
self.run() # self.run_if_collect()
self.run()
elif (
self.server.run_mode.non_modal or self.server.run_mode.queue
) and not self.submission_status.finished:
Expand Down Expand Up @@ -353,7 +353,6 @@ def _run_if_collect(self):
"{}, status: {}, parallel master".format(self.job_info_str, self.status)
)
self.update_master()
# self.send_to_database()

def _run_if_new(self, debug=False):
"""
Expand Down Expand Up @@ -522,7 +521,7 @@ def _run_if_master_modal_child_non_modal(self, job):
if state.database.database_is_disabled:
self.project.db.update()
self.status.collect = True
self.run() # self.run_if_collect()
self.run()

def run_static(self):
"""
Expand Down
13 changes: 0 additions & 13 deletions pyiron_base/project/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def __init__(self, project):
self.w_tab = None
self.w_path = None
self.w_type = None
# self.fig, self.ax = plt.subplots()

self.create_widgets()
self.connect_widgets()
Expand All @@ -86,16 +85,11 @@ def create_widgets(self) -> None:
self.w_node = select(description="Nodes:")
self.w_file = select(description="Files:")
self.w_text = widgets.HTML()
# self.w_text = widgets.Textarea()
self.w_text.layout.height = "330px"
self.w_text.layout.width = "580px"
self.w_text.disabled = True
# self.w_plot = self.fig
w_list = widgets.VBox([self.w_group, self.w_node, self.w_file])
self.w_tab = widgets.HBox([w_list, self.w_text])
# tab = widgets.Tab(children=[self.w_group, self.w_node, self.w_file, self.w_text])
# [tab.set_title(num, name) for num, name in enumerate(['groups', 'nodes', 'files', 'text'])]
# self.w_tab = tab

self.w_path = widgets.Text(name="Path: ")
self.w_path.layout.width = "680px"
Expand Down Expand Up @@ -145,7 +139,6 @@ def plot_array(self, val: np.ndarray) -> None:
else:
self.ax.clear()

# self.ax.set_title(self.name)
if val.ndim == 1:
self.ax.plot(val)
elif val.ndim == 2:
Expand Down Expand Up @@ -246,15 +239,12 @@ def refresh_view(self) -> None:
if isinstance(self.project, str):
self.w_text.value = html.escape(self.project)
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif isinstance(self.project, dict):
self.w_text.value = self.dict_to_str(self.project)
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif isinstance(self.project, (int, float)):
self.w_text.value = html.escape(str(self.project))
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif isinstance(self.project, list):
max_length = 2000 # performance of widget above is extremely poor
if len(self.project) < max_length:
Expand All @@ -268,15 +258,12 @@ def refresh_view(self) -> None:

self.w_type.value = "list: {} lines".format(len(self.project))
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif isinstance(self.project, np.ndarray):
self.plot_array(self.project)
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif "data_dict" in self.project.list_nodes():
self.w_text.value = pandas.DataFrame(self.project["data_dict"]).to_html()
self._move_up()
# self.w_path.value = self.get_rel_path(self.parent.path + '/' + self.name)
elif self.project is None:
raise ValueError(
"project is None: {}".format(type(self.project)), self.parent
Expand Down
2 changes: 0 additions & 2 deletions pyiron_base/project/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,6 @@ def _convert_str_to_generic_path(
path = posixpath.join(path_local, path)
elif not os.path.exists(path):
self._create_path(path)
# else:
# raise ValueError(path, ' does not exist!')
path = self._windows_path_to_unix_path(path)
root_path, project_path = self._get_project_from_path(path)
return GenericPath(root_path, project_path)
Expand Down
2 changes: 1 addition & 1 deletion pyiron_base/state/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _download_resources(
with tarfile.open(temp_zip_file, "r:gz") as tar:
safe_extract(tar, temp_directory)
copytree(temp_extract_folder, user_directory)
if os.name != "nt": #
if os.name != "nt":
for root, dirs, files in os.walk(user_directory):
for file in files:
if ".sh" in file:
Expand Down
2 changes: 1 addition & 1 deletion pyiron_base/state/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
signal.SIGINT,
signal.SIGTERM,
signal.SIGABRT,
] # , signal.SIGQUIT]
]


@contextlib.contextmanager
Expand Down
1 change: 0 additions & 1 deletion pyiron_base/storage/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ def modify(
- default=False
**modify_dict (dict): dictionary of parameter names and values
"""
# print ("modify: ", modify_dict)
if separator is not None:
modify_dict = {k + separator: v for k, v in modify_dict.items()}

Expand Down

0 comments on commit 764886e

Please sign in to comment.