Skip to content

Instantly share code, notes, and snippets.

@voycey
Last active July 19, 2021 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voycey/a89de679c26c185bcf19240ff5d731c1 to your computer and use it in GitHub Desktop.
Save voycey/a89de679c26c185bcf19240ff5d731c1 to your computer and use it in GitHub Desktop.
NEM12 Transformation
mapped_readings = ApplyMapping.apply(frame=datasource, mappings=[
("meter_id", "string", "meter_id", "string"),
("period_start", "string", "period_start", "string"),
("period_end", "string", "period_end", "string"),
("e1", "double", "export_interval.e1", "double"),
("e2", "double", "export_interval.e2", "double"),
("e3", "double", "export_interval.e3", "double"), #NB: this can technically have many more circuits
("quality_method", "string", "quality_method", "string"),
("event", "string", "event", "string"),
("b1", "double", "import_interval.b1", "double"),
("b2", "double", "import_interval.b2", "double"),
("k1", "double", "import_reactive.k1", "double"),
("k2", "double", "import_reactive.k2", "double"),
("q1", "double", "export_reactive.q1", "double"),
("q2", "double", "export_reactive.q2", "double")
], transformation_ctx="mapped_readings")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment