From f57f9fa582ef3dd160418474d125a1e9173718d6 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:17:43 -0500 Subject: [PATCH 01/12] migrate questions/support to GitHub Discussions, create a translations requests discussion, add links to both from issues --- .github/DISCUSSION_TEMPLATE/questions.yml | 37 +++++++++++++++++++ .github/DISCUSSION_TEMPLATE/translations.yml | 33 +++++++++++++++++ .../ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml | 31 ---------------- .github/ISSUE_TEMPLATE/config.yml | 10 +++++ 4 files changed, 80 insertions(+), 31 deletions(-) create mode 100644 .github/DISCUSSION_TEMPLATE/questions.yml create mode 100644 .github/DISCUSSION_TEMPLATE/translations.yml delete mode 100644 .github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml diff --git a/.github/DISCUSSION_TEMPLATE/questions.yml b/.github/DISCUSSION_TEMPLATE/questions.yml new file mode 100644 index 000000000..ceb365ec5 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/questions.yml @@ -0,0 +1,37 @@ +name: Question/Support +description: Ask for help from the developers +labels: [ "support" ] + +body: + - type: markdown + attributes: + value: | + Thanks for opening this discussion! + Before you submit, please make sure you have read our [Code of Conduct](https://github.com/Ouranosinc/xclim/blob/master/CODE_OF_CONDUCT.md). + - type: textarea + id: setup-information + attributes: + label: Setup Information + description: | + What software versions are you running? Example: + * Xclim version: 0.55.0-gamma + * Python version: 4.2 + * Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond" + value: | + * Xclim version: + * Python version: + * Operating System: + - type: textarea + id: description + attributes: + label: Context + description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen. + - type: textarea + id: steps-to-reproduce + attributes: + label: Steps To Reproduce + description: Paste the command(s) you ran and the output. If there was a crash, please include the traceback below. + value: | + ``` + $ pip install foo --bar + ``` diff --git a/.github/DISCUSSION_TEMPLATE/translations.yml b/.github/DISCUSSION_TEMPLATE/translations.yml new file mode 100644 index 000000000..be8a5db31 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/translations.yml @@ -0,0 +1,33 @@ +name: Translations +description: Coordinate translations of the Xclim documentation +labels: [ "docs" ] + +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to help translate Xclim's documentation! + Before you submit, please make sure you have read our [Code of Conduct](https://github.com/Ouranosinc/xclim/blob/master/CODE_OF_CONDUCT.md). + - type: textarea + id: language + attributes: + label: Language + description: What language are you translating to? + - type: textarea + id: translation + attributes: + label: Translation + description: | + Please paste your translation here. + If you are translating a file, please paste the file contents here. + Remember that you can use Markdown formatting in this text box. + value: | + diff --git a/.github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml b/.github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml deleted file mode 100644 index 8b1b4852d..000000000 --- a/.github/ISSUE_TEMPLATE/0004-QUESTION-SUPPORT.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Question/Support -description: Ask for help from the developers -labels: [ "support" ] - -body: - - type: textarea - id: setup-information - attributes: - label: Setup Information - description: | - What software versions are you running? Example: - - Xclim version: 0.55.0-gamma - - Python version: 4.2 - - Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond" - value: | - - Xclim version: - - Python version: - - Operating System: - - type: textarea - id: description - attributes: - label: Context - description: Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen. - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/Ouranosinc/xclim/blob/master/CODE_OF_CONDUCT.md) - options: - - label: I agree to follow this project's Code of Conduct - required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0086358db..9f962cfcc 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,11 @@ blank_issues_enabled: true +contact_links: + - name: Questions and/or support + about: "For questions or support, please use the Discussions tab" + url: https://www.github.com/Ouranosinc/xclim/discussions/categories/questions + - name: Translation requests + about: "For coordinating translation requests, please use the Discussions tab" + url: https://www.github.com/Ouranosinc/xclim/discussions/categories/translations + - name: PAVICS-related questions + about: "For questions related to PAVICS, the Platform for the Analysis and Visualization of Climate Science, please use the PAVICS email: pavics@ouranos.ca" + url: https://pavics.ouranos.ca/index.html From bcaf72a1391be521bee2f070790169a93d3e9b66 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Sun, 24 Dec 2023 14:32:22 -0500 Subject: [PATCH 02/12] minor labeling adjustments --- .github/DISCUSSION_TEMPLATE/questions.yml | 2 +- .github/DISCUSSION_TEMPLATE/translations.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/DISCUSSION_TEMPLATE/questions.yml b/.github/DISCUSSION_TEMPLATE/questions.yml index ceb365ec5..033db1e4e 100644 --- a/.github/DISCUSSION_TEMPLATE/questions.yml +++ b/.github/DISCUSSION_TEMPLATE/questions.yml @@ -1,4 +1,4 @@ -name: Question/Support +name: "[Questions] Questions and/or support" description: Ask for help from the developers labels: [ "support" ] diff --git a/.github/DISCUSSION_TEMPLATE/translations.yml b/.github/DISCUSSION_TEMPLATE/translations.yml index be8a5db31..10a712fca 100644 --- a/.github/DISCUSSION_TEMPLATE/translations.yml +++ b/.github/DISCUSSION_TEMPLATE/translations.yml @@ -1,4 +1,4 @@ -name: Translations +name: "[Translations] Translation request/coordination" description: Coordinate translations of the Xclim documentation labels: [ "docs" ] @@ -24,10 +24,10 @@ body: value: | From 398dc7aee814cd69b67e5606ed74997a3949bbd0 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:40:28 -0500 Subject: [PATCH 03/12] update ReadMe to remove Gitter integration --- README.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 57b7bf1f7..d44b07946 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ xclim: Climate services library |logo| +----------------------------+-----------------------------------------------------+ | Versions | |pypi| |conda| |versions| | +----------------------------+-----------------------------------------------------+ -| Documentation and Support | |docs| |gitter| | +| Documentation and Support | |docs| |discussions| | +----------------------------+-----------------------------------------------------+ | Open Source | |license| |fair| |zenodo| |pyOpenSci| |joss| | +----------------------------+-----------------------------------------------------+ @@ -81,7 +81,8 @@ Contributing to xclim --------------------- `xclim` is in active development and is being used in production by climate services specialists around the world. -* If you're interested in participating in the development of `xclim` by suggesting new features, new indices or report bugs, please leave us a message on the `issue tracker`_. There is also a chat room on gitter (|gitter|). +* If you're interested in participating in the development of `xclim` by suggesting new features, new indices or report bugs, please leave us a message on the `issue tracker`_. + * If you have a support/usage question or would like to translate `xclim` to a new language, be sure to check out the existing |discussions| first! * If you would like to contribute code or documentation (which is greatly appreciated!), check out the `Contributing Guidelines`_ before you begin! @@ -127,6 +128,10 @@ This package was created with Cookiecutter_ and the `audreyfeldroy/cookiecutter- :target: https://anaconda.org/conda-forge/xclim :alt: Conda-forge Build Version +.. |discussions| image:: https://img.shields.io/badge/GitHub-Discussions-blue + :target: https://github.com/Ouranosinc/xclim/discussions + :alt: Static Badge + .. |gitter| image:: https://badges.gitter.im/Ouranosinc/xclim.svg :target: https://gitter.im/Ouranosinc/xclim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge :alt: Gitter Chat From 5556a76b3ab738ab64a1222bd4cf2f1b5461ddb2 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 29 Dec 2023 12:56:54 -0500 Subject: [PATCH 04/12] Update CONTRIBUTING.rst --- CONTRIBUTING.rst | 83 ++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e9ad5486c..cae525a30 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -23,7 +23,7 @@ and "help wanted" is open to whoever wants to implement it. General to-do list for implementing a new Indicator: -1. Implement the indice +#. Implement the indice * Indices are function wrapped with :py:func:`~xclim.core.units.declare_units` * Their input arguments should have type annotations, as documented in :py:class:`~xclim.core.utils.InputKind` @@ -31,31 +31,34 @@ General to-do list for implementing a new Indicator: * They should set the units on their outputs, but no other metadata fields. * Their code should be found in the most relevant ``xclim/indices/_*.py`` file. Functions are explicitly added to the ``__all__`` at the top of the file. -2. Add unit tests +#. Add unit tests * Indices are best tested with made up, idealized data to explicitly test the edge cases. Many pytest fixtures are available to help this data generation. * Tests should be added as one or more functions in ``tests/test_indices.py``, see other tests for inspiration. -3. Add the indicator +#. Add the indicator * See :ref:`notebooks/extendxclim:Defining new indicators` for more info and look at the other indicators for inspiration. * They are added in the most relevant ``xclim/indicators/{realm}/_*.py`` file. * Indicator are instances of subclasses of :py:class:`xclim.core.indicator.Indicator`. They should use a class declared within the ``{realm}`` folder, creating a dummy one if needed. They are explicitly added to the file's ``__all__``. -4. Add unit tests +#. Add unit tests * Indicators are best tested with real data, also looking at missing value propagation and metadata formatting. In addition to the ``atmosds`` fixture, only datasets that can be accessed with :py:func:`xclim.testing.open_dataset` should be used. For convenience, this special function is accessible as the ``open_dataset`` pytest fixture. * Tests are added in the most relevant ``tests/test_{variable}.py`` file. -5. Add French translations +#. Add French translations xclim comes with an internationalization module and all "official" indicators (those in ``xclim.atmos.indicators``) must have a french translation added to ``xclim/data/fr.json``. This part can be done by the core team after you open a Pull Request. +.. note:: + If you are adding new translations to the library (for languages other than French), please begin by opening a discussion on the `xclim Discussions page`_ to coordinate the scope and implementation of these translations. + General notes for implementing new bias-adjustment methods: * Method are implemented as classes in ``xclim/sdba/adjustment.py``. @@ -113,36 +116,36 @@ Get Started! Ready to contribute? Here's how to set up `xclim` for local development. -1. Fork the `xclim` repo on GitHub. +#. Fork the `xclim` repo on GitHub. -2. Clone your fork locally:: +#. Clone your fork locally:: $ git clone git@github.com:{my_github_username}/xclim.git $ cd xclim/ -3. Create a development environment. We recommend using ``conda``:: +#. Create a development environment. We recommend using ``conda``:: $ conda create -n xclim python=3.8 --file=environment.yml $ pip install -e .[dev] -4. Create a branch for local development:: +#. Create a branch for local development:: $ git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally! -5. Before committing your changes, we ask that you install ``pre-commit`` in your development environment. Pre-commit runs git hooks that ensure that your code resembles that of the project and catches and corrects any small errors or inconsistencies when you ``git commit``:: +#. Before committing your changes, we ask that you install ``pre-commit`` in your development environment. Pre-commit runs git hooks that ensure that your code resembles that of the project and catches and corrects any small errors or inconsistencies when you ``git commit``:: # To install the necessary pre-commit hooks: $ pre-commit install # To run pre-commit hooks manually: $ pre-commit run --all-files - Instead of ``pre-commit``, you can also verify your changes using the `Make` recipe for code linting checks:: + Instead of ``pre-commit``, you can also verify your changes using the `Make` recipe for code linting checks:: $ make lint - Or, alternatively, you can check individual hooks manually with `black`, `isort`, `ruff`, `flake8`, `flake8-rst-docstrings`, `nbqa`, `blackdoc`, and `yamllint`:: + Or, alternatively, you can check individual hooks manually with `black`, `isort`, `ruff`, `flake8`, `flake8-rst-docstrings`, `nbqa`, `blackdoc`, and `yamllint`:: $ black --check xclim tests $ isort --check xclim tests @@ -154,14 +157,14 @@ Ready to contribute? Here's how to set up `xclim` for local development. $ blackdoc --check docs $ yamllint --config-file=.yamllint.yaml xclim -6. When features or bug fixes have been contributed, unit tests and doctests have been added, or notebooks have been updated, use ``$ pytest`` to test them:: +#. When features or bug fixes have been contributed, unit tests and doctests have been added, or notebooks have been updated, use ``$ pytest`` to test them:: $ pytest --no-cov --nbval --dist=loadscope --rootdir=tests/ docs/notebooks --ignore=docs/notebooks/example.ipynb # for notebooks, exclusively. $ pytest --no-cov --rootdir=tests/ --xdoctest xclim # for doctests, exclusively. $ pytest # for all unit tests, excluding doctests and notebooks. $ pytest -m "not slow" # for all unit tests, excluding doctests, notebooks, and "slow" marked tests. - Alternatively, one can use ``$ tox`` to run very specific testing configurations, as GitHub Workflows would do when a Pull Request is submitted and new commits are pushed:: + Alternatively, one can use ``$ tox`` to run very specific testing configurations, as GitHub Workflows would do when a Pull Request is submitted and new commits are pushed:: $ tox -e py38 # run tests on Python 3.8 $ tox -e py39-upstream-doctest # run tests on Python 3.9, including doctests, with upstream dependencies @@ -172,7 +175,7 @@ Ready to contribute? Here's how to set up `xclim` for local development. $ tox -m test # run all builds listed above -.. warning:: + .. warning:: Starting from `xclim` v0.46.0, when running tests with `tox`, any `pytest` markers passed to `pyXX` builds (e.g. `-m "not slow"`) must be passed to `tox` directly. This can be done as follows:: $ tox -e py38 -- -m "not slow" @@ -181,80 +184,77 @@ Ready to contribute? Here's how to set up `xclim` for local development. `notebooks_doctests`: this configuration does not pass test markers to its `pytest` call. `offline`: this configuration runs by default with the `-m "not requires_internet"` test marker. Be aware that running `tox` and manually setting a `pytest` marker will override this default. -.. note:: + .. note:: `xclim` tests are organized to support the `pytest-xdist`_ plugin for distributed testing across workers or CPUs. In order to benefit from multiple processes, add the flag `--numprocesses=auto` or `-n auto` to your `pytest` calls. When running tests via `tox`, `numprocesses` is set to the number of logical cores available (`numprocesses=logical`), with a maximum amount of `8`. -7. Docs should also be tested to ensure that the documentation will build correctly on ReadTheDocs. This can be performed in a number of ways:: +#. Docs should also be tested to ensure that the documentation will build correctly on ReadTheDocs. This can be performed in a number of ways:: # To run in a contained virtualenv environment $ tox -e docs # or, alternatively, to build the docs directly $ make docs -.. note:: + .. note:: When building the documentation, the default behaviour is to evaluate notebooks ('`nbsphinx_execute = "auto"`'), rather than simply parse the content ('`nbsphinx_execute = "never"`'). Due to their complexity, this is a very computationally demanding task and should only be performed when necessary (i.e.: when the notebooks have been modified). In order to speed up documentation builds, setting a value for the environment variable "`SKIP_NOTEBOOKS`" (e.g. "`$ export SKIP_NOTEBOOKS=1`") will prevent the notebooks from being evaluated on all subsequent "`$ tox -e docs`" or "`$ make docs`" invocations. -8. After clearing the previous checks, commit your changes and push your branch to GitHub:: +#. After clearing the previous checks, commit your changes and push your branch to GitHub:: $ git add * $ git commit -m "Your detailed description of your changes." -If installed, `pre-commit` will run checks at this point: + If installed, `pre-commit` will run checks at this point: -* If no errors are found, changes will be committed. -* If errors are found, modifications will be made and warnings will be raised if intervention is needed. -* After adding changes, simply `git commit` again:: + * If no errors are found, changes will be committed. + * If errors are found, modifications will be made and warnings will be raised if intervention is needed. + * After adding changes, simply `git commit` again:: $ git push origin name-of-your-bugfix-or-feature -9. Submit a pull request through the GitHub website. +#. Submit a pull request through the GitHub website. Pull Request Guidelines ----------------------- Before you submit a pull request, please follow these guidelines: -1. Open an *issue* on our `GitHub repository`_ with your issue that you'd like to fix or feature that you'd like to implement. -2. Perform the changes, commit and push them either to new a branch within `Ouranosinc/xclim` or to your personal fork of xclim. +#. Open an *issue* on our `GitHub repository`_ with your issue that you'd like to fix or feature that you'd like to implement. -.. warning:: - Try to keep your contributions within the scope of the issue that you are addressing. - While it might be tempting to fix other aspects of the library as it comes up, it's better to - simply to flag the problems in case others are already working on it. +#. Perform the changes, commit and push them either to new a branch within `Ouranosinc/xclim` or to your personal fork of xclim. - Consider adding a "**# TODO:**" comment if the need arises. + .. warning:: + Try to keep your contributions within the scope of the issue that you are addressing. While it might be tempting to fix other aspects of the library as it comes up, it's better to simply to flag the problems in case others are already working on it. + + Consider adding a "**# TODO:**" comment if the need arises. + +#. Pull requests should raise test coverage for the xclim library. Code coverage is an indicator of how extensively tested the library is. -3. Pull requests should raise test coverage for the xclim library. Code coverage is an indicator of how extensively tested the library is. If you are adding a new set of functions, they **must be tested** and **coverage percentage should not significantly decrease.** -4. If the pull request adds functionality, your functions should include docstring explanations. - So long as the docstrings are syntactically correct, sphinx-autodoc will be able to automatically parse the information. - Please ensure that the docstrings and documentation adhere to the following standards (badly formed docstrings will fail build tests): + +#. If the pull request adds functionality, your functions should include docstring explanations. So long as the docstrings are syntactically correct, sphinx-autodoc will be able to automatically parse the information. Please ensure that the docstrings and documentation adhere to the following standards (badly formed docstrings will fail build tests): * `numpydoc`_ * `reStructuredText (ReST)`_ -.. note:: + .. note:: If you aren't accustomed to writing documentation in reStructuredText (`.rst`), we encourage you to spend a few minutes going over the incredibly well-summarized `reStructuredText Primer`_ from the sphinx-doc maintainer community. -5. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11 as well as raise test coverage. +#. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11 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: https://github.com/Ouranosinc/xclim/actions -.. warning:: + .. warning:: PEP8, black, pytest (with xdoctest) and pydocstyle (for numpy docstrings) conventions are strongly enforced. Ensure that your changes pass all tests prior to pushing your final commits to your branch. Code formatting errors are treated as build errors and will block your pull request from being accepted. -6. The version changes (HISTORY.rst) should briefly describe changes introduced in the Pull request. Changes should be organized by type - (ie: `New indicators`, `New features and enhancements`, `Breaking changes`, `Bug fixes`, `Internal changes`) and the GitHub Pull Request, - GitHub Issue. Your name and/or GitHub handle should also be listed among the contributors to this version. This can be done as follows:: +#. The version changes (HISTORY.rst) should briefly describe changes introduced in the Pull request. Changes should be organized by type (ie: `New indicators`, `New features and enhancements`, `Breaking changes`, `Bug fixes`, `Internal changes`) and the GitHub Pull Request, GitHub Issue. Your name and/or GitHub handle should also be listed among the contributors to this version. This can be done as follows:: Contributors to this version: John Jacob Jingleheimer Schmidt (:user:`username`). @@ -454,4 +454,5 @@ Before updating the main conda-forge recipe, we *strongly* suggest performing th .. _`reStructuredText Primer`: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html .. _`sphinxcontrib-bibtex`: https://sphinxcontrib-bibtex.readthedocs.io .. _`xclim on TestPyPI`: https://test.pypi.org/project/xclim/ +.. _`xclim Discussions page`: https://github.com/Ouranosinc/xclim/discussions .. _`xclim-testdata repository`: https://github.com/Ouranosinc/xclim-testdata From 682ae806abc2a83b86fbd44ae004c9c5431bce3a Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Fri, 29 Dec 2023 13:23:50 -0500 Subject: [PATCH 05/12] fix docs typo --- CONTRIBUTING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cae525a30..bac4366ed 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -211,9 +211,9 @@ Ready to contribute? Here's how to set up `xclim` for local development. * If no errors are found, changes will be committed. * If errors are found, modifications will be made and warnings will be raised if intervention is needed. - * After adding changes, simply `git commit` again:: + * After addressing errors and effecting changes, simply `git commit` again:: - $ git push origin name-of-your-bugfix-or-feature + $ git push origin name-of-your-bugfix-or-feature #. Submit a pull request through the GitHub website. From 4edfc0850930b3465926e74977a0d44ff38fe896 Mon Sep 17 00:00:00 2001 From: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:09:12 -0500 Subject: [PATCH 06/12] Update .github/DISCUSSION_TEMPLATE/questions.yml Co-authored-by: David Huard --- .github/DISCUSSION_TEMPLATE/questions.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/DISCUSSION_TEMPLATE/questions.yml b/.github/DISCUSSION_TEMPLATE/questions.yml index 033db1e4e..b6e92670d 100644 --- a/.github/DISCUSSION_TEMPLATE/questions.yml +++ b/.github/DISCUSSION_TEMPLATE/questions.yml @@ -13,14 +13,9 @@ body: attributes: label: Setup Information description: | - What software versions are you running? Example: - * Xclim version: 0.55.0-gamma - * Python version: 4.2 - * Operating System: Nutmeg Linux 12.34 | macOS 11.0 "Redmond" + What xclim version are you running? value: | * Xclim version: - * Python version: - * Operating System: - type: textarea id: description attributes: From 0680878800b33c7afb8d82f35ed762c15608118e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:10:53 +0000 Subject: [PATCH 07/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/DISCUSSION_TEMPLATE/questions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/DISCUSSION_TEMPLATE/questions.yml b/.github/DISCUSSION_TEMPLATE/questions.yml index b6e92670d..5891fa048 100644 --- a/.github/DISCUSSION_TEMPLATE/questions.yml +++ b/.github/DISCUSSION_TEMPLATE/questions.yml @@ -13,7 +13,7 @@ body: attributes: label: Setup Information description: | - What xclim version are you running? + What xclim version are you running? value: | * Xclim version: - type: textarea From 457f9df2eed916e9216ac0dc88f4d02a36e8a10a Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:42:24 -0500 Subject: [PATCH 08/12] Formatting split CONTRIBUTING.rst by sentences --- CONTRIBUTING.rst | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index bac4366ed..67d8568a1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -15,11 +15,9 @@ Implement Features, Indices or Indicators ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `xclim`'s structure makes it easy to create and register new user-defined indices and indicators. -For the general implementation of indices and their wrapping into indicators, refer to -:ref:`notebooks/extendxclim:Extending xclim` and :ref:`notebooks/customize:Customizing and controlling xclim`. +For the general implementation of indices and their wrapping into indicators, refer to :ref:`notebooks/extendxclim:Extending xclim` and :ref:`notebooks/customize:Customizing and controlling xclim`. -Look through the GitHub issues for features. Anything tagged with "enhancement" -and "help wanted" is open to whoever wants to implement it. +Look through the GitHub issues for features; Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. General to-do list for implementing a new Indicator: @@ -62,8 +60,7 @@ General to-do list for implementing a new Indicator: General notes for implementing new bias-adjustment methods: * Method are implemented as classes in ``xclim/sdba/adjustment.py``. -* If the algorithm gets complicated and would generate many dask tasks, it should be implemented as functions wrapped - by :py:func:`~xclim.sdba.map_blocks` or :py:func:`~xclim.sdba.map_groups` in ``xclim/sdba/_adjustment.py``. +* If the algorithm gets complicated and would generate many dask tasks, it should be implemented as functions wrapped by :py:func:`~xclim.sdba.map_blocks` or :py:func:`~xclim.sdba.map_groups` in ``xclim/sdba/_adjustment.py``. * xclim doesn't implement monolithic multi-parameter methods, but rather smaller modular functions to construct post-processing workflows. * If you are working on numba-accelerated function that use ``@guvectorize``, consider disabling caching during the development phase and reactivating it once all changes are ready for review. This is done by commenting ``cache=True`` in the decorator. @@ -86,11 +83,10 @@ Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wa Write Documentation ~~~~~~~~~~~~~~~~~~~ -xclim could always use more documentation, whether as part of the official xclim docs, in docstrings, or even on the -web in blog posts, articles, and such. +xclim could always use more documentation, whether as part of the official xclim docs, in docstrings, or even on the web in blog posts, articles, and such. -To reference documents (article, presentation, thesis, etc) in the documentation or in a docstring, xclim uses -`sphinxcontrib-bibtex`_. Metadata of the documents is stored as BibTeX entries in the ``docs/references.bib`` file. +To reference documents (article, presentation, thesis, etc) in the documentation or in a docstring, xclim uses `sphinxcontrib-bibtex`_. +Metadata of the documents is stored as BibTeX entries in the ``docs/references.bib`` file. To properly generate internal reference links, we suggest using the following roles: - For references cited in the `References` section of function docstrings, use ``:cite:cts:`label```. @@ -185,7 +181,8 @@ Ready to contribute? Here's how to set up `xclim` for local development. `offline`: this configuration runs by default with the `-m "not requires_internet"` test marker. Be aware that running `tox` and manually setting a `pytest` marker will override this default. .. note:: - `xclim` tests are organized to support the `pytest-xdist`_ plugin for distributed testing across workers or CPUs. In order to benefit from multiple processes, add the flag `--numprocesses=auto` or `-n auto` to your `pytest` calls. + `xclim` tests are organized to support the `pytest-xdist`_ plugin for distributed testing across workers or CPUs. + In order to benefit from multiple processes, add the flag `--numprocesses=auto` or `-n auto` to your `pytest` calls. When running tests via `tox`, `numprocesses` is set to the number of logical cores available (`numprocesses=logical`), with a maximum amount of `8`. @@ -198,7 +195,8 @@ Ready to contribute? Here's how to set up `xclim` for local development. .. note:: - When building the documentation, the default behaviour is to evaluate notebooks ('`nbsphinx_execute = "auto"`'), rather than simply parse the content ('`nbsphinx_execute = "never"`'). Due to their complexity, this is a very computationally demanding task and should only be performed when necessary (i.e.: when the notebooks have been modified). + When building the documentation, the default behaviour is to evaluate notebooks ('`nbsphinx_execute = "auto"`'), rather than simply parse the content ('`nbsphinx_execute = "never"`'). + Due to their complexity, this is a very computationally demanding task and should only be performed when necessary (i.e.: when the notebooks have been modified). In order to speed up documentation builds, setting a value for the environment variable "`SKIP_NOTEBOOKS`" (e.g. "`$ export SKIP_NOTEBOOKS=1`") will prevent the notebooks from being evaluated on all subsequent "`$ tox -e docs`" or "`$ make docs`" invocations. @@ -227,9 +225,10 @@ Before you submit a pull request, please follow these guidelines: #. Perform the changes, commit and push them either to new a branch within `Ouranosinc/xclim` or to your personal fork of xclim. .. warning:: - Try to keep your contributions within the scope of the issue that you are addressing. While it might be tempting to fix other aspects of the library as it comes up, it's better to simply to flag the problems in case others are already working on it. + Try to keep your contributions within the scope of the issue that you are addressing. + While it might be tempting to fix other aspects of the library as it comes up, it's better to simply to flag the problems in case others are already working on it. - Consider adding a "**# TODO:**" comment if the need arises. + Consider adding a "**# TODO:**" or "**# FIXME:**" comment if the need arises. #. Pull requests should raise test coverage for the xclim library. Code coverage is an indicator of how extensively tested the library is. @@ -254,7 +253,7 @@ Before you submit a pull request, please follow these guidelines: Ensure that your changes pass all tests prior to pushing your final commits to your branch. Code formatting errors are treated as build errors and will block your pull request from being accepted. -#. The version changes (HISTORY.rst) should briefly describe changes introduced in the Pull request. Changes should be organized by type (ie: `New indicators`, `New features and enhancements`, `Breaking changes`, `Bug fixes`, `Internal changes`) and the GitHub Pull Request, GitHub Issue. Your name and/or GitHub handle should also be listed among the contributors to this version. This can be done as follows:: +#. The version changes (CHANGES.rst) should briefly describe changes introduced in the Pull request. Changes should be organized by type (ie: `New indicators`, `New features and enhancements`, `Breaking changes`, `Bug fixes`, `Internal changes`) and the GitHub Pull Request, GitHub Issue. Your name and/or GitHub handle should also be listed among the contributors to this version. This can be done as follows:: Contributors to this version: John Jacob Jingleheimer Schmidt (:user:`username`). @@ -262,8 +261,7 @@ Before you submit a pull request, please follow these guidelines: ^^^^^^^^^^^^^^^^ * Updated the contribution guidelines. (:issue:`868`, :pull:`869`). - If this is your first contribution to `Ouranosinc/xclim`, we ask that you also add your name to the `AUTHORS.rst `_, - under *Contributors* as well as to the `.zenodo.json `_, at the end of the *creators* block. + If this is your first contribution to `Ouranosinc/xclim`, we ask that you also add your name to the `AUTHORS.rst `_, under *Contributors* as well as to the `.zenodo.json `_, at the end of the *creators* block. Updating Testing Data ~~~~~~~~~~~~~~~~~~~~~ @@ -313,7 +311,8 @@ If you wish to test a specific branch using GitHub CI, this can be set in `.gith Running Tests in Offline Mode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -`xclim` testing is designed with the assumption that the machine running the tests has internet access. Many calls to `xclim` functions will attempt to download data or verify checksums from the `Ouranosinc/xclim-testdata` repository. This can be problematic for developers working on features where internet access is not reliably available. +`xclim` testing is designed with the assumption that the machine running the tests has internet access. Many calls to `xclim` functions will attempt to download data or verify checksums from the `Ouranosinc/xclim-testdata` repository. +This can be problematic for developers working on features where internet access is not reliably available. If you wish to ensure that your feature or bugfix can be developed without internet access, `xclim` leverages the `pytest-socket`_ plugin so that testing can be run in "offline" mode by invoking pytest with the following options:: @@ -323,7 +322,8 @@ or, alternatively, using `tox` :: $ tox -e offline -These options will disable all network calls and skip tests marked with the `requires_internet` marker. The `--allow-unix-socket` option is required to allow the `pytest-xdist`_ plugin to function properly. +These options will disable all network calls and skip tests marked with the `requires_internet` marker. +The `--allow-unix-socket` option is required to allow the `pytest-xdist`_ plugin to function properly. Tips ---- @@ -396,7 +396,8 @@ The Automated Approach The simplest way to package `xclim` is to "publish" a version on GitHuh. GitHub CI Actions are presently configured to build the library and publish the packages on PyPI automatically. -When publishing on GitHub, maintainers will need to generate the release notes for the current version, replacing the ``:issue:``, ``:pull:``, and ``:user:`` tags. The `xclim` CLI offers a helper function for performing this action:: +When publishing on GitHub, maintainers will need to generate the release notes for the current version, replacing the ``:issue:``, ``:pull:``, and ``:user:`` tags. +The `xclim` CLI offers a helper function for performing this action:: # For Markdown format (needed when publishing a new version on GitHub): $ xclim release_notes -m From db440a70e5b548c5e437f1b98a79be9004b1abc0 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:47:30 -0500 Subject: [PATCH 09/12] update CHANGES.rst --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index deaabd36d..030494cb3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,7 @@ Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`), Pascal B Announcements ^^^^^^^^^^^^^ * `xclim` now adheres to the `Semantic Versioning 2.0.0 `_ specification. (:issue:`1556`, :pull:`1569`). +* The `xclim` repository now uses `GitHub Discussions `_ to offer help for users, coordinate translation efforts, and support general Q&A for the `xclim` community. The `xclim` `Gitter` room has been deprecated in favour of GitHub Discussions. (:issue:`1571`, :pull:`1572`). New features and enhancements ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,6 +32,7 @@ Internal changes * The `bump-version.yml` workflow has been adjusted to bump the `patch` version when the last version is determined to have been a `release` version; otherwise, the `build` version is bumped. (:issue:`1557`, :pull:`1569`). * The GitHub Workflows now use the `step-security/harden-runner` action to monitor source code, actions, and dependency safety. All workflows now employ more constrained permissions rule sets to prevent security issues. (:pull:`1577`). + v0.47.0 (2023-12-01) -------------------- Contributors to this version: Juliette Lavoie (:user:`juliettelavoie`), Pascal Bourgault (:user:`aulemahal`), Trevor James Smith (:user:`Zeitsperre`), David Huard (:user:`huard`), Éric Dupuis (:user:`coxipi`). From 36d38ce92334b2a6244c260b2d677c9591e684bc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:13:05 +0000 Subject: [PATCH 10/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 630062cfa..24d52620f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,7 +148,6 @@ values = [ "release" ] - [tool.coverage.run] relative_files = true omit = ["tests/*.py"] From 62f2530376566b36a093acf0d959e988f74d98e6 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:25:38 -0500 Subject: [PATCH 11/12] fix regex --- .github/workflows/bump-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 99114674a..3f8b8503b 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -55,7 +55,7 @@ jobs: - name: Conditional Bump id: bump run: | - if [[ $CURRENT_VERSION =~ \d+\.\d+\.\d+-dev(\.\d+)?$ ]]; then + if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version" bump-my-version bump build else From 58dc43b62d922226c81113b53b80820cd693a8a4 Mon Sep 17 00:00:00 2001 From: "bumpversion[bot]" Date: Tue, 9 Jan 2024 23:42:14 +0000 Subject: [PATCH 12/12] =?UTF-8?q?Bump=20version:=200.47.5-dev.0=20?= =?UTF-8?q?=E2=86=92=200.47.5-dev.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 3 ++- xclim/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 24d52620f..a76520be7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,7 +122,7 @@ target-version = [ ] [tool.bumpversion] -current_version = "0.47.5-dev.0" +current_version = "0.47.5-dev.1" commit = true commit_args = "--no-verify" tag = false @@ -148,6 +148,7 @@ values = [ "release" ] + [tool.coverage.run] relative_files = true omit = ["tests/*.py"] diff --git a/xclim/__init__.py b/xclim/__init__.py index 61026f92d..7a7e78e44 100644 --- a/xclim/__init__.py +++ b/xclim/__init__.py @@ -15,7 +15,7 @@ __author__ = """Travis Logan""" __email__ = "logan.travis@ouranos.ca" -__version__ = "0.47.5-dev.0" +__version__ = "0.47.5-dev.1" _module_data = _files("xclim.data")