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

Enh/setup cleanup #287

Merged
merged 32 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
852381f
MAINT: Update requirements
Dec 15, 2023
c6987c4
MAINT: Update project structure
Dec 15, 2023
2920ac3
MAINT: Update CI
Dec 18, 2023
738e29e
FIX: doc dependencies
Dec 18, 2023
75d20dc
MAINT: Simplify version number
Dec 18, 2023
06f9917
MAINT: migrate config to ruff
Dec 18, 2023
038aa46
MAINT: Apply ruff format
Dec 18, 2023
fce319c
MAINT: Apply ruff lint autofix
Dec 18, 2023
8f9d58f
MAINT: Fix some lint issues
Dec 18, 2023
587d127
MAINT: More auto fixes
Dec 18, 2023
e9a8a65
MAINT: ruff everywhere
Dec 18, 2023
5bfdda5
MAINT: Lint TODO comments
Dec 19, 2023
b0f3537
MAINT: Fix some more lint issues
Dec 19, 2023
83abd6a
MAINT: Force xarray to read dataset sequentially
Dec 19, 2023
a15a5a9
Merge remote-tracking branch 'origin/master' into enh/setup-cleanup
Dec 19, 2023
0a15df9
[skip ci] DOC: Update coverage
Dec 19, 2023
cf17422
Fix: generated api docstring
Dec 20, 2023
d208da1
MAINT: Fix a few more lint issues
Dec 20, 2023
6c12c67
MAINT: fix lint issues with generated API
Dec 20, 2023
515efcc
MAINT: Lint root __init__
Dec 20, 2023
3e5e7fd
MAINT: more lint fixes
Dec 20, 2023
34c65dc
MAINT: more lint fixes
Dec 20, 2023
6ca2191
MAINT: Lint remaining files
Dec 21, 2023
68e5e2b
Fix: api generation
Dec 21, 2023
fa83249
Fix: logo generation
Dec 21, 2023
8463a89
MAINT: Update ignored lint rules
Dec 21, 2023
bfaea28
MAINT: fix sphinx warnings
Dec 21, 2023
b7971b0
DOC: document changes
Dec 21, 2023
a36584d
MAINT: clean install steps
Dec 21, 2023
88b8e1a
MAINT: Bumpt to 6.6.0
Dec 21, 2023
10fde8c
MAINT: Update raised exception style
Dec 21, 2023
ce669c7
MAINT: Update build script for generated api
Dec 21, 2023
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
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ repos:
- id: end-of-file-fixer
language_version: python3
- id: check-yaml
- id: check-toml
language_version: python3
- id: debug-statements
language_version: python3
- id: requirements-txt-fixer
language_version: python3
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
Expand Down
4 changes: 0 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ build:
os: "ubuntu-20.04"
tools:
python: "3.9"

python:
install:
- requirements: requirements_dev.txt
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ From conda-forge: ``conda install -c conda-forge icclim``.

From sources:
- Clone the repository ``git clone https://github.com/cerfacs-globc/icclim.git``
- Install icclim ``python -m setup install``
- Install icclim ``pip install .``

How to use icclim
-----------------
Expand Down
11 changes: 3 additions & 8 deletions doc/source/dev/release_process.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
Release process
===============


#. Make sure all tests pass.
#. Create and checkout a release branch.
#. Update version number of ICCLIM_VERSION in ``icclim/models/constants.py`` and in ``setup.py``.
#. Update release notes in ``doc/source/references/release_notes.rst``.
#. Merge release branch to master with a PR.
#. Clean dist directory content.
#. Create wheel file on master.

.. code-block:: sh

python3 -m setup bdist_wheel

#. Create source archive.
#. Create wheel file on master and source archive.

.. code-block:: sh

python3 -m setup sdist
python3 -m build

#. Try to upload on testpypi first. ``twine`` must be installed in your env beforehand.

