Skip to content

Commit

Permalink
Finalizing package structure and naming (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens authored May 3, 2023
1 parent b55e65d commit af0138d
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 53 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.DS_Store
__pycache__/
.ipynb_checkpoints/
.pytest_cache
dist
scratch/
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
The `holonote` library offers tools to create, edit and persist
annotated regions for [HoloViews](https://holoviews.org/).

![Annotation demo](https://github.com/holoviz/holonote/blob/main/examples/assets/demo.gif)

An annotated region marks a region-of-interest that is overlaid on top
of the visual representation of a HoloViews element. Such a region has a
unique identifier as well as additional domain-specific information
Expand All @@ -19,10 +21,10 @@ this information to a database. You can interactively add, delete and
update these annotation regions as well as their associated
domain-specific data.

2. `RegionEditors`: These tools are designed to let you interactively
2. `Editors`: These tools are designed to let you interactively
manipulate and edit the visual regions themselves. These regions are in
fact HoloViews elements which means you can use region editors as
generic editors of the corresponding HoloViews elements.
fact HoloViews elements which means you can use these editors as
generic edit tools for the corresponding HoloViews elements.

By default, annotators automatically persist any annotations you create
to a local SQLite database file. This is a very convenient way to get
Expand Down
28 changes: 3 additions & 25 deletions examples/Basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,8 @@
"import numpy as np\n",
"import pandas as pd\n",
"import holoviews as hv\n",
"from annotators import Annotator\n",
"\n",
"# FOR POINT EVENTS!\n",
"#annotator.selection_enabled = False"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9bd46114-32a0-45a2-bae0-acef48a7b252",
"metadata": {},
"outputs": [],
"source": [
"hv.extension('bokeh', allow_jedi_completion=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4e4d48df-ad27-4d26-a8d8-2d61b2c629cc",
"metadata": {},
"outputs": [],
"source": [
"import hvplot.pandas"
"import hvplot.pandas\n",
"from holonote.annotate import Annotator"
]
},
{
Expand Down Expand Up @@ -73,7 +51,7 @@
"metadata": {},
"outputs": [],
"source": [
"speed_data = pd.read_parquet('example.parquet')\n",
"speed_data = pd.read_parquet('./assets/example.parquet')\n",
"speed_curve = speed_data.hvplot('TIME', 'SPEED')\n",
"speed_curve"
]
Expand Down
23 changes: 2 additions & 21 deletions examples/Basics_2D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,9 @@
"import numpy as np\n",
"import pandas as pd\n",
"import holoviews as hv\n",
"import hvplot.pandas\n",
"\n",
"from annotators import Annotator"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "892d16c7-b800-4bb4-bffb-d419c9a8b6d2",
"metadata": {},
"outputs": [],
"source": [
"hv.extension('bokeh', allow_jedi_completion=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a9a96325-af0b-4b0d-9c15-be9d7193c45b",
"metadata": {},
"outputs": [],
"source": [
"import hvplot.pandas"
"from holonote.annotate import Annotator"
]
},
{
Expand Down
Binary file added examples/assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/assets/example.parquet
Binary file not shown.
2 changes: 1 addition & 1 deletion holonote/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import annotate
from . import region
from . import editor
1 change: 1 addition & 0 deletions holonote/editor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .editors import PathEditor
2 changes: 1 addition & 1 deletion holonote/region/editors.py → holonote/editor/editors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Move https://github.com/holoviz/holoviews/blob/main/holoviews/annotators.py here
class PathAnnotator:
class PathEditor:
pass
1 change: 0 additions & 1 deletion holonote/region/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
]
dependencies = ["holoviews", "pandas<2", "sqlalchemy<2"]
dependencies = ["holoviews", "pandas<2"]

[tool.hatch.version]
source = "vcs"
Expand Down

0 comments on commit af0138d

Please sign in to comment.