2121 subprocess .run ('apptainer' , check = False )
2222 PREFIX = f'apptainer run { pth } '
2323 PREFIX_MOUNT = f'apptainer run --home={ cwd } :/home/ { pth } '
24+ IPYTHON = f'{ PREFIX } ipython'
2425 PYTHON = f'{ PREFIX } python'
2526 PYTHON_MOUNT = f'{ PREFIX_MOUNT } python'
2627 PLINK = f'{ PREFIX } plink'
3738 f'--mount type=bind,source={ cwd } ,target={ cwd } ' +
3839 '--platform linux/amd64 ' +
3940 'ghcr.io/comorment/python3' )
41+ IPYTHON = f'{ PREFIX } ipython'
4042 PYTHON = f'{ PREFIX } python'
4143 PYTHON_MOUNT = f'{ PREFIX_MOUNT } python'
4244 PLINK = f'{ PREFIX } plink'
4648 except FileNotFoundError :
4749 # neither apptainer nor docker found, fall back to plain python
4850 # presumably because we are running on the client
51+ IPYTHON = 'ipython'
4952 PYTHON = 'python'
5053 PYTHON_MOUNT = 'python'
5154 PLINK = 'plink'
@@ -151,3 +154,8 @@ def test_python3_import_pandas_scipy_stats():
151154 call = f'{ PYTHON_MOUNT } -c "import pandas as pd; from scipy import *"'
152155 out = subprocess .run (call , shell = True , check = False )
153156 assert out .returncode == 0
157+
158+ def test_python3_ipython_magic ():
159+ call = f'{ IPYTHON } -c "get_ipython().run_line_magic(\' matplotlib\' , \' inline\' )"'
160+ out = subprocess .run (call , shell = True , check = False )
161+ assert out .returncode == 0
0 commit comments