Skip to content

Conversation

@tacaswell
Copy link
Contributor

This is primarily useful if you want to obscure the origin of some data.

tacaswell added 2 commits May 17, 2021 22:18
This is primarily useful if you want to obscure the origin of some data.
@tacaswell
Copy link
Contributor Author

Example usage.

from databroker._drivers.msgpack import BlueskyMsgpackCatalog
from suitcase.msgpack import Serializer

def sanitize_start(doc):
    doc["beamline_id"] = "MAD"
    for k in ("group", "project"):
        doc.pop(k, None)

    doc["sample"]["type"] = "Cool Material"
    return doc

cat = BlueskyMsgpackCatalog('/tmp/some_source/*.msgpack')

target = Serializer('/tmp/targetl')

for name, doc in scrub([cat[i] for i in cat], 0, 1000, sanitize_start):
    target(name, doc)

test = BlueskyMsgpackCatalog("/tmp/*msgpack")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant