Skip to content

Commit

Permalink
allow_float64
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Magland committed Jan 4, 2024
1 parent 6634300 commit 9dd9c81
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .vscode/tasks/publish-pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ done
twine upload ./dist/*

# Tag this commit
git tag v0.13.0
git tag v0.13.1

echo "Tagged as v0.13.0"
echo "Tagged as v0.13.1"
2 changes: 1 addition & 1 deletion jinjaroot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
projectName: sortingview
pythonProjectVersion: 0.13.0
pythonProjectVersion: 0.13.1
projectAuthor: Jeremy Magland and Jeff Soules
projectAuthorEmail: jmagland@flatironinstitute.org
projectDescription: Web app for viewing results of ephys spike sorting
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was automatically generated by jinjaroot. Do not edit directly.
[metadata]
name = sortingview
version = 0.13.0
version = 0.13.1
author = Jeremy Magland and Jeff Soules
author_email = jmagland@flatironinstitute.org
description = Web app for viewing results of ephys spike sorting
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
install_requires=[
'spikeinterface>=0.97.0',
'kachery-cloud>=0.4.0',
'figurl>=0.2.18',
'figurl>=0.2.22',
'matplotlib',
'click',
'pynwb',
Expand Down
2 changes: 1 addition & 1 deletion sortingview/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This file was automatically generated by jinjaroot. Do not edit directly.
__version__ = '0.13.0'
__version__ = '0.13.1'
16 changes: 8 additions & 8 deletions sortingview/views/View.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_descendant_views_including_self(self):
ret.append(v)
return ret

def url_dict(self, *, label: str, state: Union[dict, None] = None):
def url_dict(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool=False):
from .Box import Box
from .LayoutItem import LayoutItem

Expand All @@ -78,10 +78,10 @@ def url_dict(self, *, label: str, state: Union[dict, None] = None):
data = {
"type": "MainLayout",
"layout": self.to_dict(),
"views": [{"type": view.type, "viewId": view.id, "dataUri": _upload_data_and_return_uri(view.to_dict())} for view in all_views if not view.is_layout],
"views": [{"type": view.type, "viewId": view.id, "dataUri": _upload_data_and_return_uri(view.to_dict(), allow_float64=allow_float64)} for view in all_views if not view.is_layout],
}
view_url = sortingview_view_url
F = fig.Figure(view_url=view_url, data=data)
F = fig.Figure(view_url=view_url, data=data, allow_float64=allow_float64)
# if time_range is not None:
# if state is None:
# state = {}
Expand All @@ -91,10 +91,10 @@ def url_dict(self, *, label: str, state: Union[dict, None] = None):
# Need to wrap it in a layout
V = Box(direction="horizontal", items=[LayoutItem(self)])
assert V.is_layout # avoid infinite recursion
return V.url_dict(label=label, state=state)
return V.url_dict(label=label, state=state, allow_float64=allow_float64)

def url(self, *, label: str, state: Union[dict, None] = None):
return fig.url_from_url_dict(self.url_dict(label=label, state=state))
def url(self, *, label: str, state: Union[dict, None] = None, allow_float64: bool=False):
return fig.url_from_url_dict(self.url_dict(label=label, state=state, allow_float64=allow_float64))

def jupyter(self, *, height: Union[int, None] = None):
raise Exception("Jupyter mode no longer supported")
Expand Down Expand Up @@ -145,8 +145,8 @@ def _on_message(self, message):
self._sorting_curation = message.get("sortingCuration", {})


def _upload_data_and_return_uri(data, *, local: bool = False):
return kcl.store_json(fig.serialize_data(data), local=local)
def _upload_data_and_return_uri(data, *, local: bool = False, allow_float64: bool=False):
return kcl.store_json(fig.serialize_data(data, allow_float64=allow_float64), local=local)


def _random_id():
Expand Down

0 comments on commit 9dd9c81

Please sign in to comment.