Skip to content

Commit

Permalink
Merge pull request #20 from CMCC-Foundation/v0.2.7.1-hotfix
Browse files Browse the repository at this point in the history
minor bugfixes
  • Loading branch information
gtramonte authored Jan 27, 2025
2 parents a6bf009 + 77b3109 commit 018b1af
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10597965.svg)](https://doi.org/10.5281/zenodo.10597965)

# geokube

## Description

**geokube** is an open source Python package for geoscience data analysis that provides the user with a simple application programming interface (API) for performing geospatial operations (e.g., extracting a bounding box or regridding) and temporal operations (e.g., resampling) on different types of scientific feature types like grids, profiles and points, using `xarray` data structures and xarray ecosystem frameworks such as `xesmf`.

## Authors
## Developers Team

- [Valentina Scardigno](https://github.com/vale95-eng)
- [Gabriele Tramonte](https://github.com/gtramonte)

**Lead Developers**:
### Former Developers

- [Marco Mancini](https://github.com/km4rcus)
- [Jakub Walczak](https://github.com/jamesWalczak)
Expand All @@ -17,27 +18,15 @@
## Installation

#### Requirements
You need to install xesmf and cartopy to use geokube. This can be done during the creation of conda virtual environment, as shown below
You need to install xesmf and cartopy to use some feature of geokube.

Add or append conda-forge channel
```bash
conda config --add channels conda-forge
```
or
```bash
conda config --append channels conda-forge
pip install geokube==v0.2.7.2
```

#### Conda Environment
Create virtual environment with installing xesmf and cartopy package
```bash
conda create -n geokube python=3.9 xesmf=0.6.2 cartopy -y
```
Activate virtual environment
```bash
conda activate geokube
```
Install geokube framework
#### Docker Image
Prebuilt Docker images of Geokube are available:

```bash
python setup.py install
docker pull rg.fr-par.scw.cloud/geokube/geokube:v0.2.7.2
```
2 changes: 1 addition & 1 deletion geokube/backend/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def open_datacube(
if engine == "zarr":
kwargs.setdefault("decode_coords", "all")
ds = geokube.core.datacube.DataCube.from_xarray(
xr.open_mfdataset(path, engine=engine, **kwargs),
xr.open_mfdataset(path, engine=engine, **kwargs) if 'http' not in path else xr.open_dataset(path, engine=engine, **kwargs),
id_pattern=id_pattern,
mapping=mapping,
)
Expand Down
2 changes: 1 addition & 1 deletion geokube/core/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def to_zarr(self, path, encoding: bool = True, **kwargs):

@geokube_logging
def to_csv(self, path, encoding: bool = True):
self.to_xarray(encoding=encoding).to_dataframe().drop(columns=['crs_latitude_longitude']).to_csv(path)
self.to_xarray(encoding=encoding).to_dataframe().drop(columns=['crs_latitude_longitude'], errors='ignore').to_csv(path)

def persist(self, path=None) -> str:
if path is None:
Expand Down
2 changes: 1 addition & 1 deletion geokube/core/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ def plot(
# Adding gridlines and Cartopy features (borders, coastline, lakes,
# land, ocean, rivers, or states) to all plot axes:
if has_cartopy_items:
axes = np.array(plot.axes, copy=False, ndmin=1)
axes = np.asarray(plot.axes)
if features:
for ax in axes.flat:
for feature in features:
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.7.1"
__version__ = "0.2.7.2"

0 comments on commit 018b1af

Please sign in to comment.