-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from umr-lops/replace-datatree-xarray
first attempt to replace xarray-datatree by xarray native DataTrees
- Loading branch information
Showing
39 changed files
with
1,658 additions
and
1,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
detect-skip-ci-trigger: | ||
name: "Detect CI Trigger: [skip-ci]" | ||
if: | | ||
github.repository == 'umr-lops/utils_xsarslc_l1b' | ||
&& ( | ||
github.event_name == 'push' || github.event_name == 'pull_request' | ||
) | ||
runs-on: ubuntu-latest | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: xarray-contrib/ci-trigger@v1 | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
|
||
ci: | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
needs: detect-skip-ci-trigger | ||
|
||
if: needs.detect-skip-ci-trigger.outputs.triggered == 'false' | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# need to fetch all tags to get a correct version | ||
fetch-depth: 0 # fetch all branches and tags | ||
|
||
- name: Setup environment variables | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
echo "CONDA_ENV_FILE=ci/requirements/environment.yaml" >> $GITHUB_ENV | ||
- name: Setup micromamba | ||
uses: mamba-org/setup-micromamba@v2 | ||
with: | ||
environment-file: ${{ env.CONDA_ENV_FILE }} | ||
environment-name: slcl1butils-tests | ||
cache-environment: true | ||
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | ||
create-args: >- | ||
python=${{matrix.python-version}} | ||
- name: Install slcl1butils | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Import slcl1butils | ||
run: | | ||
python -c "import slcl1butils" | ||
- name: Run tests | ||
run: | | ||
python -m pytest --cov=slcl1butils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ dependencies: | |
- geoviews | ||
- fsspec | ||
- numpy | ||
- xarray-datatree | ||
- xarray | ||
- rasterio | ||
- rioxarray | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import logging | ||
import os | ||
from importlib import reload | ||
|
||
from slcl1butils.get_config import get_conf | ||
from slcl1butils.scripts.do_IW_L1C_SAFE_from_L1B_SAFE import do_L1C_SAFE_from_L1B_SAFE | ||
from slcl1butils.utils import get_test_file | ||
|
||
reload(logging) | ||
logging.basicConfig(level=logging.INFO) | ||
conf = get_conf() | ||
one_safe_l1b = get_test_file( | ||
"S1B_IW_XSP__1SDV_20210328T055258_20210328T055325_026211_0320D4_DC31_A13.SAFE" | ||
) | ||
ancillary_datasets = conf["auxilliary_dataset"] | ||
ancillary_datasets.pop("ww3hindcast_spectra", None) | ||
ancillary_datasets.pop("ww3_global_yearly_3h", None) | ||
full_safe_files = [one_safe_l1b] | ||
version = "0.1" | ||
for ffi, full_safe_file in enumerate(full_safe_files): | ||
print("%i/%i" % (ffi, len(full_safe_files))) | ||
print("===") | ||
print(os.path.basename(full_safe_file)) | ||
print("===") | ||
ret = do_L1C_SAFE_from_L1B_SAFE( | ||
full_safe_file, | ||
version=version, | ||
outputdir=conf["iw_outputdir"], | ||
ancillary_list=ancillary_datasets, | ||
dev=True, | ||
overwrite=True, | ||
) | ||
logging.info("new file: %s", ret) | ||
logging.info("high level check: OK (successful)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
|
||
__all__ = ['utils','compute','plotting','scripts','coloc','legacy_ocean'] | ||
__all__ = ["utils", "compute", "plotting", "scripts", "coloc", "legacy_ocean"] | ||
try: | ||
from importlib import metadata | ||
except ImportError: # for Python<3.8 | ||
except ImportError: # for Python<3.8 | ||
import importlib_metadata as metadata | ||
__version__ = metadata.version('slcl1butils') | ||
__version__ = metadata.version("slcl1butils") |
Oops, something went wrong.