Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP new archive/run selection #551

Draft
wants to merge 64 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a090d75
added comment
gitjannes Nov 21, 2024
375b934
Implemented get_available_runs(), a function that returns all runs wi…
gitjannes Nov 22, 2024
16cdfb8
Added filter.py, where the filters will be implemented. added (tempo…
gitjannes Nov 22, 2024
c566121
Made filtered_index more understandable
gitjannes Nov 22, 2024
5c1d1ab
fixed somethings
gitjannes Nov 26, 2024
dc20121
fiexed import for filter.py
gitjannes Nov 26, 2024
1d29f3a
Added structure to filter.py
gitjannes Nov 26, 2024
a85fea3
continue menu revised and delete feature implemented (#554)
maximilianKalff Nov 26, 2024
c841f8f
added memory_mode to runinfo
gitjannes Nov 26, 2024
e9eae3f
new run info works
gitjannes Nov 26, 2024
3e92367
fixed get_available_runs for mac
gitjannes Nov 26, 2024
855f889
fixed smth
gitjannes Nov 26, 2024
3231d43
added favourite in views.py
gitjannes Nov 26, 2024
4436b43
favourite function fixed
gitjannes Nov 26, 2024
6150878
first layout draft
maximilianKalff Nov 26, 2024
6070b55
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
maximilianKalff Nov 26, 2024
30a68de
Proof of Concept for letting user choose favourites. its very ugly
gitjannes Nov 26, 2024
5d4281a
filter methods logic implemented, working with hardcoded filter
sarahvgls Nov 27, 2024
a39b2be
Added tag functionality for runs (no frontend tho). Tested how to get…
gitjannes Dec 2, 2024
8aa0f53
Select Visualisation, Run Selection code refactored
maximilianKalff Dec 5, 2024
6bd2e3e
Selection Header & Filter input value fixed
maximilianKalff Dec 5, 2024
9c131d9
Reworked index.html to only show available runs. Added new html page …
gitjannes Dec 10, 2024
f6aa54e
Header fixed, Button hover effect, first run always selected, deselec…
maximilianKalff Dec 12, 2024
397d70d
Minor visual changes (text in rows centered; thicker header line, etc.)
maximilianKalff Dec 12, 2024
1aab2bd
Arcordeon with one little bug
maximilianKalff Dec 12, 2024
2cd55b8
Added Steps into the filter selection
gitjannes Dec 12, 2024
e6db66d
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
gitjannes Dec 12, 2024
ff4fa08
Added added html forms and js functions to add/delete tags. added set…
gitjannes Dec 12, 2024
373963b
fixed issue concerning non-existing metadata.yaml
gitjannes Dec 12, 2024
0b0fec4
ugly tags & back-end fixes
maximilianKalff Dec 12, 2024
7c35a10
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
maximilianKalff Dec 12, 2024
8bb2d07
small fix for writing metadata
gitjannes Dec 12, 2024
383b1ad
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
gitjannes Dec 12, 2024
9f9b8db
a tag with standard name can now be added to runs, it is displayed i…
gitjannes Dec 12, 2024
78ef886
added ugly text input field for tag naming, but the js function doesn…
gitjannes Dec 12, 2024
6b07f1f
the user-selected filters now filter
gitjannes Dec 16, 2024
3af2117
very ugly delete button shenanigans for tags, kinda works but wonky
gitjannes Dec 16, 2024
4c7ad64
Fixed tag adding, tags are now also saved as a set
gitjannes Dec 16, 2024
99be316
added the "addable_tags" key to the runs so that frontend doesnt have…
gitjannes Dec 17, 2024
6fe7878
Deleted comments that were now irrelevant, added descriptions to som…
gitjannes Dec 17, 2024
1e341f5
Moved filters into views_helper.py, deleted now obsolete filters.py, …
gitjannes Dec 17, 2024
1a0fa27
Missed a comment
gitjannes Dec 17, 2024
0b69258
minor fix
sarahvgls Dec 18, 2024
a4333e5
Moved favourite attribute of a run into the metadata for the run
gitjannes Dec 19, 2024
e5b9d8a
added displaying of active filters on reload, fixed filtering for steps
sarahvgls Dec 19, 2024
04e52fb
Removed outdated favourite functionality in front end
gitjannes Dec 19, 2024
f475e09
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
gitjannes Dec 19, 2024
d7eb107
first version of clear filters button, working, handled error
sarahvgls Dec 19, 2024
468bd52
merge chaos
sarahvgls Dec 19, 2024
fc74963
merge chaos
sarahvgls Dec 19, 2024
0b7ee18
changed button positioning
sarahvgls Jan 5, 2025
a1e0134
adapted memory mode filter to other selection style
sarahvgls Jan 5, 2025
100ba51
sorting methods first version
sarahvgls Jan 6, 2025
527c6e3
"multiple runs selected bug" fixed & run stays selected when reloadin…
maximilianKalff Jan 6, 2025
2a6863b
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
maximilianKalff Jan 6, 2025
e6e5988
bug fixed, caused by previous bug fix :))
maximilianKalff Jan 6, 2025
03594cf
bugfix when adding first tag fixed
sarahvgls Jan 8, 2025
fa0e73a
sorting in columns WIP
sarahvgls Jan 8, 2025
f9f8b30
implemented sorting by clicking on column header
sarahvgls Jan 9, 2025
3b40f60
swapped continue and delete button
gitjannes Jan 15, 2025
01340a0
changed lines between list items
sarahvgls Jan 15, 2025
edb1bbb
removed margin from continue button
gitjannes Jan 15, 2025
1cb0f60
Merge branch 'run-selection' of https://github.com/cschlaffner/PROTzi…
gitjannes Jan 15, 2025
ac81250
made continue button color-changing
gitjannes Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions protzilla/disk_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def write_run(self, step_manager: StepManager) -> None:
run[KEYS.STEPS].append(self._write_step(step))
self.yaml_operator.write(self.run_file, run)



def read_workflow(self) -> StepManager:
return self.read_run(self.workflow_file)

Expand Down
67 changes: 67 additions & 0 deletions protzilla/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
import threading
import traceback

import os
import shutil
import datetime

import protzilla.constants.paths as paths
from protzilla.steps import Messages, Output, Plots, Step
from protzilla.utilities import format_trace
from protzilla.disk_operator import DiskOperator, YamlOperator


def get_available_run_names() -> list[str]:
Expand All @@ -19,6 +24,68 @@ def get_available_run_names() -> list[str]:
if not directory.name.startswith(".")
]

def get_available_runinfo() -> tuple[list[dict[str, str | list[str]]], list[dict[str, str | list[str]]], set[str]]:
if not paths.RUNS_PATH.exists():
return []
runs = []
runs_favourited = []
all_tags = set()
for directory in paths.RUNS_PATH.iterdir(): #not sorted the same for different os?
if directory.name.startswith("."):
continue
name = directory.name
creation_time = directory.stat().st_ctime
modification_time = directory.stat().st_mtime

disk_operator = DiskOperator(name, "dummy_workflow_name")
directory_path = os.path.join(paths.RUNS_PATH, name)
run_yaml_path = os.path.join(directory_path, "run.yaml")
step_manager = disk_operator.read_run(run_yaml_path)
steps = step_manager.all_steps
step_names = []
for step in steps:
step_names.append(step.display_name)

# empty initialization to ensure backwardscompatibility for runs without metadata.yaml
favourite = False
tags = set()

metadata_yaml_path = os.path.join(directory_path, "metadata.yaml")
if os.path.isfile(metadata_yaml_path):
yaml_operator = YamlOperator()
metadata = yaml_operator.read(metadata_yaml_path)
tags = metadata.get("tags", set())
favourite = metadata.get("favourite", False)

for tag in tags:
all_tags.add(tag)

run = {
"run_name": name,
"creation_date": datetime.datetime.fromtimestamp(creation_time).strftime("%d %m %Y"), #TODO: reutrn the pure datetime, convert in html)
"modification_date": datetime.datetime.fromtimestamp(modification_time).strftime("%d %m %Y"),
"memory_mode": step_manager.df_mode,
"run_steps" : step_names,
"favourite_status" : favourite,
"run_tags": tags
}

if favourite:
runs_favourited.append(run)
else:
runs.append(run)

for run in runs + runs_favourited:
possible_tags = list(all_tags - run["run_tags"])
run["addable_tags"] = possible_tags

return (runs, runs_favourited, all_tags)

def delete_run_folder(run_name) -> None:
path = os.path.join(paths.RUNS_PATH, run_name)

if os.path.isdir(path):
shutil.rmtree(path)

class Run:
class ErrorHandlingContextManager:
Expand Down
9 changes: 0 additions & 9 deletions protzilla/run_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import threading
import traceback

import os
import shutil

import protzilla.constants.paths as paths
from protzilla.steps import Messages, Output, Plots, Step
from protzilla.utilities import format_trace
Expand All @@ -21,12 +18,6 @@ def get_available_run_names() -> list[str]:
if not directory.name.startswith(".")
]

def delete_run_folder(run_name) -> None:
path = os.path.join(paths.RUNS_PATH, run_name)

