Skip to content

Commit

Permalink
Update with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontempestholt committed Jan 16, 2024
2 parents 08331ff + cf1f539 commit 1979b2d
Show file tree
Hide file tree
Showing 58 changed files with 22,056 additions and 533 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
python-version: [ '3.8', '3.9', '3.10' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} for Black
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Black
Expand All @@ -25,6 +25,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global author.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout $GITHUB_HEAD_REF
git pull
git commit -am "Apply Black formatting to Python code."
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown-altimetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site

- name: Checkout coast
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/markdown-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site

- name: Checkout coast
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
path: external

- name: Prepare environement
- name: Prepare environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: coast
Expand All @@ -38,5 +38,11 @@ jobs:
mkdir -p ./example_scripts/notebook_tutorials/markdown/general
ls ./example_scripts/notebook_tutorials
pip install .
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pip install xarray[complete]
pip install aiohttp requests
mv config ./example_scripts/notebook_tutorials/runnable_notebooks/general/config
bash notebook_to_md.sh general
4 changes: 2 additions & 2 deletions .github/workflows/markdown-gridded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site

- name: Checkout coast
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site

- name: Checkout coast
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown-tidegauge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
shell: bash -l {0}
steps:
- name: Checkout site
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes and all extra projects
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
path: site

- name: Checkout coast
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: British-Oceanographic-Data-Centre/COAsT
ref: develop
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.8 ]
python-version: [ '3.10' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/pylint_checking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} for Pylint
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Pylint
Expand All @@ -31,16 +31,14 @@ jobs:
git config --global user.email "[email protected]"
git config --global author.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git status
git checkout -b $GITHUB_HEAD_REF
git pull --rebase origin $GITHUB_HEAD_REF
git status
git fetch origin
git checkout $GITHUB_HEAD_REF
git pull
echo "NEW_SCORE is greater than THESHOLD_SCORE"
echo "Updating THESHOLD_SCORE"
echo "$NEW_SCORE" > .pylint-score
git status
git commit -am "Update pylint THESHOLD score"
git push --set-upstream origin $GITHUB_HEAD_REF
git push
elif [ "$(echo "$NEW_SCORE == $THESHOLD_SCORE" | bc -l)" -eq 1 ] ; then
echo "NEW_SCORE is equal to THESHOLD_SCORE"
else
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/unit_test_contents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ jobs:
python-version: [ '3.10' ]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} for running python script.
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Generate contents.
run: |
pip install .
pip install .
mkdir -p example_files
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pip install xarray[complete]
pip install aiohttp requests
python unit_testing/generate_unit_test_contents.py
- name: Commit changes
run: |
Expand All @@ -27,6 +33,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global author.email "[email protected]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git fetch origin
git checkout $GITHUB_HEAD_REF
git pull
git diff-index --quiet $GITHUB_HEAD_REF || git commit -am "Commit generated unit test contents."
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/verify_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
python-version: [ '3.8', '3.9', '3.10' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -31,4 +31,8 @@ jobs:
run: |
pip install dask[complete]
pip install -r requirements.txt
sudo apt-get update
sudo apt-get install -y libgeos-dev
pip install cartopy==0.21.0
pip install zarr
pytest tests
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ docstring2md.log
example_scripts/notebook_tutorials/markdown/*

markdown/
.python-version
.python-version
2 changes: 1 addition & 1 deletion .pylint-score
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.73
5.99
9 changes: 6 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ authors:
- family-names: "Cazaly"
given-names: "Matthew"
orcid: "https://orcid.org/0000-0002-0679-4054"
- family-names: "Ferreira"
given-names: "Tobias"
orcid: "https://orcid.org/0000-0002-0888-9751"
- family-names: "Hearn"
given-names: "Malcolm"
- family-names: "Jennings"
Expand All @@ -43,6 +46,6 @@ authors:
- family-names: "de Mora"
given-names: "Lee"
orcid: "https://orcid.org/0000-0002-5080-3149"
title: "British-Oceanographic-Data-Centre/COAsT: v3.2.1"
version: v3.2.1
date-released: 2023-04-04
title: "British-Oceanographic-Data-Centre/COAsT: v3.3.0"
version: v3.3.0
date-released: 2023-12-11
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![PyPI version](https://badge.fury.io/py/coast.svg)](https://badge.fury.io/py/coast)
[![Conda COAsT version](https://img.shields.io/conda/v/bodc/coast.svg)](https://anaconda.org/bodc/coast)
[![Anaconda-Server Badge](https://anaconda.org/bodc/coast/badges/latest_release_relative_date.svg)](https://anaconda.org/bodc/coast)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7799863.svg)](https://zenodo.org/record/7799863)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4041413.svg)](https://zenodo.org/record/4041413)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
```
__________________________________________________________________________________________
Expand All @@ -22,7 +22,7 @@ ________________________________________________________________________________
COAsT is Diagnostic and Assessment toolbox for kilometric scale regional models.
It's aim is to deliver a flexible, community-ready framework for assessing kilometric scale ocean models. The focus, initially, is be on delivering novel diagnostics for processes that are emergent at the kilometric scale and with NEMO model output. The framework leans heavily on xarray.

Documentation can be found [here](https://british-oceanographic-data-centre.github.io/COAsT/docs/).
Documentation can be found [here](https://british-oceanographic-data-centre.github.io/COAsT/).

![PyPI version](https://badge.fury.io/py/COAsT.svg)
![Anaconda version](https://anaconda.org/bodc/coast/badges/version.svg)
Expand Down
2 changes: 1 addition & 1 deletion coast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from .diagnostics.tidegauge_analysis import TidegaugeAnalysis
from .data.config_parser import ConfigParser
from ._utils.xesmf_convert import xesmf_convert
from ._utils.process_data import Process_data
from ._utils.process_data import Process_data, ProcessData
from .data.opendap import OpendapInfo
from .data.copernicus import Copernicus, Product
from ._utils.experiments_file_handling import experiments
Expand Down
18 changes: 17 additions & 1 deletion coast/_utils/logging_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,30 @@
import logging
import sys
import io
import functools
import warnings
import inspect
import traceback


warnings.simplefilter("always", DeprecationWarning)
warnings.formatwarning = (
lambda message, category, filename, lineno, line=None: f"{filename}:{lineno}: {category.__name__}: {message}\n"
)
DEFAULT_FORMAT = "%(asctime)s %(levelname)s %(message)s"


def deprecated(message=""):
def decorator(func):
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.warn(f"{func.__name__} is deprecated: {message}", DeprecationWarning)
return func(*args, **kwargs)

return new_func

return decorator


def get_logger(name: str = None, level: int = logging.CRITICAL):
logger = logging.getLogger(name=name)
logger.setLevel(level)
Expand Down
Loading

0 comments on commit 1979b2d

Please sign in to comment.