Ver Fonte

Added configuration file

Snow há 8 anos atrás
pai
commit
b853f7bd04
2 ficheiros alterados com 28 adições e 0 exclusões
  1. 19 0
      hdpg1d/config.json
  2. 9 0
      hdpg1d/preprocess.py

+ 19 - 0
hdpg1d/config.json

@@ -0,0 +1,19 @@
+{
+    "maps": [
+        {
+            "id": "blabla",
+            "iscategorical": "0"
+        },
+        {
+            "id": "blabla",
+            "iscategorical": "0"
+        }
+    ],
+    "masks": {
+        "id": "valore"
+    },
+    "om_points": "value",
+    "parameters": {
+        "id": "valore"
+    }
+}

+ 9 - 0
hdpg1d/preprocess.py

@@ -1,7 +1,16 @@
+import json
 import numpy as np
+import os
 from collections import namedtuple
 from scipy.linalg import block_diag
 
+for loc in os.curdir, os.path.expanduser("~"), "/etc/hdpg1d":
+    try:
+        with open(os.path.join(loc, "config.json")) as source:
+            data = json.load(source)
+    except IOError:
+        pass
+
 
 def shape(x, p):
     """generate p shape functions and its first order derivative