Expand Down
2 changes: 1 addition & 1 deletion doc/source/references/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Release candidates for 5.0 change logs
* [maint] Refactored ecad_functions (removed duplicated code, simplified function signatures...)
* [maint] Refactored IndexConfig to hide some technical knowledge which was leaked to other modules.
* [enh] Made a basic integration of clix-meta yaml to populate the generated docstring for c3s.
* [maint] This makes pyyaml an required dependency of icclim.
* [maint] This makes pyyaml a required dependency of icclim.
* [fix] Fixed an issue with aliasing of "icclim" module and "icclim" package
* [maint] Added some metadata to qualify the ecad_indices and recognize the arguments necessary to compute them.
* [maint] Added readthedocs CI configuration. This is necessary to use python 3.8.
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencies:
- dask[array]
- netCDF4>=1.5.7
- cftime>=1.5.0
- pyyaml>=6.0
- rechunker>=0.3.3
- psutil
- zarr
Expand All @@ -34,6 +33,8 @@ dependencies:
- setuptools
- twine
- flake8-rst-docstrings
- build
bzah marked this conversation as resolved.
Show resolved Hide resolved
- flit
# Extra dependencies
- matplotlib
- cartopy
Expand Down
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "icclim"
authors = [
{name = "Christian Page", email = "[email protected]"}
]
maintainers = [
{name = "Christian Page", email = "[email protected]"},
{name = "Abel Aoun", email = "[email protected]"}
]
readme = "README.rst"
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Atmospheric Science"
]
dynamic = ["version", "description"]
requires-python = ">=3.9"
keywords = ["netcdf", "climate", "climate-indices", "climate-indicators", "xarray"]
dependencies = [
"numpy>=1.16",
"xarray>=2022.6",
"xclim>=0.45, <=0.47",
"cf_xarray>=0.7.4",
"cftime>=1.4.1",
"dask[array]",
"netCDF4>=1.5.7",
"psutil",
"zarr",
"rechunker>=0.3, !=0.4",
"fsspec",
"pandas>=1.3",
"dateparser",
"pint",
"jinja2"
]

[project.optional-dependencies]
dev = [
"black",
"build",
"cf_xarray>=0.7.4",
"cftime~=1.5.0",
"dask",
"dateparser",
"flake8",
"flake8-rst-docstrings",
"flit",
"isort",
"netCDF4~=1.5.7",
"numpy~=1.22",
"pandas>=1.3",
"pint<0.20",
"pip",
"pre-commit>=2.9",
"psutil",
"pydata-sphinx-theme",
"pylint",
"pytest",
"pytest-cov",
"rechunker>=0.3.3",
"setuptools>=49.6.0",
"sphinx",
"sphinx_codeautolink",
"sphinx_copybutton",
"sphinx_lfs_content",
"twine",
"xarray>=2022.6",
"xclim>=0.45",
"zarr"
]

[project.urls]
Documentation = "https://icclim.readthedocs.io/en/latest/how_to/index.html"
Source = "https://github.com/cerfacs-globc/icclim/"
22 changes: 0 additions & 22 deletions requirements.txt

This file was deleted.

29 changes: 0 additions & 29 deletions requirements_dev.txt

This file was deleted.

42 changes: 0 additions & 42 deletions setup.cfg

This file was deleted.

45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

File renamed without changes.
5 changes: 3 additions & 2 deletions icclim/__init__.py → src/icclim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Python library for climate indices calculation"""

from icclim._generated_api import * # noqa
from icclim.generic_indices.threshold import build_threshold
from icclim.main import index, indice, indices
from icclim.models.constants import ICCLIM_VERSION
from icclim.pre_processing.rechunk import create_optimized_zarr_store

__all__ = [
Expand All @@ -15,4 +16,4 @@
"build_threshold",
]

__version__ = ICCLIM_VERSION
__version__ = "6.5.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion icclim/tests/test_frequency.py → tests/test_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from icclim.icclim_exceptions import InvalidIcclimArgumentError
from icclim.models.frequency import FrequencyRegistry, get_seasonal_time_updater
from icclim.tests.testing_utils import stub_tas
from tests.testing_utils import stub_tas


class Test_build_frequency_over_frequency:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from icclim.models.netcdf_version import NetcdfVersionRegistry
from icclim.models.quantile_interpolation import QuantileInterpolationRegistry
from icclim.models.standard_index import StandardIndex
from icclim.tests.testing_utils import stub_tas
from icclim.user_indices.calc_operation import CalcOperation, CalcOperationRegistry
from tests.testing_utils import stub_tas

DEFAULT_ARGS = dict(
in_files="pouet.nc",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion icclim/tests/test_main.py → tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
)
from icclim.models.frequency import FrequencyRegistry
from icclim.models.index_group import IndexGroupRegistry
from icclim.tests.testing_utils import K2C, stub_pr, stub_tas
from tests.testing_utils import K2C, stub_pr, stub_tas


@patch("icclim.main.index")
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
USER_INDEX_TEMPERATURE_STAMP,
)
from icclim.models.operator import OperatorRegistry
from icclim.tests.testing_utils import stub_tas
from tests.testing_utils import stub_tas


class Test_max:
Expand Down
File renamed without changes.
Loading