Skip to content

Commit

Permalink
Feature/issue 216 (#219)
Browse files Browse the repository at this point in the history
* Update depend versions and python to 3.10.
still some tests failing though.

* Updated python to 3.10

* put python version in quotes

* Update more versions

* update group handling for unicode data types

* update pipeline versions

* update pipeline versions

* Update pipeline upload-artifact

---------

Co-authored-by: Simon Liu <[email protected]>
Co-authored-by: sliu008 <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2023
1 parent 9560141 commit 9e263cf
Show file tree
Hide file tree
Showing 10 changed files with 1,023 additions and 1,612 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
- name: Install Poetry
uses: abatilo/[email protected]
with:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
-Dsonar.projectVersion=${{ env.software_version }}
-Dsonar.python.version=3.8,3.9,3.10
- name: Run Snyk as a blocking step
uses: snyk/actions/python-3.8@master
uses: snyk/actions/python-3.10@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
Expand All @@ -135,7 +135,7 @@ jobs:
--severity-threshold=high
--fail-on=all
- name: Run Snyk on Python
uses: snyk/actions/python-3.8@master
uses: snyk/actions/python-3.10@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- name: Build Python Artifact
run: |
poetry build
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: python-artifact
path: dist/*
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
${{ startsWith(github.ref, 'refs/heads/release/') }}
steps:
# Checks-out the develop branch
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: 'refs/heads/develop'
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
- name: Install Poetry
uses: abatilo/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
### Changed
- [pull/216](https://github.com/podaac/l2ss-py/pull/216): Updated all python to `python3.10-slim` and update all depencency versions
### Deprecated
### Removed
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion cmr/cmr.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# such information to foreign countries or providing access to foreign
# persons.

FROM python:3.8-slim
FROM python:3.10-slim

## Create a new user
RUN adduser --quiet --disabled-password --shell /bin/sh --home /home/dockeruser --gecos "" --uid 300 dockeruser
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# such information to foreign countries or providing access to foreign
# persons.

FROM python:3.9-slim
FROM python:3.10-slim

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
Expand Down
4 changes: 3 additions & 1 deletion podaac/subsetter/group_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,16 @@ def _rename_variables(dataset: xr.Dataset, base_dataset: nc.Dataset, start_date,
elif variable.dtype in ['|S1', '|S2']:
var_group.createVariable(new_var_name, variable.dtype, var_dims, fill_value=fill_value)
else:
if np.issubdtype(variable.dtype, np.unicode_):
comp_args["zlib"] = False
var_group.createVariable(new_var_name, variable.dtype, var_dims, fill_value=fill_value, **comp_args)

# Copy attributes
var_group.variables[new_var_name].setncatts(var_attrs)

# Copy data
var_group.variables[new_var_name].set_auto_maskandscale(False)
if variable.dtype in ['|S1', '|S2', '|S27']:
if variable.dtype in ['|S1', '|S2', '|S27'] or np.issubdtype(variable.dtype, np.unicode_):
var_group.variables[new_var_name][:] = variable.values
else:
var_group.variables[new_var_name][:] = var_data
Expand Down
2 changes: 1 addition & 1 deletion podaac/subsetter/subset.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def translate_coordinates(coords):
return translate_point(geometry) if isinstance(geometry, Point) else translate_polygon(geometry)
elif isinstance(geometry, MultiPolygon):
# Translate each polygon in the MultiPolygon
translated_polygons = [translate_longitude(subgeometry) for subgeometry in geometry]
translated_polygons = [translate_longitude(subgeometry) for subgeometry in geometry.geoms]
return MultiPolygon(translated_polygons)
else:
# Handle other geometry types as needed
Expand Down
Loading

0 comments on commit 9e263cf

Please sign in to comment.