Skip to content

Object properties not persisted in DataLab when modified from a proxy (RemoteProxy / Web API) #305

@deuterium33

Description

@deuterium33

Describe the bug
Modifying Image object properties, such as (dx, dy, x0, y0), from a RemoteProxy call updates a copy of the object but does not modify the object in DataLab.

To Reproduce

Run the following code:

import numpy as np
data = np.zeros([800,800])
from datalab.control.proxy import RemoteProxy
proxy = RemoteProxy()
proxy.add_image('zeros', data)
o = proxy.get_object()
dx, dy = 2, 2
o.set_uniform_coords(dx, dy)
print([o.dx,o.dy])
# Returns [2.0, 2.0]
o.dx, o.dy = 3, 3 #same thing
print([o.dx,o.dy])
# Returns [3.0, 3.0]

In DataLab, the object keeps its original properties (here, dx=1 and dy=1) despite changes:

https://www.pasteboard.co/vJef0vtufGlt.png

Expected behavior
The object properties are updated when changed from the RemoteProxy, as working currently when doing it from the console:

o = dl.get_object()
o.dx = 2.

https://www.pasteboard.co/XFRcKv-a4L3v.png

Installation information

  • DataLab installation type "Python package"
  • DataLab v1.1.0

Additional context
Running the RemoteProxy code from Spyder 6.1.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions