Skip to content

Commit

Permalink
Merge pull request #19 from CMCC-Foundation/v0.2.7.1-hotfix
Browse files Browse the repository at this point in the history
V0.2.7.1 hotfix
  • Loading branch information
gtramonte authored Jan 9, 2025
2 parents 26c1794 + c41290b commit a6bf009
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-push-docker-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Build geokube-base Docker image and push to geokube-base container registr

on:
pull_request:
paths:
- requirements.txt
- Dockerfile.base
workflow_dispatch:

jobs:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-push-docker_pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Build geokube Docker image and push to geokube container registry

on:
workflow_run:
workflows: [ 'build-base' ]
types: [ completed ]
pull_request:
paths:
- Dockerfile
- 'geokube/**'
workflow_dispatch:

jobs:
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#FROM rg.fr-par.scw.cloud/geokube/geokube-base:2024.05.03.08.14
#new version with Zarr support
FROM rg.fr-par.scw.cloud/geokube/geokube-base:2024.09.26.09.01
FROM rg.fr-par.scw.cloud/geokube/geokube-base:2025.01.09.14.31

COPY dist/geokube-0.2.7a4-py3-none-any.whl /
RUN pip install /geokube-0.2.7a4-py3-none-any.whl --break-system-packages
RUN rm /geokube-0.2.7a4-py3-none-any.whl
ADD . /opt/geokube
RUN pip install /opt/geokube --break-system-packages
RUN rm -rf /opt/geokube

#ENV LD_LIBRARY_PATH=/opt/conda/x86_64-conda-linux-gnu/lib:/usr/lib/x86_64-linux-gnu
WORKDIR /
6 changes: 3 additions & 3 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ ENV ESMF_DIR=/opt/esmf
ENV ESMF_F90COMPILEOPTS=-fallow-argument-mismatch

WORKDIR /opt/esmf
RUN git checkout v8.6.1
RUN git checkout v8.8.0
RUN make -j4

ENV ESMFMKFILE=/opt/esmf/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk

RUN pip install numpy setuptools==74.1.2 --break-system-packages
RUN pip install numpy setuptools==75.8.0 --break-system-packages

WORKDIR /opt/esmf/src/addon/esmpy
RUN pip install . --break-system-packages

RUN pip install git+https://github.com/pangeo-data/xesmf.git --break-system-packages #@v0.6.3
RUN pip install git+https://github.com/pangeo-data/xesmf.git@v0.8.8 --break-system-packages #@v0.6.3
2 changes: 1 addition & 1 deletion geokube/backend/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _get_engine(path: list | str):
return "rasterio"
elif ext == ".zarr":
return "zarr"
elif path.startswith('http://') or path.startswith('https://'):
elif path.startswith('http') or path.startswith('https'):
return "zarr"
else:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion geokube/core/coordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def to_dict(self, unique_values=False):
time_unit = time_offset.name
time_step = time_offset.n
axis_specific_details = {
"time_unit": FREQ_CODES[time_unit],
"time_unit": FREQ_CODES[time_unit.upper()],
"time_step": time_step,
}
elif (
Expand Down
3 changes: 2 additions & 1 deletion geokube/core/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ def to_netcdf(self, path, encoding: bool = True):
def to_zarr(self, path, encoding: bool = True, **kwargs):
kube = self.to_xarray(encoding=encoding)
for var in kube:
del kube[var].encoding['chunks']
if 'chunks' in kube[var].encoding.keys():
del kube[var].encoding['chunks']
kube.chunk('auto').to_zarr(path,**kwargs)

@geokube_logging
Expand Down
4 changes: 2 additions & 2 deletions geokube/core/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ def _check_and_roll_longitude(self, ds, indexers) -> xr.Dataset:
def to_regular(self):
# Infering latitude and longitude steps from the x and y coordinates.
if isinstance(self.domain.crs, RotatedGeogCS):
lat_step = self.y.values.ptp() / (self.y.values.size - 1)
lon_step = self.x.values.ptp() / (self.x.values.size - 1)
lat_step = np.ptp(self.y.values) / (self.y.values.size - 1)
lon_step = np.ptp(self.x.values) / (self.x.values.size - 1)
else:
raise NotImplementedError(
f"'{type(self.domain.crs).__name__}' is not supported as a "
Expand Down
2 changes: 1 addition & 1 deletion geokube/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.7a4"
__version__ = "0.2.7.1"
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
cf_units==3.2.0
cf_units==3.3.0
cartopy
numpy==1.26.4
pandas==2.1.4
numpy==2.0.2
pandas==2.2.3
netCDF4
scipy
xarray==2024.09.0
dask==2024.9.0
xarray==2025.1.0
dask==2024.12.1
geopandas
#esmpy==8.2.0
#xesmf==0.7.1
intake==2.0.7
hvplot
pytest
dask[distributed]
zarr
zarr==2.18.4
rioxarray
plotly
pyarrow
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
],
python_requires=">=3.7",
python_requires=">=3.10",
license="Apache License, Version 2.0",
package_data={"geokube": ["static/css/*.css", "static/html/*.html"]},
)

0 comments on commit a6bf009

Please sign in to comment.