forked from tsdev/spinw
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix it so example ipynb works. Update pyspinw CI Uses new matlab2python script from libpymcr to generate wrappers (and so pydoc works on spinw) Remove non-ascii characters in mtimesx which was confusing mcc Update Python __init__.py so initialized check is global Fix issue in addmatrix where Python could input an integer vector value breaking the code. Fix bug in sw_plotspec where handles were unassigned. * Add python command to compile all ctfs * Fix addmatrix test fail * Add wrappers for common Matlab plotting commands * Update change log. Fix addmatrix again. * Change compile ctf CI to use mcc_all.py
- Loading branch information
Showing
11 changed files
with
169 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from libpymcr.utils import checkPath | ||
import os | ||
import subprocess | ||
|
||
for v in ['R2021a', 'R2021b', 'R2022a', 'R2022b', 'R2023a', 'R2023b', 'R2024a']: | ||
print(f'Compiling for {v}') | ||
mlPath = checkPath(v) | ||
rv = subprocess.run([os.path.join(mlPath, 'bin', 'matlab'), '-batch', '"build_ctf; exit"'], capture_output=True) | ||
if rv.returncode != 0: | ||
print(rv.stdout.decode()) | ||
print(rv.stderr.decode()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
""" | ||
A set of wrappers for comman Matlab plotting commands so you don't have to use the m. prefix | ||
""" | ||
|
||
import pyspinw | ||
m = pyspinw.Matlab() | ||
|
||
def plot(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab plot() function | ||
""" | ||
return m.plot(*args, **kwargs) | ||
|
||
def subplot(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab subplot() function | ||
""" | ||
return m.subplot(*args, **kwargs) | ||
|
||
def xlim(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab xlim() function | ||
""" | ||
if args and isinstance(args[0], str): | ||
return m.xlim(*args, **kwargs) | ||
else: | ||
m.xlim(*args, **kwargs) | ||
|
||
def ylim(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab ylim() function | ||
""" | ||
if args and isinstance(args[0], str): | ||
return m.ylim(*args, **kwargs) | ||
else: | ||
m.ylim(*args, **kwargs) | ||
|
||
def xlabel(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab xlabel() function | ||
""" | ||
return m.xlabel(*args, **kwargs) | ||
|
||
def ylabel(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab ylabel() function | ||
""" | ||
return m.ylabel(*args, **kwargs) | ||
|
||
def set(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab set() function | ||
""" | ||
m.set(*args, **kwargs) | ||
|
||
def get(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab get() function | ||
""" | ||
return m.get(*args, **kwargs) | ||
|
||
def gca(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab gca() function | ||
""" | ||
return m.gca(*args, **kwargs) | ||
|
||
def gcf(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab gcf() function | ||
""" | ||
return m.gcf(*args, **kwargs) | ||
|
||
def legend(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab legend() function | ||
""" | ||
return m.legend(*args, **kwargs) | ||
|
||
def hold(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab hold() function | ||
""" | ||
m.hold(*args, **kwargs) | ||
|
||
def pcolor(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab pcolor() function | ||
""" | ||
return m.pcolor(*args, **kwargs) | ||
|
||
def contour(*args, **kwargs): | ||
""" | ||
Wrapper around Matlab contour() function | ||
""" | ||
return m.contour(*args, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters