This adds the ability for the raw blueskyRun and BlueskyEventStream objects to update their metadata, putting the onus on clients that invoke it to preserve existing metadata. Currently behaves like a PUT request, overwriting the existing data unless the client performs a copy.deepcopy() of the extant metadata dict.
Here is the code for performing such an update, keep in mind that the client should now be refactored with friendlier facilities for performing this action including HTTP PATCH requests like rfc6902. Potentially this would manifest as
update_metadata (alias)
patch_metadata
put_metadata
import tiled
import copy
from tiled.client import from_uri
c = from_uri("http://localhost:8000",api_key="secret")
metadata = copy.deepcopy(dict(c[154705].metadata))
metadata["start"]["num_points"] = 2
c[154705].update_metadata(metadata=metadata)
This adds the ability for the raw blueskyRun and BlueskyEventStream objects to update their metadata, putting the onus on clients that invoke it to preserve existing metadata. Currently behaves like a
PUT
request, overwriting the existing data unless the client performs acopy.deepcopy()
of the extant metadata dict.Here is the code for performing such an update, keep in mind that the client should now be refactored with friendlier facilities for performing this action including HTTP
PATCH
requests likerfc6902
. Potentially this would manifest asFix #792