Skip to content

Commit

Permalink
Refactor file paths in examples to use relative paths for better port…
Browse files Browse the repository at this point in the history
…ability
  • Loading branch information
fbriol committed Jun 29, 2024
1 parent bcb8d1d commit 109020a
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions examples/ex_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import pyfes

# %%
MODEL = str(pathlib.Path().absolute().parent / 'src' / 'python' / 'pyfes' /
'tests' / 'dataset' / 'fes_2014.nc')
MODEL = str(pathlib.Path().absolute().parent / 'tests' / 'python' / 'dataset' /
'fes_2014.nc')


# %%
Expand Down
4 changes: 2 additions & 2 deletions examples/ex_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

# %%
# First we create an environment variable to store the path to the model file.
os.environ['DATASET_DIR'] = str(pathlib.Path().absolute().parent / 'src' /
'python' / 'pyfes' / 'tests' / 'dataset')
os.environ['DATASET_DIR'] = str(pathlib.Path().absolute().parent / 'tests' /
'python' / 'dataset')

# %%
# Now we need to create the instances of the model used to calculate the ocean
Expand Down
4 changes: 2 additions & 2 deletions examples/ex_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

# %%
# First we create an environment variable to store the path to the model file.
os.environ['DATASET_DIR'] = str(pathlib.Path().absolute().parent / 'src' /
'python' / 'pyfes' / 'tests' / 'dataset')
os.environ['DATASET_DIR'] = str(pathlib.Path().absolute().parent / 'tests' /
'python' / 'dataset')

# %%
# Now we need to create the instances of the model used to calculate the ocean
Expand Down
3 changes: 1 addition & 2 deletions tests/python/core/test_astronomic_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
# BSD-style license that can be found in the LICENSE file.
import datetime

import pytest

from pyfes import core
import pytest


def test_astronomic_angle():
Expand Down
3 changes: 1 addition & 2 deletions tests/python/core/test_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import numpy
from pyfes import core
import pytest

from pyfes import core


def test_axis():
points = numpy.arange(0, 10, 0.1)
Expand Down
3 changes: 1 addition & 2 deletions tests/python/core/test_evaluate_tide.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

import netCDF4
import numpy
import pytest

from pyfes import core
from pyfes.leap_seconds import get_leap_seconds
import pytest

DATASET = pathlib.Path(__file__).parent.parent / 'dataset'

Expand Down
3 changes: 1 addition & 2 deletions tests/python/core/test_tidal_model_cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import netCDF4
import numpy
import pytest

from pyfes import core
import pytest

S2 = pathlib.Path(__file__).parent.parent / 'dataset' / 'S2_tide.nc'

Expand Down
3 changes: 1 addition & 2 deletions tests/python/core/test_wave_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import pathlib

import netCDF4
import pytest

from pyfes import core
from pyfes.leap_seconds import get_leap_seconds
import pytest

FES_TIDE_TIME_SERIES = pathlib.Path(
__file__).parent.parent / 'dataset' / 'fes_tide_time_series.nc'
Expand Down
1 change: 0 additions & 1 deletion tests/python/test_leap_seconds.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# BSD-style license that can be found in the LICENSE file.
"""Testing leap seconds."""
import numpy

from pyfes.leap_seconds import get_leap_seconds


Expand Down
3 changes: 1 addition & 2 deletions tests/python/test_lgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import pathlib

import numpy

import pyfes.config as config_handler
from pyfes import evaluate_tide
import pyfes.config as config_handler

DATASET = pathlib.Path(__file__).parent / 'dataset'

Expand Down

0 comments on commit 109020a

Please sign in to comment.