def writeMetadata(self, metadata):
    """Writes new metadata to disk

    :param metadata: a JSON-serializable dict of node metadata
    """
    self.timeStep = int(metadata['timeStep'])
    with open(self.metadataFile, 'w') as fh:
      json.dump(metadata, fh)