From f9e82273b3b0f413cd3d5bc9d99e4d6ead8a276c Mon Sep 17 00:00:00 2001
From: Jameson Graef Rollins <jrollins@finestructure.net>
Date: Fri, 1 Jun 2018 17:55:41 -0700
Subject: [PATCH] struct: Struct.from_yaml class method to load from yaml
 string

---
 gwinc/struct.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gwinc/struct.py b/gwinc/struct.py
index 4e12cd60..0998fba4 100644
--- a/gwinc/struct.py
+++ b/gwinc/struct.py
@@ -202,6 +202,15 @@ class Struct(object):
         return c
 
 
+    @classmethod
+    def from_yaml(cls, y):
+        """Create Struct from YAML string.
+
+        """
+        d = yaml.load(y)
+        return cls.from_dict(d)
+
+
     @classmethod
     def from_matstruct(cls, s):
         """Create Struct from scipy.io.matlab mat_struct object.
-- 
GitLab