From 0f40a196c3a988d8cf2078088ca81e7ebecf0302 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 10 Sep 2025 17:43:00 +0200 Subject: [PATCH 1/3] Add rattler build nightly action and recipe --- .github/ci/recipe.yaml | 71 +++++++++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 28 ++++++++++++++ .gitignore | 1 + 3 files changed, 100 insertions(+) create mode 100644 .github/ci/recipe.yaml create mode 100644 .github/workflows/nightly.yml diff --git a/.github/ci/recipe.yaml b/.github/ci/recipe.yaml new file mode 100644 index 000000000..70b1f4b3b --- /dev/null +++ b/.github/ci/recipe.yaml @@ -0,0 +1,71 @@ +# Recipe for https://github.com/prefix-dev/rattler-build used for nightly releases of Parcels +# during version 4 alpha development +# +# Adapted from the conda forge recipe +context: + name: parcels + version: 4.0.0alpha0 # The last number here needs to be bumped for each new alpha release + +package: + name: ${{ name|lower }} + version: ${{ version }} + +source: + path: ../.. + +build: + number: 0 + noarch: python + script: + - python -m pip install . -vv --no-deps --no-build-isolation + +requirements: + host: + - python 3.11.* + - pip + - setuptools + - setuptools_scm + - setuptools_scm_git_archive + - wheel + run: + - python >=3.11 + - cftime + - dask + - matplotlib-base >=2.0.2 + - netcdf4 >=1.1.9 + - numpy >=1.11 + - platformdirs + - psutil + - pymbolic + - pytest + - scipy >=0.16.0 + - trajan + - tqdm + - xarray >=0.10.8 + - zarr >=2.11.0,!=2.18.0,<3 + - uxarray>=2025.3.0 + - pyogrio # needed for geopandas (uxarray -> geoviews -> geopandas -> pyogrio, but for some reason conda doesn't pick it up automatically) + - pooch + +tests: + - python: + imports: + - parcels + +about: + homepage: https://github.com/OceanParcels/parcels + license: MIT + license_file: LICENSE.md + summary: Probably A Really Computationally Efficient Lagrangian Simulator + description: | + Parcels (Probably A Really Computationally Efficient Lagrangian Simulator) + is a set of Python classes and methods to create customisable particle + tracking simulations using output from Ocean Circulation models. + Parcels can be used to track passive and active particulates such as + water, nutrients, plankton, plastic and fish. + documentation: https://oceanparcels.org/ + repository: https://github.com/OceanParcels/parcels + +extra: + recipe-maintainers: + - VeckoTheGecko diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..19d159a7f --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,28 @@ +on: + workflow_dispatch: + +permissions: + contents: read + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build conda package + uses: prefix-dev/rattler-build-action@v0.2.19 + with: + recipe-path: .github/ci/recipe.yaml + + - name: Upload all packages + shell: bash + run: | + shopt -s nullglob + EXIT_CODE=0 + for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do + if ! rattler-build upload prefix -c parcels "${pkg}"; then + EXIT_CODE=1 + fi + done + exit $EXIT_CODE diff --git a/.gitignore b/.gitignore index f7e8ec2e7..a9dd99553 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ build/* docs/_build/* docs/_downloads +output *.log *.nc From a5da66766e6acc2133f13025b530c080c1c28c1e Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Wed, 10 Sep 2025 18:05:33 +0200 Subject: [PATCH 2/3] DOC: Add page to v4 about alpha installation --- docs/v4/index.md | 2 +- docs/v4/install.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 docs/v4/install.md diff --git a/docs/v4/index.md b/docs/v4/index.md index dadf18765..0b0507eef 100644 --- a/docs/v4/index.md +++ b/docs/v4/index.md @@ -17,7 +17,7 @@ Collaboration on v4 development is happening on the [Parcels v4 Project Board](h The pages below provide further background on the development of Parcels v4. You can think of this page as a "living" document as we work towards the release of v4. ```{toctree} - +install api nojit TODO diff --git a/docs/v4/install.md b/docs/v4/install.md new file mode 100644 index 000000000..989d8c4ec --- /dev/null +++ b/docs/v4/install.md @@ -0,0 +1,21 @@ +# Install an alpha version of Parcels v4 + +````{warning} +Before installing an alpha version of Parcels, we *highly* recommend creating a new environment so that doesn't affect package versions in your current environment (which you may be using for your research). + +Do the following to create a new environment: + +```sh +conda create -n parcels-v4-alpha python=3.11 +conda activate parcels-v4-alpha +``` + +```` + +During development of Parcels v4, we are uploading versions of the package to an [index on prefix.dev](https://prefix.dev/channels/parcels/packages/parcels). This allows users to easily install an unreleased version without having to do a [development install](../installation.rst)! Give it a spin! + +```sh +conda install -c https://repo.prefix.dev/parcels parcels +``` + +During the development of Parcels v4 we will be occasionally releasing these alpha package versions so that users can try them out. If you're installing Parcels normally (i.e., via Conda forge) you can continue to do so without disruption. From 102381a94869c720a51c6e36ea149a9eb256fad8 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 11 Sep 2025 10:11:11 +0200 Subject: [PATCH 3/3] DOC: Copy edits to v4 alpha installation Rename `install` to `installation` (so normal installation instructions are at `installation` and v4 installation is at `v4/installation`) --- docs/v4/index.md | 2 +- docs/v4/{install.md => installation.md} | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) rename docs/v4/{install.md => installation.md} (63%) diff --git a/docs/v4/index.md b/docs/v4/index.md index 0b0507eef..4b85ef095 100644 --- a/docs/v4/index.md +++ b/docs/v4/index.md @@ -17,7 +17,7 @@ Collaboration on v4 development is happening on the [Parcels v4 Project Board](h The pages below provide further background on the development of Parcels v4. You can think of this page as a "living" document as we work towards the release of v4. ```{toctree} -install +installation api nojit TODO diff --git a/docs/v4/install.md b/docs/v4/installation.md similarity index 63% rename from docs/v4/install.md rename to docs/v4/installation.md index 989d8c4ec..b7756f225 100644 --- a/docs/v4/install.md +++ b/docs/v4/installation.md @@ -1,21 +1,20 @@ # Install an alpha version of Parcels v4 -````{warning} +During development of Parcels v4, we are uploading versions of the package to an [index on prefix.dev](https://prefix.dev/channels/parcels/packages/parcels). This allows users to easily install an unreleased version without having to do a [development install](../installation.rst)! Give it a spin! + +```{warning} Before installing an alpha version of Parcels, we *highly* recommend creating a new environment so that doesn't affect package versions in your current environment (which you may be using for your research). -Do the following to create a new environment: +You can see what your current environment is by doing `conda env list` and seeing which environment has a `*` next to it. At any point, you can use `conda activate ...` (replacing `...` with the name that had the `*` next to it) to return to your environment with version 3 of Parcels. -```sh -conda create -n parcels-v4-alpha python=3.11 -conda activate parcels-v4-alpha ``` -```` - -During development of Parcels v4, we are uploading versions of the package to an [index on prefix.dev](https://prefix.dev/channels/parcels/packages/parcels). This allows users to easily install an unreleased version without having to do a [development install](../installation.rst)! Give it a spin! +Do the following to create a new environment (called `parcels-v4-alpha`) with an alpha version of Parcels installed: ```sh +conda create -n parcels-v4-alpha python=3.11 +conda activate parcels-v4-alpha conda install -c https://repo.prefix.dev/parcels parcels ``` -During the development of Parcels v4 we will be occasionally releasing these alpha package versions so that users can try them out. If you're installing Parcels normally (i.e., via Conda forge) you can continue to do so without disruption. +During the development of Parcels v4 we will be occasionally releasing these alpha package versions so that users can try them out. If you're installing Parcels normally (i.e., via Conda forge) you will receive version 3 of Parcels as usual until version 4 is officially released.