Skip to content

Commit 4de25aa

Browse files
committed
[Enh] Specialize runtime for SPM
1 parent ed55912 commit 4de25aa

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

spm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from mpython import (
2-
Runtime,
32
MatlabClass,
43
MatlabFunction,
54
Cell,
65
Struct,
76
Array,
87
SparseArray,
98
)
9+
from ._runtime import Runtime
1010
from ._version import __version__
1111
from .file_array import file_array
1212
from .gifti import gifti

spm/_runtime.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from mpython.runtime import Runtime as RuntimeBase
2+
3+
4+
class Runtime(RuntimeBase):
5+
"""
6+
Runtime specialization that imports the correct CTF.
7+
"""
8+
9+
@classmethod
10+
def _import_runtime(cls):
11+
import spm_runtime
12+
return spm_runtime
13+
14+
15+
class RuntimeMixin:
16+
"""
17+
Mixin that SPM classes must inherit so that they can call the
18+
correct runtime.
19+
"""
20+
21+
@classmethod
22+
def _runtime(cls):
23+
return Runtime

0 commit comments

Comments
 (0)