Skip to content

Commit

Permalink
Add "all" tab to allow full data search
Browse files Browse the repository at this point in the history
Closes #26
  • Loading branch information
WarmCyan committed Aug 16, 2023
1 parent 90e06f6 commit bc91e3f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]

### Added
* "All" tab in data manager to allow searching through entire dataset.




## [0.3.0] - 2023-08-14

### Added
Expand Down
20 changes: 19 additions & 1 deletion icat/anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,30 @@ def load(self, path: str):

class DictionaryAnchor(Anchor):
"""A bag-of-words feature that returns raw count value sum of the
number of occurrences of each word in the given keywords."""
number of occurrences of each word in the given keywords.
Args:
container (AnchorList): The containing anchor list parent instance.
This can usually be left ``None`` if defining an anchor manually,
any time ``add_anchor`` is called, the anchor list will take care
of setting this on all children anchors.
Example:
.. code-block:: python
my_keywords_anchor = DictionaryAnchor(anchor_name="ML", keywords=["machine learning", "artificial intelligence"])
my_model.add_anchor(my_keywords_anchor)
"""

keywords_str = param.String(label="Keywords")
"""The direct 'backend model' for what's in the keywords text field. This is really
only needed for internal use, any programmatic manipulation of the anchor's keywords
should be done through the ``keywords`` parameter."""
text_col = param.String(precedence=-1)
"""The column in the dataset containing the texts to search through."""

keywords = param.List(precedence=-1)
"""The list of keywords this anchor is searching for."""

def __init__(self, container=None, **params):
if "keywords" in params:
Expand Down
4 changes: 3 additions & 1 deletion icat/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(
)
self.instance_viewer.on_label_changed(self._handle_label_changed)

self.data_tab_list = ["Sample", "Labeled", "Interesting", "Selected"]
self.data_tab_list = ["Sample", "Labeled", "Interesting", "Selected", "All"]
self.data_tabs = v.Tabs(
v_model=0,
fixed_tabs=True,
Expand Down Expand Up @@ -153,6 +153,7 @@ def __init__(
v_model=0,
height=35,
background_color="primary",
width=width,
children=[
v.Tab(children=["Data"]),
v.Tab(children=["Instance"]),
Expand All @@ -161,6 +162,7 @@ def __init__(
)
self.tabs_items_component = v.TabsItems(
v_model=0,
width=width,
children=[
v.TabItem(children=[data_layout_stack]),
v.TabItem(children=[self.instance_viewer.widget]),
Expand Down
6 changes: 6 additions & 0 deletions sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Welcome to ICAT's documentation!
Testing 1 2 3


..
.. toctree::
:maxdepth: 2
:caption: User Guide


.. toctree::
:maxdepth: 2
Expand Down

0 comments on commit bc91e3f

Please sign in to comment.