From 290a6be670e9e26c45d962c3d3690e5f91fd818f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Fri, 1 Mar 2019 14:55:59 +0200 Subject: [PATCH] Making some important enums available in python as python enums. Former-commit-id: 1257739451040f557e896a06747af8e383b797ff --- qpms/qpms_c.pyx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/qpms/qpms_c.pyx b/qpms/qpms_c.pyx index e09d0d5..ad1e84c 100644 --- a/qpms/qpms_c.pyx +++ b/qpms/qpms_c.pyx @@ -6,10 +6,31 @@ import cmath from qpms_cdefs cimport * cimport cython from cython.parallel cimport parallel, prange -#import enum +import enum # Here will be enum and dtype definitions; maybe move these to a separate file +class VSWFType(enum.IntEnum): + ELECTRIC = QPMS_VSWF_ELECTRIC + MAGNETIC = QPMS_VSWF_MAGNETIC + LONGITUDINAL = QPMS_VSWF_LONGITUDINAL + M = QPMS_VSWF_MAGNETIC + N = QPMS_VSWF_ELECTRIC + L = QPMS_VSWF_LONGITUDINAL +class VSWFNorm(enum.IntEnum): + #XU = QPMS_NORMALISATION_XU + #XU_CS = QPMS_NORMALISATION_XU_CS + NONE = QPMS_NORMALISATION_NONE + NONE_CS = QPMS_NORMALISATION_NONE_CS + POWER = QPMS_NORMALISATION_POWER + POWER_CS = QPMS_NORMALISATION_POWER_CS + SPHARM = QPMS_NORMALISATION_SPHARM + SPHARM_CS = QPMS_NORMALISATION_SPHARM_CS + UNDEF = QPMS_NORMALISATION_UNDEF + KRISTENSSON = QPMS_NORMALISATION_KRISTENSSON + KRISTENSSON_CS = QPMS_NORMALISATION_KRISTENSSON_CS + TAYLOR = QPMS_NORMALISATION_TAYLOR + TAYLOR_CS = QPMS_NORMALISATION_TAYLOR_CS import math # for copysign in crep methods #import re # TODO for crep methods?