Source

yt.hub_examples / upload_vertices.py

Full commit
from yt.mods import *
from yt.utilities.minimal_representation import MinimalRepresentation

class MinimalVerticesRepresentation(MinimalRepresentation):

    _attr_list = ("vertices", "output_hash", "field")
    type = "vertices"

    def __init__(self, arr, pf, field):
        self.vertices = arr
        self.output_hash = pf._hash()
        self.field = field

    def _generate_post(self):
        nobj = self._return_filtered_object(("vertices",))
        metadata = nobj._attrs
        chunks = [(self.field, self.vertices)]
        return (metadata, ('vertex_data', chunks))

pf = load("MYDATA")
pf._mrep.upload()
dd = pf.h.all_data()
iso = dd.extract_isocontours("Density", 1e-27)

MVR = MinimalVerticesRepresentation(iso, pf, "Density")
MVR.upload()