if os.path.isdir(path):
shutil.rmtree(path)


class Run:
class ErrorHandlingContextManager:
Expand Down
150 changes: 150 additions & 0 deletions ui/runs/static/runs/MultiSelect.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
.multi-select {
display: flex;
box-sizing: border-box;
flex-direction: column;
position: relative;
width: 100%;
user-select: none;
}
.multi-select .multi-select-header {
border: 1px solid #dee2e6;
padding: 7px 30px 7px 12px;
overflow: hidden;
gap: 7px;
min-height: 45px;
}
.multi-select .multi-select-header::after {
content: "";
display: block;
position: absolute;
top: 50%;
right: 15px;
transform: translateY(-50%);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23949ba3' viewBox='0 0 16 16'%3E%3Cpath d='M8 13.1l-8-8 2.1-2.2 5.9 5.9 5.9-5.9 2.1 2.2z'/%3E%3C/svg%3E");
height: 12px;
width: 12px;
}
.multi-select .multi-select-header.multi-select-header-active {
border-color: #c1c9d0;
}
.multi-select .multi-select-header.multi-select-header-active::after {
transform: translateY(-50%) rotate(180deg);
}
.multi-select .multi-select-header.multi-select-header-active + .multi-select-options {
display: flex;
}
.multi-select .multi-select-header .multi-select-header-placeholder {
color: #65727e;
}
.multi-select .multi-select-header .multi-select-header-option {
display: inline-flex;
align-items: center;
background-color: #f3f4f7;
font-size: 14px;
padding: 3px 8px;
border-radius: 5px;
}
.multi-select .multi-select-header .multi-select-header-max {
font-size: 14px;
color: #65727e;
}
.multi-select .multi-select-options {
display: none;
box-sizing: border-box;
flex-flow: wrap;
position: absolute;
top: 100%;
left: 0;
right: 0;
z-index: 999;
margin-top: 5px;
padding: 5px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-height: 200px;
overflow-y: auto;
overflow-x: hidden;
}
.multi-select .multi-select-options::-webkit-scrollbar {
width: 5px;
}
.multi-select .multi-select-options::-webkit-scrollbar-track {
background: #f0f1f3;
}
.multi-select .multi-select-options::-webkit-scrollbar-thumb {
background: #cdcfd1;
}
.multi-select .multi-select-options::-webkit-scrollbar-thumb:hover {
background: #b2b6b9;
}
.multi-select .multi-select-options .multi-select-option, .multi-select .multi-select-options .multi-select-all {
padding: 4px 12px;
height: 42px;
}
.multi-select .multi-select-options .multi-select-option .multi-select-option-radio, .multi-select .multi-select-options .multi-select-all .multi-select-option-radio {
margin-right: 14px;
height: 16px;
width: 16px;
border: 1px solid #ced4da;
border-radius: 4px;
}
.multi-select .multi-select-options .multi-select-option .multi-select-option-text, .multi-select .multi-select-options .multi-select-all .multi-select-option-text {
box-sizing: border-box;
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: inherit;
font-size: 16px;
line-height: 20px;
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio {
border-color: #40c979;
background-color: #40c979;
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-radio::after, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-radio::after {
content: "";
display: block;
width: 3px;
height: 7px;
margin: 0.12em 0 0 0.27em;
border: solid #fff;
border-width: 0 0.15em 0.15em 0;
transform: rotate(45deg);
}
.multi-select .multi-select-options .multi-select-option.multi-select-selected .multi-select-option-text, .multi-select .multi-select-options .multi-select-all.multi-select-selected .multi-select-option-text {
color: #40c979;
}
.multi-select .multi-select-options .multi-select-option:hover, .multi-select .multi-select-options .multi-select-option:active, .multi-select .multi-select-options .multi-select-all:hover, .multi-select .multi-select-options .multi-select-all:active {
background-color: #f3f4f7;
}
.multi-select .multi-select-options .multi-select-all {
border-bottom: 1px solid #f1f3f5;
border-radius: 0;
}
.multi-select .multi-select-options .multi-select-search {
padding: 7px 10px;
border: 1px solid #dee2e6;
border-radius: 5px;
margin: 10px 10px 5px 10px;
width: 100%;
outline: none;
font-size: 16px;
}
.multi-select .multi-select-options .multi-select-search::placeholder {
color: #b2b5b9;
}
.multi-select .multi-select-header, .multi-select .multi-select-option, .multi-select .multi-select-all {
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
align-items: center;
border-radius: 5px;
cursor: pointer;
display: flex;
align-items: center;
width: 100%;
font-size: 16px;
color: #212529;
}
Loading
Loading