Code: database

An interface to SQLite Databases to store Model components, experiments, analyses, etc…


class pyesm.core.database.ESMDatabase[source]

Bases: object

A Database to hold your simulations. This may be of interest if you need a automatic way to keep track of:

  • Which components your model was composed of

A SQL database is created at the file defined by the environmental variable $ESM_DB_PATH, otherwise the database object is created in memory.

register_component(Name, Version, LateralResolution, VerticalResolution, Timestep)[source]

Registers the component in the database table Component. The record takes the form of:

Component_ID Name Version Lateral_Res Vertical_Res Timestep
1 Component 0.0.0 None None None
2 ECHAM6 6.3.02p4 T63 L47 450
Parameters:
  • Name (str) – The name of the component to register in the database
  • Version (str) – The version of the component
  • LateralResolution (str) – The x/y resolution, or name describing it, e.g. T63, T255, 20km
  • VerticalResolution (str) – The z resolution
  • Timestep (str) – The timestep, ideally with units