Skip to content

Commit

Permalink
updated so tests run
Browse files Browse the repository at this point in the history
  • Loading branch information
kthyng committed Jan 2, 2024
1 parent 1218131 commit 1782ad2
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
17 changes: 17 additions & 0 deletions ci/environment-py3.10.yml
Original file line number Diff line number Diff line change
@@ -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]
17 changes: 17 additions & 0 deletions ci/environment-py3.11.yml
Original file line number Diff line number Diff line change
@@ -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]
17 changes: 17 additions & 0 deletions ci/environment-py3.9.yml
Original file line number Diff line number Diff line change
@@ -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]
2 changes: 2 additions & 0 deletions particle_tracking_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion particle_tracking_manager/model_opendrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
17 changes: 17 additions & 0 deletions tests/test_configuration.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 1782ad2

Please sign in to comment.