diff --git a/CHANGELOG.md b/CHANGELOG.md index 775d787..63b5475 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ 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). +## [0.7.0] - 2023-08-25 + +### Added +* Anchor types tab to anchorlist, anchor classes in scope are automatically detected, + and can be dynamically added and removed. +* Color delineation to anchors, each row in the anchorlist and anchor in anchorviz is + colored corresponding to anchor color (configurable in anchor types tab.) +* Ability to change what anchor type is used when the "example" buttons are clicked. +* Optional description and name class attributes to anchors for display in the interface. +* Individual anchor-level `cache` dictionary that gets loaded and saved with the anchor +* Access to anchor list cache through an anchor `global_cache` property. + +### Removed +* Similarity functions from model constructor and the similarity function anchor + (subclass the `SimilarityAnchorBase` and provide it with a `featurize()` + function instead - see the `lm_similarity_example` notebook.) + + + + ## [0.6.0] - 2023-08-22 ### Added diff --git a/icat/__init__.py b/icat/__init__.py index c773956..a3542fd 100644 --- a/icat/__init__.py +++ b/icat/__init__.py @@ -13,12 +13,12 @@ table, view, ) -from icat.anchors import Anchor, DictionaryAnchor, SimilarityFunctionAnchor, TFIDFAnchor +from icat.anchors import Anchor, DictionaryAnchor, TFIDFAnchor # make the important things directly accessible off top level module from icat.model import Model -__version__ = "0.6.0" +__version__ = "0.7.0" def initialize(offline: bool = False): diff --git a/icat/anchorlist.py b/icat/anchorlist.py index 5000fd6..0f2fd0b 100644 --- a/icat/anchorlist.py +++ b/icat/anchorlist.py @@ -4,6 +4,7 @@ import os import pickle from collections.abc import Callable +from functools import partial import ipyvuetify as v import ipywidgets as ipw @@ -14,12 +15,44 @@ import traitlets from sklearn.feature_extraction.text import TfidfVectorizer -from icat.anchors import Anchor, DictionaryAnchor, SimilarityFunctionAnchor, TFIDFAnchor +from icat.anchors import Anchor, DictionaryAnchor, SimilarityAnchorBase, TFIDFAnchor from icat.utils import _kill_param_auto_docstring _kill_param_auto_docstring() +ANCHOR_COLOR_PALLETE = [ + [ + "#2ABD7F", # pleasant pale green + "#42803F", # dark green + ], + [ + "#8C27C1", # dark purple + "#5B3D7B", # darker purple + ], + [ + "#2EA5A5", # mid pale blue + "#424E80", # dark washed blue + ], + [ + "#BFA74C", # gold + "#6E9613", # olive green + ], + [ + "#DA707C", # salmon + "#A75B13", # burnt orange + ], + [ + "#CA3296", # pink + "#881515", # red + ], + [ + "#8D6E63", # brown + "#777777", # grey + ], +] + + class AnchorListTemplate(v.VuetifyTemplate): """The ipyvuetify contents of the anchorlist table. This handles all the special considerations like the slot for the expanded rows containing the anchor widgets, and the coverage v-html etc. @@ -93,45 +126,47 @@ def _template(self): dense :loading="processing" :expanded.sync="expanded" - class="dense-table striped-table softhover-table" + class="dense-table striped-table" item-key="name" > - - - - - - - - - - - Label this item as interesting (warm). - + - Create a similarity anchor with this item as the target. + Create a {{ example_type_name }} anchor with this item as the target.