aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/headers.py15
-rw-r--r--python/trade_dataclasses.py7
2 files changed, 12 insertions, 10 deletions
diff --git a/python/headers.py b/python/headers.py
index 13c9270a..904b5f3e 100644
--- a/python/headers.py
+++ b/python/headers.py
@@ -1,5 +1,14 @@
+from enum import Enum
from typing import Literal
+
+class DealType(Enum):
+ Bond = "BOND"
+ CDS = "CDX"
+ Swaption = "SWAPTION"
+ Termination = "TERM"
+
+
HEADERS_PRE = [
"Deal Type",
"Deal Id",
@@ -380,7 +389,7 @@ HEADERS = {
}
MTM_HEADERS = {
- "cds": [
+ DealType.CDS: [
"Swap ID",
"Allocation ID",
"Description",
@@ -450,7 +459,7 @@ MTM_HEADERS = {
"Alternate Trade ID",
"Definitions Type",
],
- "swaption": [
+ DealType.Swaption: [
"Swap ID",
"Broker Id",
"Trade ID",
@@ -483,7 +492,7 @@ MTM_HEADERS = {
"Swaption Quotation Rate Type",
"Effective Date",
],
- "termination": [
+ DealType.Termination: [
"Swap ID",
"Allocation ID",
"Description",
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 5f4a2eb3..fe06ce1d 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -193,13 +193,6 @@ def desc_str(index_type, series, tenor):
return f"ITRX EUR CDSI S{series} {tenor}Y"
-class DealType(Enum):
- Bond = "BOND"
- CDS = "CDX"
- Swaption = "SWAPTION"
- Termination = "TERM"
-
-
def is_default_init_field(cls, attr):
if hasattr(cls, attr):
default = getattr(cls, attr)