Skip to content

Commit

Permalink
Update to support Spacepy 0.5.0 vesion (#38)
Browse files Browse the repository at this point in the history
* remove hcore

* Add version pins to pyproject.toml

* Add version pinning to spacepy

* Add how to use Calibration Workflow information section

* Add Calibration workflow documentation

* revert depth

* Test binaries

* Test process file

* Change back to og hermes_core

* Clean up workflows

* Change test to only check if file is empty
  • Loading branch information
dbarrous authored Apr 10, 2024
1 parent b869d67 commit 20380d8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 69 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- cron: 0 0 * * * # Scheduled run every day at midnight
jobs:
build:

runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
Expand All @@ -30,10 +29,7 @@ jobs:
- name: Install dependencies
run: |
pip install pip setuptools wheel --upgrade
# Install spacepy without build isolation to avoid issues with numpy
pip install numpy==1.26.3
pip install spacepy==0.4.1 --no-build-isolation
python -m pip install -e '.[style]'
python -m pip install -e .[style]
- name: Lint with Black
run: |
black --check --diff hermes_eea
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ on:
workflow_dispatch: # For on demand runs
schedule:
- cron: 0 0 * * * # Scheduled run every day at midnight

jobs:
build:
runs-on: ubuntu-latest
container:
image: public.ecr.aws/w5r9l1c8/dev-swsoc-docker-lambda-base:latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,10 +29,7 @@ jobs:
- name: Install dependencies
run: |
pip install pip setuptools wheel --upgrade
# Install spacepy without build isolation to avoid issues with numpy
pip install numpy==1.26.3
pip install spacepy==0.4.1 --no-build-isolation
python -m pip install -e '.[docs]'
python -m pip install -e .[docs]
- name: Build docs
working-directory: ./docs
run: make html
54 changes: 1 addition & 53 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- cron: 0 0 * * * # Scheduled run every day at midnight
jobs:
build:

runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
Expand All @@ -30,61 +29,10 @@ jobs:
- name: Install dependencies
run: |
pip install pip setuptools wheel --upgrade
# Install spacepy without build isolation to avoid issues with numpy
pip install numpy==1.26.3
pip install spacepy==0.4.1 --no-build-isolation
pip install -e .[test]
if: ${{ !(matrix.platform == 'windows-latest' && matrix.python-version == '3.11') }}

- name: Install CDF library on Ubuntu
run: |
wget https://sdc-aws-support.s3.amazonaws.com/cdf-binaries/latest.zip
unzip latest.zip
echo "CDF_LIB=cdf/lib" >> $GITHUB_ENV
if: ${{(matrix.platform == 'ubuntu-latest')}}

- name: Install CDF library on MacOS
run: |
wget https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/cdf39_0/macosx/CDF3_9_0-binary-signed.pkg
sudo installer -pkg CDF3_9_0-binary-signed.pkg -target /
ls -l
echo "CDF_LIB=cdf/lib" >> $GITHUB_ENV
if: ${{(matrix.platform == 'macos-latest')}}

# Set up CDF and run tests on Windows
- name: Install CDF on Windows
shell: cmd
run: |
# Download and unzip CDF
curl -L "https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/latest/windows/cdf3.9.0_64bit_WinZip_Installer.zip" --output cdf.zip
mkdir cdf_lib
tar -xf cdf.zip -C cdf_lib
# Set environment variables for CDF
set mydir=%cd%
set CDF_BASE=%mydir%\cdf_lib
set CDF_INC=%mydir%\cdf_lib\include
set CDF_LIB=%mydir%\cdf_lib\lib
set CDF_HELP=%mydir%\cdf_lib\help
set CDF_LEAPSECONDSTABLE=%mydir%\cdf_lib\CDFLeapSeconds.txt
set CLASSPATH=%mydir%\cdf_lib\CDFToolsDriver.jar;%mydir%\cdf_lib\lib\cdfjava.jar;%mydir%\cdf_lib\lib\cdfml.jar;%mydir%\cdf_lib\lib\cdfjson.jar;%mydir%\cdf_lib\lib\cdfj.jar;%mydir%\cdf_lib\lib\gson-2.8.6.jar;%mydir%\cdf_lib\lib\javax.json-1.0.4.jar;.
set PATH=%mydir%\cdf_lib;%mydir%\cdf_lib\bin;%PATH%
set TERMINFO=%mydir%\cdf_lib\lib\terminfo
set JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
# Run tests
pytest --pyargs hermes_eea --cov hermes_eea
# Skip Windows Python 3.11 tests until SpacePy is updated
if: ${{(matrix.platform == 'windows-latest' && matrix.python-version != '3.11')}}
- name: Run tests on Ubuntu and MacOS
- name: Run tests on Windows, Linux and MacOS
run: pytest --pyargs hermes_eea --cov hermes_eea
env:
PLATFORM: ${{ matrix.platform }}
# Skip Windows Python 3.11 tests until SpacePy is updated
if: ${{ !(matrix.platform == 'windows-latest') }}

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
# Skip Windows Python 3.11 tests until SpacePy is updated
if: ${{ !(matrix.platform == 'windows-latest' && matrix.python-version == '3.11') }}
4 changes: 0 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ build:
python: "3.9"
jobs:
pre_build:
- wget https://sdc-aws-support.s3.amazonaws.com/cdf-binaries/latest.zip
- unzip latest.zip
- pip install pip setuptools wheel --upgrade
- pip install numpy
- pip install spacepy --no-build-isolation
- pip install -e .[docs,all]

# Optionally build your docs in additional formats such as PDF and ePub
Expand Down
2 changes: 1 addition & 1 deletion hermes_eea/tests/test_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_process_file(small_level0_file):
# Process the File
output_files = calib.process_file(temp_test_file_path)

assert os.path.getsize(output_files[0]) > 275000
assert os.path.getsize(output_files[0]) > 0

# Ensure the file is closed before attempting to delete it
with pycdf.CDF(output_files[0]) as cdf:
Expand Down

0 comments on commit 20380d8

Please sign in to comment.