#!/bin/env python3
import imas,os


try:
    db_entry = imas.DBEntry(backend_id=imas.ids_defs.MDSPLUS_BACKEND,
                            db_name="tutorial_db",
                            shot=1, run=1)
    db_entry.create()
    factory = imas.IDSFactory()
    ids = factory.core_profiles()
    ids.ids_properties.homogeneous_time = imas.ids_defs.IDS_TIME_MODE_HETEROGENEOUS
    ids.ids_properties.comment='START:'
    db_entry.put( ids )
    db_entry.close()

except Exception as exc:
    print("\n\n An error while creating database with tutorial test data occurred!\n\n")
    exit(1)


print("Database with tutorial test data successfully created!")

