Skip to content

Commit

Permalink
Add unit test for ui (#1265)
Browse files Browse the repository at this point in the history
<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary

<!--
Resolves #111 and #222.
Depends on #1000 (for series of dependent commits).

This PR introduces this capability to make the project better in this
and that.

- Added this feature
- Removed that feature
- Fixed the problem #1234
-->

Added unit test for gui

### How to test
<!-- Describe the testing procedure for reviewers, if changes are
not fully covered by unit tests or manual testing can be complicated.
-->

### Checklist
<!-- Put an 'x' in all the boxes that apply -->
- [X] I have added unit tests to cover my changes.​
- [ ] I have added integration tests to cover my changes.​
- [ ] I have added the description of my changes into
[CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md).​
- [ ] I have updated the
[documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs)
accordingly

### License

- [ ] I submit _my code changes_ under the same [MIT
License](https://github.com/openvinotoolkit/datumaro/blob/develop/LICENSE)
that covers the project.
  Feel free to contact the maintainers if that's a concern.
- [ ] I have updated the license header for each file (see an example
below).

```python
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
```
  • Loading branch information
sooahleex committed Feb 28, 2024
1 parent ab8d400 commit 2e783d9
Show file tree
Hide file tree
Showing 35 changed files with 5,871 additions and 267 deletions.
2 changes: 0 additions & 2 deletions gui/ABOUTUS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Who We Are?



## Contributing

[(Back to top)](#dataset-management-framework-datumaro)
Expand Down
2 changes: 1 addition & 1 deletion gui/datumaro_gui/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .home import main as home
from .aboutus import main as aboutus
from .home import main as home
6 changes: 3 additions & 3 deletions gui/datumaro_gui/apps/aboutus.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import streamlit as st

from pathlib import Path

import streamlit as st


def main():
st.markdown((Path(__file__).parents[2]/"ABOUTUS.md").read_text())
st.markdown((Path(__file__).parents[2] / "ABOUTUS.md").read_text())


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions gui/datumaro_gui/apps/home.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import streamlit as st

from pathlib import Path

import streamlit as st


def main():
st.markdown((Path(__file__).parents[2]/"README.md").read_text())
st.markdown((Path(__file__).parents[2] / "README.md").read_text())


if __name__ == "__main__":
Expand Down
11 changes: 8 additions & 3 deletions gui/datumaro_gui/components/multiple/tabs/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def main():
"datasets.\n\nBy the way, the low-level analysis takes a bit of time to compute. Please bear with us "
"for a moment; your patience is much appreciated!",
)
on = st.toggle("Show low-level table", key="low_lvl_tb_toggle")
on = st.toggle("Show low-level table", key="tg_low_lvl_on_comp_mul")
if on:
if low_level_df is None:
_, _, low_level_table, _ = comparator.compare_datasets(
Expand Down Expand Up @@ -155,7 +155,12 @@ def normalize_string(s):
return s

threshold = st.slider(
"Desired similarity threshold", 0.0, 1.0, 0.7, step=0.1, key="sim_slider"
"Desired similarity threshold",
0.0,
1.0,
0.7,
step=0.1,
key="sd_threshold_comp_mul",
)
# Iterate over items in the first list
for item1 in unmatches[uploaded_file_1]:
Expand Down Expand Up @@ -206,7 +211,7 @@ def normalize_string(s):
)

if (
st.button("Finalize mapping", key="mapping_btn")
st.button("Finalize mapping", key="btn_mapping_comp_mul")
and grid_table["selected_rows"] is not None
):
sel_row = grid_table["selected_rows"]
Expand Down
2 changes: 1 addition & 1 deletion gui/datumaro_gui/components/multiple/tabs/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main():
key="ti_path_export_mult",
)

export_btn = st.button("Export", "btn_export_mult")
export_btn = st.button("Export", key="btn_export_mult")
if export_btn:
data_helper = dataset_dict.get(selected_dataset, None)
data_helper.export(selected_path, format=selected_format, save_media=True)
Expand Down
Loading

0 comments on commit 2e783d9

Please sign in to comment.