Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
edbda0b
add info on sensor configuration
j-atkins May 20, 2026
cd5b523
add list of available sensors to documentation
j-atkins May 20, 2026
4668e54
remove redundant TODO
j-atkins May 20, 2026
ae2d528
improve phrasing
j-atkins May 20, 2026
17d5b40
add details on sensor configurations to quickstart guide
j-atkins May 20, 2026
baa982a
update sail_the_ship with sensor configuration instructions
j-atkins May 20, 2026
a8a4978
enahnce phrasing
j-atkins May 20, 2026
6b3628e
add testing that docs match the code for sensor options, ensure instr…
j-atkins May 20, 2026
e23087b
add check that all instruments in code are addressed in sensor table
j-atkins May 20, 2026
a5ff3a4
update environments to pull parcels v4 alpha
j-atkins May 20, 2026
db44324
changed parcels logging api
j-atkins May 20, 2026
6f732d3
first wave of changes to the instrument logic with v4 logic, and part…
j-atkins May 20, 2026
71881cc
remove add dummy UV func, shouldn't be needed in v4 (?)
j-atkins May 20, 2026
62b2b1b
pull v4 from parcels/main
j-atkins May 20, 2026
38afc56
use AdvectionRK2
j-atkins May 20, 2026
573da9e
migrate fieldset ingestion protocol
j-atkins May 20, 2026
d13a036
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 20, 2026
5c7fd29
standardise variable naming for bathy data ingestion
j-atkins May 21, 2026
ee17230
env fixes
j-atkins May 21, 2026
72161df
Merge branch 'main' into migrate-v4
j-atkins May 21, 2026
92e74bd
add ipdb for devs
j-atkins May 21, 2026
0a83437
further changes to suit v4
j-atkins May 21, 2026
ca9e306
first steps considering handling depth positive up or down
j-atkins May 22, 2026
d4093cf
Merge branch 'migrate-v4' of github.com:OceanParcels/virtualship into…
j-atkins May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ documentation/full_sensor_list.md
documentation/copernicus_products.md
documentation/pre_download_data.md
documentation/example_copernicus_download.ipynb
documentation/full_sensor_list.md
```
32 changes: 19 additions & 13 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ setuptools = "*"
setuptools_scm = "*"

[package.run-dependencies] # Keep in sync with `pyproject.toml` and feedstock recipe
python = ">=3.10"
python = "3.11.*"
click = "*"
parcels = ">3.1.0"
pyproj = ">=3,<4"
sortedcontainers = "==2.4.0"
opensimplex = "==0.4.5"
numpy = ">=1,<2"
numpy = ">=2.1.0"
pydantic = ">=2,<3"
pyyaml = "*"
copernicusmarine = ">=2.2.2"
Expand All @@ -33,15 +32,25 @@ textual = "*"

[dependencies]
virtualship = { path = "." }
# Pre-install as conda packages to avoid PyPI source builds
netcdf4 = "*"
numpy = ">=2.1.0"
dask = "*"
zarr = ">=3"
ipdb = ">=0.13.13,<0.14"

[feature.py310.dependencies]
python = "3.10.*"
[pypi-dependencies]
parcels = { git = "https://github.com/Parcels-code/Parcels", branch = "main" }

[feature.py311.dependencies]
python = "3.11.*"
# Commented out whilst parcels v4 alpha only supports Python 3.11 (?)
# [feature.py310.dependencies]
# python = "3.10.*"

# [feature.py311.dependencies]
# python = "3.11.*"

[feature.py312.dependencies]
python = "3.12.*"
# [feature.py312.dependencies]
# python = "3.12.*"

[feature.test.dependencies]
pytest = "*"
Expand Down Expand Up @@ -98,11 +107,8 @@ lxml = "*"
typing = "mypy src/virtualship --install-types"

[environments]
default = { features = ["test", "notebooks", "typing", "pre-commit", "analysis"] }
default = { features = ["test", "notebooks", "typing", "pre-commit", "analysis"] }
test-latest = { features = ["test"], solve-group = "test" }
test-py310 = { features = ["test", "py310"] }
test-py311 = { features = ["test", "py311"] }
test-py312 = { features = ["test", "py312"] }
test-notebooks = { features = ["test", "notebooks"], solve-group = "test" }
analysis = { features = ["analysis"], solve-group = "analysis" }
docs = { features = ["docs"], solve-group = "docs" }
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "virtualship"
description = "Code for the Virtual Ship Classroom, where Marine Scientists can combine Copernicus Marine Data with an OceanParcels ship to go on a virtual expedition."
readme = "README.md"
dynamic = ["version"]
authors = [{ name = "oceanparcels.org team" }]
authors = [{ name = "parcels-code.org team" }]
requires-python = ">=3.10"
license = { file = "LICENSE" }
classifiers = [
Expand All @@ -26,11 +26,11 @@ classifiers = [
]
dependencies = [
"click",
"parcels >3.1.0",
"parcels >=4.0.0alpha",
"pyproj >= 3, < 4",
"sortedcontainers == 2.4.0",
"opensimplex == 0.4.5",
"numpy >=1, < 2",
"numpy >=2.1.0",
"pydantic >=2, <3",
"PyYAML",
"copernicusmarine >= 2.2.2",
Expand All @@ -40,7 +40,7 @@ dependencies = [
]

[project.urls]
Homepage = "https://oceanparcels.org/" # TODO: Update this to just be repo?
Homepage = "https://virtualship.parcels-code.org/"
Repository = "https://github.com/OceanParcels/virtualship"
Documentation = "https://virtualship.readthedocs.io/"
"Bug Tracker" = "https://github.com/OceanParcels/virtualship/issues"
Expand Down Expand Up @@ -69,7 +69,8 @@ filterwarnings = [
"error",
"default::DeprecationWarning",
"error::DeprecationWarning:virtualship",
"ignore:ParticleSet is empty.*:RuntimeWarning" # TODO: Probably should be ignored in the source code
"ignore:ParticleSet is empty.*:RuntimeWarning", # TODO: Probably should be ignored in the source code
"ignore:This is an alpha version of Parcels v4.*:UserWarning" # TODO: necessary whilst Parcels v4 is still alpha
]
log_cli_level = "INFO"
testpaths = [
Expand Down
9 changes: 4 additions & 5 deletions src/virtualship/cli/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
get_instrument_class,
)

# parcels logger (suppress INFO messages to prevent log being flooded)
external_logger = logging.getLogger("parcels.tools.loggers")
external_logger.setLevel(logging.WARNING)

# copernicusmarine logger (suppress INFO messages to prevent log being flooded)
# suppress INFO messages from copernicusmarine and parcels loggers; prevent log flooding
parcels_logger = logging.getLogger("parcels._logger")
parcels_logger.setLevel(logging.WARNING)
logging.getLogger("copernicusmarine").setLevel("ERROR")


Expand Down Expand Up @@ -202,6 +200,7 @@ def _run(
)

# execute simulation
# TODO: outpath will be Parquet with v4...
instrument.execute(
measurements=measurements,
out_path=expedition_dir.joinpath(RESULTS, f"{itype.name.lower()}.zarr"),
Expand Down
14 changes: 9 additions & 5 deletions src/virtualship/instruments/adcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import ClassVar

import numpy as np
from parcels import ParticleSet, ScipyParticle
from parcels import ParticleSet

from virtualship.instruments.base import Instrument
from virtualship.instruments.sensors import SensorType
Expand Down Expand Up @@ -35,9 +35,13 @@ class ADCP:
# =====================================================


def _sample_velocity(particle, fieldset, time):
particle.U, particle.V = fieldset.UV.eval(
time, particle.depth, particle.lat, particle.lon, applyConversion=False
def _sample_velocity(particles, fieldset):
particles.U, particles.V = fieldset.UV.eval(
particles.time,
particles.z,
particles.lat,
particles.lon,
applyConversion=False,
)


Expand Down Expand Up @@ -96,7 +100,7 @@ def simulate(self, measurements, out_path) -> None:
# build dynamic particle class from the active sensors
adcp_config = self.expedition.instruments_config.adcp_config
_ADCPParticle = build_particle_class_from_sensors(
adcp_config.sensors, _ADCP_NONSENSOR_VARIABLES, ScipyParticle
adcp_config.sensors, _ADCP_NONSENSOR_VARIABLES
)

bins = np.linspace(MAX_DEPTH, MIN_DEPTH, NUM_BINS)
Expand Down
Loading
Loading