Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to latest holoviews #688

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion external/holoviews
2 changes: 1 addition & 1 deletion topo/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import numpy as np

from holoviews.interface.collector import Reference
from holoviews.core.io import Reference
from holoviews import HSV, Image
from holoviews.core.options import Compositor
from holoviews.ipython import IPTestCase
Expand Down
4 changes: 2 additions & 2 deletions topo/analysis/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ def _update_proj_cog(self, p, proj):

timestamp = topo.sim.time()
lbrt = sheet.bounds.lbrt()
xsv = Image(xcog, sheet.bounds, label=proj.name, group='X CoG',
xsv = Image(xcog, bounds=sheet.bounds, label=proj.name, group='X CoG',
vdims=[Dimension('X CoG', range=(lbrt[0], lbrt[2]))])
ysv = Image(ycog, sheet.bounds, label=proj.name, group='Y CoG',
ysv = Image(ycog, bounds=sheet.bounds, label=proj.name, group='Y CoG',
vdims=[Dimension('Y CoG', range=(lbrt[1], lbrt[3]))])

lines = []
Expand Down
6 changes: 3 additions & 3 deletions topo/analysis/featureresponses.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from holoviews import Image, HoloMap
from holoviews.ipython.widgets import ProgressBar
from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict

import topo
import topo.base.sheetcoords
Expand Down Expand Up @@ -52,14 +52,14 @@ def update_sheet_activity(sheet_name, force=False):
src_name=sheet.name, shape=sheet.activity.shape,
timestamp=time)
if not view:
im = Image(np.array(sheet.activity), sheet.bounds)
im = Image(np.array(sheet.activity), bounds=sheet.bounds)
im.metadata=metadata
view = HoloMap((time, im), key_dimensions=[Time])
view.metadata = metadata
sheet.views.Maps[name] = view
else:
if force or view.range('Time')[1] < time:
im = Image(np.array(sheet.activity), sheet.bounds)
im = Image(np.array(sheet.activity), bounds=sheet.bounds)
im.metadata=metadata
view[time] = im
return view
Expand Down
4 changes: 2 additions & 2 deletions topo/base/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import param
from holoviews import GridSpace, Dimension, HoloMap, Layout
from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict
from holoviews.core import BoundingBox, BoundingRegionParameter, Slice

import patterngenerator
Expand Down Expand Up @@ -782,7 +782,7 @@ def view(self, sheet_x, sheet_y, timestamp=None, situated=False, **kwargs):
matrix_data = cf.weights.copy()
bounds = roi_bounds

sv = CFView(matrix_data, bounds, situated_bounds=situated_bounds,
sv = CFView(matrix_data, bounds=bounds, situated_bounds=situated_bounds,
input_sheet_slice=(r1, r2, c1, c2), roi_bounds=roi_bounds,
label=self.name, group='CF Weight')
sv.metadata=AttrDict(timestamp=timestamp)
Expand Down
4 changes: 2 additions & 2 deletions topo/base/generatorsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from topo.base.patterngenerator import PatternGenerator,Constant
from topo.base.simulation import FunctionEvent, PeriodicEventSequence

from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict
from holoviews import Image

import numpy as np
Expand Down Expand Up @@ -279,7 +279,7 @@ def __getitem__(self, coords):
else:
arr = self.activity.copy()

im = Image(arr, self.bounds,
im = Image(arr, bounds=self.bounds,
label=self.name+' Activity', group='Activity')[coords]
im.metadata=metadata
return im
4 changes: 2 additions & 2 deletions topo/base/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from imagen import Disk
from holoviews import Image, Layout
from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict

from sheet import Sheet
from simulation import EPConnection
Expand Down Expand Up @@ -326,7 +326,7 @@ def projection_view(self, timestamp=None):
"""Returns the activity in a single projection"""
if timestamp is None:
timestamp = self.src.simulation.time()
im = Image(self.activity.copy(), self.dest.bounds,
im = Image(self.activity.copy(), bounds=self.dest.bounds,
label=self.name, group='Activity')
im.metadata=AttrDict(proj_src_name=self.src.name,
precedence=self.src.precedence,
Expand Down
4 changes: 2 additions & 2 deletions topo/base/sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from holoviews import Image, Layout
from holoviews.core import BoundingBox, BoundingRegionParameter, SheetCoordinateSystem
from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict

from simulation import EventProcessor
from functionfamily import TransferFn
Expand Down Expand Up @@ -309,7 +309,7 @@ def __getitem__(self, coords):
row_precedence=self.row_precedence,
timestamp=self.simulation.time())

image = Image(self.activity.copy(), self.bounds,
image = Image(self.activity.copy(), bounds=self.bounds,
label=self.name, group='Activity')[coords]
image.metadata=metadata
return image
Expand Down
2 changes: 1 addition & 1 deletion topo/base/sheetview.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def situated(self):
r1, r2, c1, c2 = self.input_sheet_slice
data[r1:r2, c1:c2] = self.data

return CFView(data, self.situated_bounds, roi_bounds=self.bounds,
return CFView(data, bounds=self.situated_bounds, roi_bounds=self.bounds,
situated_bounds=self.situated_bounds,
label=self.label, group=self.group)

Expand Down
2 changes: 1 addition & 1 deletion topo/base/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import time
import bisect

from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict

#: Default path to the current simulation, from main
#: Only to be used by script_repr(), to allow it to generate
Expand Down
2 changes: 1 addition & 1 deletion topo/misc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from IPython.terminal.embed import InteractiveShellEmbed as IPShell
except ImportError: # Prior to IPython 1.0, InteractiveShellEmbed was found in the frontend package
from IPython.frontend.terminal.embed import InteractiveShellEmbed as IPShell # pyflakes:ignore (try/except import)
from IPython.config.loader import Config
from traitlets.config.loader import Config
ipython_shell_interface = "InteractiveShellEmbed"
try:
from IPython.core.prompts import PromptManager # pyflakes:ignore (try/except import)
Expand Down
2 changes: 1 addition & 1 deletion topo/misc/lancext.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import param

from holoviews import NdMapping, Layout
from holoviews.interface.collector import Collector
from featuremapper.collector import Collector
from holoviews.core.element import Collator
from holoviews.core.io import Pickler

Expand Down
2 changes: 1 addition & 1 deletion topo/tests/unit/testplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import param

from holoviews.core import BoundingBox, NdMapping
from holoviews.interface.collector import AttrDict
from topo.misc.attrdict import AttrDict
from holoviews import Image


Expand Down