-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add test data and initial test * Create python-package.yml * if it works and its not pretty ...it still works * add xr to test dependencies * use micromamba for deps * this is going to get pretty "move fast break stuff" * ...sigh * here we go again * I'm close.. * actually activate env * add nc engine * add test coverage * add coverage to actions * codecov config * idk anymore * eh? * double take? * disp test result * ?? * pls
- Loading branch information
Showing
45 changed files
with
58 additions
and
0 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,43 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Python package | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
"${SHELL}" <(curl -L micro.mamba.pm/install.sh) | ||
eval "$(micromamba shell hook --shell bash)" | ||
micromamba activate base | ||
micromamba install pytest-cov xarray netcdf4 -c conda-forge | ||
python -m pip install . | ||
- name: Test with pytest | ||
run: | | ||
eval "$(micromamba shell hook --shell bash)" | ||
micromamba activate base | ||
coverage run --source=pyxlma -m pytest tests/ | ||
coverage xml | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,15 @@ | ||
"""Test functionality of pyxlma.io""" | ||
|
||
from os import listdir | ||
from datetime import datetime as dt | ||
import xarray as xr | ||
from pyxlma.lmalib.io import read as lma_read | ||
|
||
|
||
def test_read_mf_dataset(): | ||
"""Test reading of multiple .dat.gz files into a single lma dataset""" | ||
files_to_read = listdir('examples/data/lma/') | ||
files_to_read = ['examples/data/lma/'+file for file in files_to_read] | ||
dataset, start_date = lma_read.dataset(files_to_read) | ||
assert start_date == dt(2023, 12, 24, 0, 57, 1) | ||
assert dataset == xr.open_dataset('examples/data/lma_netcdf/lma.nc') |