Skip to content

Commit

Permalink
removed so files
Browse files Browse the repository at this point in the history
  • Loading branch information
bbcho committed Dec 13, 2022
1 parent c61ea90 commit cb26214
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
__pycache__/
*.py[cod]

# # C extensions
# *.so
# C extensions
*.so

# Distribution / packaging
bin/
Expand Down
4 changes: 2 additions & 2 deletions notebooks/c-code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 3,
"id": "13428385",
"metadata": {},
"outputs": [
Expand All @@ -27,7 +27,7 @@
"output_type": "stream",
"text": [
"Half-life of theta in days = 87.3365447505531\n",
"2.7094292640686035\n"
"3.0940842628479004\n"
]
}
],
Expand Down
8 changes: 7 additions & 1 deletion src/risktools/_sims.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import multiprocessing as mp
import time
from numpy.random import default_rng
import platform

ST = time.time()

Expand Down Expand Up @@ -79,7 +80,12 @@ def simGBM(s0=10, mu=0, sigma=0.2, r=0, T=1, dt=1 / 252, sims=1000, eps=None):

def _import_csimOU():
dir = os.path.dirname(os.path.realpath(__file__)) + "/../" #+ "/c/"
lib = ctypes.cdll.LoadLibrary(dir + "simOU.so")

ext = ".so"
if platform.system() == 'Windows':
ext = ".dll"

lib = ctypes.cdll.LoadLibrary(dir + "simOU" + ext)
fun = lib.csimOU
fun.restype = None
fun.argtypes = [
Expand Down
Binary file modified src/simOU.so
Binary file not shown.

0 comments on commit cb26214

Please sign in to comment.