瀏覽代碼

Python binder fix for reading in files

master
Trevor Irons 5 年之前
父節點
當前提交
cfc324368a
共有 2 個檔案被更改,包括 9 行新增1 行删除
  1. 8
    1
      include/KernelV0.h
  2. 1
    0
      python/pyMerlin.cpp

+ 8
- 1
include/KernelV0.h 查看文件

@@ -134,7 +134,7 @@ namespace Lemma {
134 134
          *   used in Python wrapping
135 135
          */
136 136
         static std::shared_ptr<KernelV0> DeSerialize( const std::string& node ) {
137
-            return KernelV0::DeSerialize(YAML::Load(node));
137
+            return KernelV0::DeSerialize(YAML::LoadFile(node));
138 138
         }
139 139
 
140 140
         // ====================  OPERATORS     =======================
@@ -161,6 +161,13 @@ namespace Lemma {
161 161
         void AlignWithAkvoDataset( const YAML::Node& node ) ;
162 162
 
163 163
         /**
164
+         *  Aligns the kernel pulse settings with an Akvo Processed dataset.
165
+         */
166
+        void AlignWithAkvoDataset( const std::string& file ) {
167
+            AlignWithAkvoDataset( YAML::LoadFile(file) );
168
+        }
169
+
170
+        /**
164 171
          *   Assign transmiter coils
165 172
          */
166 173
         inline void PushCoil( const std::string& label, std::shared_ptr<PolygonalWireAntenna> ant ) {

+ 1
- 0
python/pyMerlin.cpp 查看文件

@@ -70,6 +70,7 @@ PYBIND11_MODULE(Merlin, m) {
70 70
             .def("CalculateK0", &Lemma::KernelV0::CalculateK0, "Calculates an intial amplitude kernel")
71 71
 
72 72
             //.def("AlignWithAkvoDataset", &Lemma::KernelV0::AlignWithAkvoDataset, "Aligns the kernel parameters with a dataset")
73
+            .def("AlignWithAkvoDataset", py::overload_cast< const std::string& >(&Lemma::KernelV0::AlignWithAkvoDataset), "Aligns Kernel pulse with specified dataset file")
73 74
 
74 75
 
75 76
 

Loading…
取消
儲存