Skip to content

Commit

Permalink
fix: examples files can import local files.
Browse files Browse the repository at this point in the history
  • Loading branch information
paquiteau committed Jul 1, 2024
1 parent 9b2c9f8 commit da5fe60
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""

import sys
import runpy
from pathlib import Path

Expand Down Expand Up @@ -45,6 +46,7 @@ class ScriptItem(pytest.Item):

def runtest(self):
"""Run the script as a test."""
sys.path.insert(0, str(self.path.parent))
runpy.run_path(str(self.path))

def repr_failure(self, excinfo):
Expand Down
2 changes: 1 addition & 1 deletion examples/example_2D_trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import mrinufft as mn
import mrinufft.trajectories.maths as mntm
from mrinufft import display_2D_trajectory
from .utils import show_argument, show_trajectory
from utils import show_argument, show_trajectory


# %%
Expand Down
2 changes: 1 addition & 1 deletion examples/example_3D_trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Internal
import mrinufft as mn
from mrinufft import display_2D_trajectory, display_3D_trajectory
from .utils import show_argument, show_trajectory
from utils import show_argument, show_trajectory


# %%
Expand Down
2 changes: 1 addition & 1 deletion examples/example_trajectory_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import mrinufft.trajectories.tools as tools

from mrinufft.trajectories.utils import KMAX
from .utils import show_argument, show_trajectory
from utils import show_argument, show_trajectory


# %%
Expand Down

0 comments on commit da5fe60

Please sign in to comment.