diff --git a/ci/environment-py3.10.yml b/ci/environment-py3.10.yml new file mode 100644 index 0000000..b13a647 --- /dev/null +++ b/ci/environment-py3.10.yml @@ -0,0 +1,17 @@ +name: test_env_particle-tracking-manager +channels: + - conda-forge +dependencies: + - python=3.10 + ############## These will have to be adjusted to your specific project + - adios_db + - aiohttp + - numpy + - scipy + - xarray + ############## + - pytest + - pip: + - codecov + - pytest-cov + - coverage[toml] \ No newline at end of file diff --git a/ci/environment-py3.11.yml b/ci/environment-py3.11.yml new file mode 100644 index 0000000..5b760ee --- /dev/null +++ b/ci/environment-py3.11.yml @@ -0,0 +1,17 @@ +name: test_env_particle-tracking-manager +channels: + - conda-forge +dependencies: + - python=3.11 + ############## These will have to be adjusted to your specific project + - adios_db + - aiohttp + - numpy + - scipy + - xarray + ############## + - pytest + - pip: + - codecov + - pytest-cov + - coverage[toml] \ No newline at end of file diff --git a/ci/environment-py3.9.yml b/ci/environment-py3.9.yml new file mode 100644 index 0000000..d4d0873 --- /dev/null +++ b/ci/environment-py3.9.yml @@ -0,0 +1,17 @@ +name: test_env_particle-tracking-manager +channels: + - conda-forge +dependencies: + - python=3.9 + ############## These will have to be adjusted to your specific project + - adios_db + - aiohttp + - numpy + - scipy + - xarray + ############## + - pytest + - pip: + - codecov + - pytest-cov + - coverage[toml] \ No newline at end of file diff --git a/particle_tracking_manager/__init__.py b/particle_tracking_manager/__init__.py index c8677b2..82b5079 100644 --- a/particle_tracking_manager/__init__.py +++ b/particle_tracking_manager/__init__.py @@ -1,4 +1,6 @@ """Particle Tracking Manager.""" +from .model_opendrift import OpenDrift + import cmocean cmap = cmocean.tools.crop_by_percent(cmocean.cm.amp, 20, which='max', N=None) diff --git a/particle_tracking_manager/model_opendrift.py b/particle_tracking_manager/model_opendrift.py index 69fe37c..8f2cdad 100644 --- a/particle_tracking_manager/model_opendrift.py +++ b/particle_tracking_manager/model_opendrift.py @@ -10,7 +10,7 @@ from opendrift.models.oceandrift import Lagrangian3DArray from opendrift.models.openoil import OpenOil -from the_manager import ParticleTrackingManager +from .the_manager import ParticleTrackingManager class OpenDrift(ParticleTrackingManager): diff --git a/tests/test_configuration.py b/tests/test_configuration.py new file mode 100644 index 0000000..52efcb5 --- /dev/null +++ b/tests/test_configuration.py @@ -0,0 +1,17 @@ +"""Test configuration methods.""" + +import particle_tracking_manager as ptm +import os +import pytest + +def test_drift_models(): + os.system("python cli.py driftmodel=Leeway oceanmodel=None") + os.system("python cli.py driftmodel=OceanDrift oceanmodel=None") + os.system("python cli.py driftmodel=LarvalFish oceanmodel=None") + os.system("python cli.py driftmodel=OpenOil oceanmodel=None") + +def test_order(): + + with pytest.raises(KeyError): + manager = ptm.OpenDrift() + manager.seed() \ No newline at end of file