Skip to content

Commit

Permalink
fix: variable case to address #119 (#120)
Browse files Browse the repository at this point in the history
feat: add IERS https deltat sync
feat: add IERS bulletin-A download
ci: add workflow for appending delta times
chore: update leap seconds list
chore: update deltat file
chore: update mean pole table
chore: update finals file
  • Loading branch information
tsutterley authored Nov 7, 2022
1 parent 53bd988 commit 9a573c3
Show file tree
Hide file tree
Showing 19 changed files with 4,962 additions and 2,890 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/auto-update-bulletin-a.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will install Python dependencies and get the latest bulletin-A file

name: Auto-Update Bulletin-A files

on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- name: Set up conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: pyTMD
environment-file: environment.yml
- name: Create conda Test Environment
run: |
conda install flake8 pytest pytest-cov cython
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -c "import pyTMD.time; pyTMD.time.update_bulletin_a(verbose=True)"
- name: Check for changes
id: changes
run: |
if [ -n "$(git status --porcelain data/ser7.dat)" ] ; then
echo "::set-output name=detected::true";
echo "::debug::Changes detected";
else
echo "::set-output name=detected::false";
echo "::debug::No changes detected";
fi
- name: Append delta time file
if: steps.changes.outputs.detected == 'true'
run: |
python -c "import pyTMD.time; pyTMD.time.append_delta_time(verbose=True)"
- name: Create pull request
if: steps.changes.outputs.detected == 'true'
uses: peter-evans/create-pull-request@v3
with:
assignees: ${{ github.actor }}
title: "data: automatic time updates"
71 changes: 26 additions & 45 deletions .github/workflows/auto-update-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,39 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Set up conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
- name: Install dependencies
env:
JOBS: 2
PROJ_VERSION: 8.0.1
PROJ_DATUMGRID_VERSION: 1.8
PROJ_NETWORK: ON
SQLITE3_CFLAGS: "-I/usr/local/include"
SQLITE3_LIBS: "-L/usr/local/lib -lsqlite3"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: pyTMD
environment-file: environment.yml
- name: Create conda Test Environment
run: |
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev libgeos-dev
sudo apt-get install libhdf5-dev libnetcdf-dev octave
cd ${RUNNER_TEMP}
wget -q https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz
wget -q http://download.osgeo.org/proj/proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip
tar -xzf proj-${PROJ_VERSION}.tar.gz
unzip proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip -d proj-${PROJ_VERSION}/data/
cd proj-${PROJ_VERSION}
mkdir build
cd build
sudo cmake \
-DPYTHON_EXECUTABLE=/usr/local/bin/python3 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=true \
-DCMAKE_INSTALL_PREFIX=/usr/local/ ..
sudo cmake --build .
sudo make --quiet --jobs=${JOBS}
sudo make --quiet install
make clean
cd ${GITHUB_WORKSPACE}
sudo ldconfig --verbose
sudo projsync --system-directory --all
pip install --upgrade pip
pip install numpy
pip install zarr
pip install pandas
pip install scikit-learn
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
pip install .
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
conda install flake8 pytest pytest-cov cython
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest test/test_leap_seconds.py test/test_time.py test/test_eop.py \
pytest test/test_leap_seconds.py test/test_eop.py \
--username=${{ secrets.EARTHDATA_USERNAME }} \
--password=${{ secrets.EARTHDATA_PASSWORD }}
- name: Check for changes
Expand Down
6 changes: 6 additions & 0 deletions doc/source/api_reference/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,18 @@ General Methods

.. autofunction:: pyTMD.time.merge_delta_time

.. autofunction:: pyTMD.time.append_delta_time

.. autofunction:: pyTMD.time.merge_bulletin_a_files

.. autofunction:: pyTMD.time.iers_ftp_delta_time

.. autofunction:: pyTMD.time.iers_delta_time

.. autofunction:: pyTMD.time.cddis_delta_time

.. autofunction:: pyTMD.time.read_iers_bulletin_a

.. autofunction:: pyTMD.time.update_bulletin_a

.. autofunction:: pyTMD.time.pull_deltat_file
2 changes: 2 additions & 0 deletions doc/source/api_reference/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ General Methods
.. autofunction:: pyTMD.utilities.cddis_list

.. autofunction:: pyTMD.utilities.from_cddis

.. autofunction:: pyTMD.utilities.iers_list
11 changes: 11 additions & 0 deletions pyTMD/data/deltat.data
Original file line number Diff line number Diff line change
Expand Up @@ -576,3 +576,14 @@
2021 1 1 69.3593
2021 2 1 69.3510
2021 3 1 69.3538
2021 4 1 69.3582
2021 5 1 69.3673
2021 6 1 69.3679
2021 7 1 69.3514
2021 8 1 69.3273
2021 9 1 69.3033
2021 10 1 69.2893
2021 11 1 69.2880
2021 12 1 69.2908
2022 1 1 69.2945
2022 2 1 69.2913
Loading

0 comments on commit 9a573c3

Please sign in to comment.