From 157d1b5cc9ff5ab61a5b9cf4e5a311ed334a335f Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Fri, 16 May 2025 20:15:20 +0100 Subject: [PATCH 1/3] Install R bits required for validation --- Dockerfile | 7 +++++++ requirements.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1d4f490..ade1030 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,8 +15,11 @@ FROM ghcr.io/osgeo/gdal:ubuntu-small-3.10.0 RUN apt-get update -qqy && \ apt-get install -qy \ git \ + cmake \ python3-pip \ + r-base \ libpq-dev \ + libtirpc-dev \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/cache/apt/* @@ -29,6 +32,10 @@ RUN pip install gdal[numpy]==3.10.0 COPY requirements.txt /tmp/ RUN pip install -r /tmp/requirements.txt +RUN mkdir /root/R +ENV R_LIBS_USER=/root/R +RUN Rscript -e 'install.packages(c("lme4","lmerTest","emmeans"), repos="https://cloud.r-project.org")' + COPY ./ /root/star WORKDIR /root/star RUN chmod 755 ./scripts/run.sh diff --git a/requirements.txt b/requirements.txt index 8f1b0d3..7c9a8ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ geopandas postgis psycopg2 psutil +pymer4 pyproj scikit-image requests From 37aca753bd9a3d20b724da9878af51c5f08eb8df Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Fri, 16 May 2025 20:23:34 +0100 Subject: [PATCH 2/3] Fix typo in run.sh that stopped threats being processed --- scripts/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run.sh b/scripts/run.sh index 25d5668..2ce4863 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -108,7 +108,7 @@ echo "Generating threat task list..." python3 ./utils/threats_generator.py --input ${DATADIR}/species-info --datadir ${DATADIR} --output ${DATADIR}/threatbatch.csv echo "Generating threat rasters..." -littlejohn -j ${THREADS} -o ${DATADIR}/threatbatch.log -c ${DATADIR}/threatcatch.csv ${VIRTUAL_ENV}/bin/python3 -- ./threats/threat_processing.py +littlejohn -j ${THREADS} -o ${DATADIR}/threatbatch.log -c ${DATADIR}/threatbatch.csv ${VIRTUAL_ENV}/bin/python3 -- ./threats/threat_processing.py echo "Summarising threats..." python3 ./threats/threat_summation.py --threat_rasters ${DATADIR}/threat_rasters --output ${DATADIR}/threat_results From f56795c29b98f6d729d329f348fcc1b35e6b8dac Mon Sep 17 00:00:00 2001 From: Michael Dales Date: Fri, 16 May 2025 20:33:01 +0100 Subject: [PATCH 3/3] Add R to github action --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index aad935b..8fd17a0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -22,7 +22,7 @@ jobs: - name: Install system run: | apt-get update -qqy - apt-get install -y git python3-pip libpq5 libpq-dev + apt-get install -y git python3-pip libpq5 libpq-dev r-base libtirpc-dev - uses: actions/checkout@v4 with: submodules: 'true'