Skip to content

Commit

Permalink
more cleanup and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Jul 7, 2021
1 parent 3d3ce22 commit e2677a5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hyperactive/dashboards/progress_board/progress_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, filter_file=None):

self.uuid = uuid.uuid4().hex
self.search_ids = []
self._io_ = ProgressIO("./", verbosity=False)
self._io_ = ProgressIO(verbosity=False)

def create_lock(self, search_id):
path = self._io_.get_lock_file_path(search_id)
Expand Down
4 changes: 2 additions & 2 deletions hyperactive/dashboards/progress_board/progress_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


class ProgressIO:
def __init__(self, path, verbosity=True, warnings=True):
self.path = path
def __init__(self, verbosity=True, warnings=True):
self.path = "./"
self.verbosity = verbosity
self.warnings = warnings

Expand Down
6 changes: 2 additions & 4 deletions hyperactive/dashboards/progress_board/run_streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,16 @@ def main():
lock_file = backend._io_.get_lock_file_path(search_id)
lock_files.append(os.path.isfile(lock_file))

print("\n lock_files", lock_files, "\n")

time.sleep(1)
if all(lock_file is False for lock_file in lock_files):
print("\n --- Deleting progress-/filter-files ---")
print("\n --- Deleting progress- and filter-files --- \n")

for search_id in search_ids:
backend._io_.remove_progress(search_id)
backend._io_.remove_filter(search_id)

else:
print("\n --- Rerun streamlit ---")
print("\n --- Rerun streamlit --- \n")
st.experimental_rerun()


Expand Down
4 changes: 2 additions & 2 deletions hyperactive/dashboards/progress_board/streamlit_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, search_ids):
self.search_ids = search_ids
self.search_id_dict = {}

self._io_ = ProgressIO("./")
self._io_ = ProgressIO()

for search_id in search_ids:
self.search_id_dict[search_id] = {}
Expand Down Expand Up @@ -120,7 +120,7 @@ def plotly(self, progress_data, search_id):
color="score",
color_continuous_scale=color_scale,
)
fig.update_layout(autosize=False, width=1200, height=540)
fig.update_layout(width=1200, height=540)

return fig

Expand Down

0 comments on commit e2677a5

Please sign in to comment.