Skip to content

Commit

Permalink
wradlib final RC (#641)
Browse files Browse the repository at this point in the history
* MNT: setuptools -> hatch
* MNT: move doc -> docs
* MNT: style, CI, dependencies, pre-commit
* FIX: ReadTheDocs, tests
  • Loading branch information
kmuehlbauer committed Sep 28, 2023
1 parent de98d69 commit 5017ab6
Show file tree
Hide file tree
Showing 46 changed files with 209 additions and 269 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ assignees: ''

```python
# Your code here

```

#### Expected Output
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
158 changes: 20 additions & 138 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,142 +1,24 @@
# ignore everything
*

# allowlist block
# allowlist root .gitignore
!/.gitignore
!/.git-blame-ignore-revs

# allowlist .py, .f-files and .sh files
!*.py
!*.f
!*.sh

# allowlist files under `ci`
!/ci/
!/ci/*

# allowlist files under `ci`
!/.github/
!/.github/*

# allowlist files under `scripts`
!/scripts/
!/scripts/*

# allowlist files under `wradlib`
!/wradlib
!/wradlib/*.py
!/wradlib/georef
!/wradlib/georef/*.py
!/wradlib/io
!/wradlib/io/*.py
!/wradlib/tests
!/wradlib/tests/*.py

# ignore version.py
wradlib/version.py

# Byte-compiled / optimized / DLL files
# Global directories
__pycache__/
*.py[cod]
*$py.class

# C extensions
# Global files
*.py[cod]
*.dll
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
*.swp

# Root directories
/.benchmarks/
/.env/
/.idea/
/.mypy_cache/
/.pytest_cache/
/.vscode/
/build/
/backend/dist/
/dist/
/site/

# Root files
/.coverage*
19 changes: 14 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ repos:
- id: check-yaml
- id: debug-statements
- id: mixed-line-ending
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.254'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.291'
hooks:
- id: ruff
args: [ "--fix" ]
- repo: https://github.com/psf/black
rev: 23.1.0
args: [ "--fix", "--show-fixes" ]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies:
- black==23.9.1

ci:
autoupdate_commit_msg: 'MNT: update pre-commit hooks'
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ build:
python: 'mambaforge-22.9'
jobs:
pre_install:
- git update-index --assume-unchanged ci/requirements/readthedocs.yml doc/conf.py
- git update-index --assume-unchanged ci/requirements/readthedocs.yml docs/conf.py
conda:
environment: ci/requirements/readthedocs.yml
sphinx:
builder: html
configuration: doc/conf.py
configuration: docs/conf.py
21 changes: 21 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
# FIXME title as repository name might not be the best name, please make human readable
title: 'wradlib/wradlib: wradlib v2.0.0'
doi: 10.5281/zenodo.1209843
# FIXME splitting of full names is error prone, please check if given/family name are correct
authors:
- given-names: Kai
family-names: Mühlbauer
affiliation: University Bonn
orcid: https://orcid.org/0000-0001-6599-1034
- given-names: Maik
family-names: Heistermann
affiliation: University of Potsdam
orcid: https://orcid.org/0000-0001-9354-1532
version: 2.0.0
date-released: 2023-09-28
repository-code: https://github.com/wradlib/wradlib
license: MIT
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 10 additions & 11 deletions doc/conf.py → docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# wradlib documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 26 13:48:08 2011.
Expand Down Expand Up @@ -110,9 +109,9 @@
rtd_version_name = os.environ.get("READTHEDOCS_VERSION_NAME", "latest")
rtd_version_type = os.environ.get("READTHEDOCS_VERSION_TYPE", "latest")

print("RTD Version: {}".format(rtd_version))
print("RTD Version Name: {}".format(rtd_version_name))
print("RTD Version Type: {}".format(rtd_version_type))
print(f"RTD Version: {rtd_version}")
print(f"RTD Version Name: {rtd_version_name}")
print(f"RTD Version Type: {rtd_version_type}")

# latest wradlib commit
if rtd_version == "latest" or rtd_version_type == "external":
Expand All @@ -139,15 +138,15 @@
print("RTD - RELEASE, VERSION", release, version)

# clone wradlib-notebooks target branch
repourl = "{0}/wradlib-notebooks.git".format(url)
repourl = f"{url}/wradlib-notebooks.git"
reponame = "wradlib-notebooks"
# first remove any possible left overs
subprocess.check_call(["rm", "-rf", "wradlib-notebooks"])
subprocess.check_call(["rm", "-rf", "notebooks"])
subprocess.check_call(
["git", "clone", "-b", wradlib_notebooks_branch, repourl, reponame]
)
branch = "origin/{}".format(wradlib_branch_or_tag)
branch = f"origin/{wradlib_branch_or_tag}"
nb = (
subprocess.check_output(
["git", "--git-dir=wradlib-notebooks/.git", "rev-parse", branch]
Expand Down Expand Up @@ -188,8 +187,8 @@
if isinstance(v, types.ModuleType):
if k not in ["_warnings", "version"]:
modules.append(k)
file = open("{0}.rst".format(k), mode="w")
file.write(".. automodule:: wradlib.{}\n".format(k))
file = open(f"{k}.rst", mode="w")
file.write(f".. automodule:: wradlib.{k}\n")
file.close()

# create API/Library reference md-file
Expand All @@ -203,9 +202,9 @@
"""

file = open("reference.md", mode="w")
file.write("{}\n".format(reference))
file.write(f"{reference}\n")
for mod in sorted(modules):
file.write("{}\n".format(mod))
file.write(f"{mod}\n")
file.write("```")
file.close()

Expand Down Expand Up @@ -420,7 +419,7 @@ def format_label(self, entry):
label = self.author_key_label(entry)
# add full year comma separated
if "year" in entry.fields:
return "{0}, {1}".format(label, entry.fields["year"])
return "{}, {}".format(label, entry.fields["year"])
else:
return label

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
8 changes: 4 additions & 4 deletions doc/index.md → docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ dev_guide
release_notes
```

:::{important}
{{wradlib}}'s documentation is currently being restructured. The old documentation for versions <1.19.1 are available from [here](https://docs.wradlib.org/projects/old-docs/en/1.19.0/).
:::

The {{wradlib}} project has been initiated in order facilitate the use of weather radar data as well as to provide a common platform for research on new algorithms. {{wradlib}} is an open source library which is well documented and easy to use. It is written in the free programming language [Python](https://www.python.org).

:::{note}
Expand All @@ -58,6 +54,10 @@ with high spatio-temporal resolution over large areas makes it an invaluable too

This documentation is under steady development. It provides a complete library reference as well as a set of tutorials which will get you started in working with {{wradlib}}.

:::{important}
{{wradlib}}'s documentation has been restructured. The old documentation for versions <1.19.1 are available from [here](https://docs.wradlib.org/projects/old-docs/en/1.19.0/).
:::

# License

{{wradlib}} is available under the open source [MIT License](https://opensource.org/license/mit).
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion doc/migration.md → docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ Please also refer to {py:func}`xarray:xarray.open_dataset` documentation.
#### Timeseries of sweeps

```python
ts = xarray.open_mfdataset(filelist, concat_dim=time2, engine=engine, group=group, preprocess=preprocess)
ts = xarray.open_mfdataset(
filelist, concat_dim=time2, engine=engine, group=group, preprocess=preprocess
)
```

`preprocess` is here a function which is applied to each of the retrieved datasets to align them for stacking along the new dimension (`time2`). One use-case would be <inv:xradar:std:doc#notebooks/angle_reindexing>.
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/release_notes.md → docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can install the latest {{wradlib}} release from PyPI via ``$ python -m pip i

For {{wradlib}} 2.0 there have been quite some deprecations and additions. Most of the changes have been announced over the latest {{wradlib}} 1 versions. Nevertheless, to make a clean cut it was neccessary to change and remove code and functionality which was not yet being officially deprecated.

Please follow up at <project:#migration>.
Please follow up at [](./migration.md).

The major new feature is the smooth integration into `xradar`-based reading into `xarray`-based data structures and the convenient use of `xarray`-accessors. The tutorials and examples got a major overhaul to show the capabilities of {{wradlib}} in the light of these new developments.

Expand Down
File renamed without changes.
Loading

0 comments on commit 5017ab6

Please sign in to comment.