Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regrid main merge master #236

Merged
merged 77 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0157cab
add initial average_time functions
Dec 16, 2021
ffad882
add more tests for average time
Dec 20, 2021
1231a5f
merge master
Dec 20, 2021
645f4c1
update exception message
Dec 20, 2021
a07ce68
update history and docs
Dec 20, 2021
baf1b81
add time bounds and test for them
Jan 17, 2022
c16e787
move creation of time bounds to separate function
Jan 17, 2022
53860d0
change exception
Jan 17, 2022
8ae6935
update pre-commit and requirements
Zeitsperre Jan 21, 2022
d055589
first draft at fixing the logging - removed logging.conf, remove a cl…
Zeitsperre Jan 21, 2022
e469399
add a logging test, remove references to Travis CI
Zeitsperre Jan 26, 2022
eb92d2e
remove duplicate call to pytest in setup options
Zeitsperre Jan 26, 2022
d9b4ab8
full reimplementation with loguru
Zeitsperre Jan 28, 2022
7615f93
add loguru to environment.yml
Zeitsperre Jan 28, 2022
aa4278d
pin pandas below 1.4
Zeitsperre Jan 28, 2022
a2c1037
add some colour to tox readout
Zeitsperre Jan 28, 2022
31c9839
fix folder discovery test
Zeitsperre Jan 28, 2022
d7c3d7a
Merge pull request #211 from roocs/average_time
agstephens Feb 10, 2022
80565d3
Merge branch 'master' into logging_adjustments
Zeitsperre Mar 29, 2022
b0595fe
Adjustments to loguru
Zeitsperre Mar 29, 2022
0e1283a
pre-commit adjustments
Zeitsperre Mar 29, 2022
2b53249
use py37 conventions
Zeitsperre Mar 29, 2022
efa838c
use py37 conventions
Zeitsperre Mar 29, 2022
3b7f6d3
update pre-commit with newest versions of libraries and use py37+ con…
Zeitsperre Mar 29, 2022
76f62d6
add pytest-loguru
Zeitsperre Mar 29, 2022
ea9c41b
add pre-commit CI hook
Zeitsperre Mar 29, 2022
2677889
try using mamba to reduce RAM usage
Zeitsperre Mar 29, 2022
7ae22e3
pin pandas below v1.4
Zeitsperre Mar 29, 2022
6c89b80
Update HISTORY.rst
Zeitsperre Mar 29, 2022
08aee79
try using mamba to reduce RAM usage
Zeitsperre Mar 29, 2022
396cb68
add workflow step to cancel previous runs
Zeitsperre Mar 29, 2022
1c6df3d
Safer testing of logs with context management, logging disabled by de…
Zeitsperre Apr 1, 2022
89a4faa
Update contributing and history to detail logging methods
Zeitsperre Apr 1, 2022
44fcee5
add documentation about enable_logging function
Zeitsperre Apr 4, 2022
55ef198
Merge pull request #219 from roocs/update_precommit
agstephens Apr 8, 2022
6ba04ae
Merge branch 'master' into logging_adjustments
Zeitsperre Apr 8, 2022
0025577
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Apr 11, 2022
4b39014
Merge pull request #221 from roocs/pre-commit-ci-update-config
Zeitsperre Apr 11, 2022
7078b39
Merge pull request #216 from roocs/logging_adjustments
agstephens Apr 12, 2022
27bfa74
Replace function utils.dataset_utils.check_lon_alignment to fix #217 …
sol1105 Apr 13, 2022
5346657
prepare release 0.9.0 (#222)
cehbrecht Apr 13, 2022
3af7522
Bump version: 0.8.0 → 0.9.0
cehbrecht Apr 13, 2022
9c9a2b3
Update environment.yml
Zeitsperre Apr 19, 2022
d7a339a
Merge pull request #223 from roocs/remove_testing_dep
Zeitsperre Apr 19, 2022
7d8d27d
using roocs-utils 0.6.2 (#226)
cehbrecht May 3, 2022
260edfd
Fix 224 inconsistent bounds (#225)
cehbrecht May 3, 2022
d0a03c7
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] May 9, 2022
09822af
Merge pull request #227 from roocs/pre-commit-ci-update-config
Zeitsperre May 9, 2022
5c43f62
added another metadata test for cmip6
cehbrecht May 11, 2022
43b38dd
Merge pull request #228 from roocs/fix-xarray
cehbrecht May 11, 2022
1d61c6e
update changes
cehbrecht May 11, 2022
248313a
Merge pull request #229 from roocs/prepare-release-0.9.1
cehbrecht May 11, 2022
55f61e8
Bump version: 0.9.0 → 0.9.1
cehbrecht May 11, 2022
8511f4e
Fix broken notebooks alias
Zeitsperre May 27, 2022
eabe71c
Fix conf.py error that prevented notebooks from rendering in RtD
Zeitsperre May 27, 2022
65eeb3c
rename some sections that were conflicting in notebooks, adjust some …
Zeitsperre May 27, 2022
b3b528c
Set ReadTheDocs to fail on warning
Zeitsperre May 27, 2022
0a867ac
Merge pull request #232 from roocs/fix_notebooks_symlink
agstephens Jun 1, 2022
0bf8e94
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Jun 13, 2022
e7b708b
Retire Python3.7, add support for Python3.10
Zeitsperre Jun 13, 2022
4da414a
Python3.7 needed for RtD
Zeitsperre Jun 13, 2022
5cb3368
adjust tox builds
Zeitsperre Jun 13, 2022
32a779d
new sphinx requires explicitly set language
Zeitsperre Jun 13, 2022
2fda6b8
update HISTORY.rst
Zeitsperre Jun 13, 2022
5dae75e
use newer readthedocs build image
Zeitsperre Jun 13, 2022
2ce1594
Merge pull request #234 from roocs/drop_python37
Zeitsperre Jun 14, 2022
096be7e
Merge branch 'master' into pre-commit-ci-update-config
Zeitsperre Jun 14, 2022
b9db2c8
Merge pull request #233 from roocs/pre-commit-ci-update-config
Zeitsperre Jun 14, 2022
918e3c4
do not build epud
Zeitsperre Jun 14, 2022
041ab84
Modify xarray module path in documentation for nicer type hinting
Zeitsperre Jun 14, 2022
eda6639
Merge pull request #235 from roocs/hotfix_drop_epub
Zeitsperre Jun 14, 2022
afc4caf
merge master
sol1105 Jul 4, 2022
7b83753
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 4, 2022
2aad0e4
Edit import order core/__init__.py
sol1105 Jul 4, 2022
b57083e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 4, 2022
6058eb9
Updating environment.yml - adding numpy requirements of numba, exempt…
sol1105 Jul 5, 2022
6798264
Fix typo in environment.yml
sol1105 Jul 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Before you submit a pull request, please follow these guidelines:
* `numpydoc`_
* `reStructuredText (ReST)`_

5. The pull request should work for Python 3.7 as well as raise test coverage.
5. The pull request should work for Python 3.8+ as well as raise test coverage.
Pull requests are also checked for documentation build status and for `PEP8`_ compliance.

The build statuses and build errors for pull requests can be found at:
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
matrix:
tox-env: [black]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Cancel previous runs
uses: styfle/[email protected]
with:
python-version: 3.7
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install tox
run: pip install tox
- name: Run linting suite
Expand All @@ -28,19 +32,19 @@ jobs:
strategy:
matrix:
include:
- python-version: 3.7
tox-env: py37
allowed_to_fail: false
- python-version: 3.8
- python-version: "3.8"
tox-env: py38
allowed_to_fail: false
- python-version: 3.9
- python-version: "3.9"
tox-env: py39
allowed_to_fail: false
- python-version: "3.10"
tox-env: py310
allowed_to_fail: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand All @@ -57,16 +61,19 @@ jobs:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup conda with Python ${{ matrix.python-version }}
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: conda-forge, defaults
- name: Install mamba
run: |
conda install -c conda-forge mamba
- name: Conda env configuration
run: |
conda env create -f environment.yml
mamba env create -f environment.yml
source activate clisops
pip install -e ".[dev]"
- name: Test with conda
Expand Down
49 changes: 24 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,57 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
language_version: python3
exclude: setup.cfg
- id: end-of-file-fixer
language_version: python3
exclude: setup.cfg
- id: check-yaml
language_version: python3
- id: debug-statements
language_version: python3
- repo: https://github.com/ambv/black
rev: 21.4b2
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
args: ["--target-version", "py36"]
args: ["--target-version", "py38"]
- repo: https://github.com/pycqa/flake8
rev: 3.9.1
rev: 4.0.1
hooks:
- id: flake8
language_version: python3
args: ['--config=setup.cfg']
#- repo: https://github.com/pre-commit/mirrors-autopep8
# rev: v1.4.4
# hooks:
# - id: autopep8
# args: ['--global-config=setup.cfg','--in-place']
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
language_version: python3
args: ['--profile', 'black']
exclude: clisops/core/__init__.py
#- repo: https://github.com/pycqa/pydocstyle
# rev: 5.0.2
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# args: ["--conventions=numpy"]
# args: ["--convention=numpy"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.14.0
rev: v2.34.0
hooks:
- id: pyupgrade
language_version: python3
args: ['--py38-plus']
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/kynan/nbstripout
rev: 0.4.0
rev: 0.5.0
hooks:
- id: nbstripout
language_version: python3
files: ".ipynb"

ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
19 changes: 6 additions & 13 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,21 @@ version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
formats: all
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
#python:
# version: 3.7
python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs


# conda:
# environment: docs/environment.yml

build:
image: stable
os: ubuntu-20.04
tools:
python: "3.8"
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Contributors

* Pascal Bourgault [email protected] `@aulemahal <https://github.com/aulemahal>`_
* David Huard [email protected] `@huard <https://github.com/huard>`_
* Martin Schupfner [email protected] `@sol1105 <https://github.com/sol1105>`_
33 changes: 31 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Ready to contribute? Here's how to set up ``clisops`` for local development.
tests, including testing other Python versions with tox:

$ flake8 clisops tests
$ black --target-version py36 clisops tests
$ black --target-version py38 clisops tests
$ python setup.py test # (or pytest)
$ tox

Expand All @@ -106,6 +106,35 @@ Ready to contribute? Here's how to set up ``clisops`` for local development.
#.
Submit a pull request through the GitHub website.


Logging
-------

``clisops`` uses the `loguru <https://loguru.readthedocs.io/en/stable/index.html>`_ library as its primary logging engine. In order to integrate this kind of logging in processes, we can use their logger:

.. code-block:: python
from loguru import logger
logger.warning("This a warning message!")

The mechanism for enabling log reporting in scripts/notebooks using ``loguru`` is as follows:

.. code-block:: python
import sys
from loguru import logger

logger.enable("clisops")
LEVEL = "INFO || DEBUG || WARNING || etc."
logger.add(sys.stdout, level=LEVEL) # for logging to stdout
# or
logger.add("my_log_file.log", level=LEVEL, enqueue=True) # for logging to a file

For convenience, a preset logger configuration can be enabled via `clisops.enable_logging()`.

.. code-block:: python
from clisops import enable_logging

enable_logging()

Pull Request Guidelines
-----------------------

Expand All @@ -116,6 +145,6 @@ Before you submit a pull request, check that it meets these guidelines:
#. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
#. The pull request should work for Python 3.7, 3.8, and 3.9. Check
#. The pull request should work for Python 3.8, 3.9, and 3.10. Check
https://github.com/roocs/clisops/actions
and make sure that the tests pass for all supported Python versions.
Loading