Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,17 +12,17 @@ repos:
- id: check-ast
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
rev: v0.15.2
hooks:
- id: ruff
args: [--fix]
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
rev: v0.4.6
hooks:
- id: blackdoc
additional_dependencies: ["black[jupyter]"]
Expand All @@ -38,7 +38,7 @@ repos:
types_or: [python, markdown, rst]
additional_dependencies: [tomli]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
rev: v3.21.2
hooks:
- id: pyupgrade
- repo: https://github.com/MarcoGorelli/madforhooks
Expand All @@ -47,13 +47,13 @@ repos:
# - id: conda-env-sorter # conflicts with prettier
- id: check-execution-order
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-black]
exclude: ^.github/ # this avoid the hook to wrongly reformats md issue template files
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
rev: 0.9.1
hooks:
- id: nbstripout
args: [--keep-output]
Expand Down
1 change: 1 addition & 0 deletions gpm/accessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This directory defines GPM-API xarray accessors."""

from .methods import GPM_DataArray_Accessor, GPM_Dataset_Accessor

__all__ = ["GPM_DataArray_Accessor", "GPM_Dataset_Accessor"]
1 change: 1 addition & 0 deletions gpm/accessor/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module defines GPM-API xarray accessors."""

import functools
import importlib
import inspect
Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This directory defines the GPM-API geographic binning toolbox."""

import importlib

if not importlib.util.find_spec("pyarrow"):
Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to analysis bucket archives."""

import datetime

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module implements manipulation wrappers for multiple DataFrame classes."""

import dask.dataframe as dd
import numpy as np
import pandas as pd
Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module provide utilities to search GPM Geographic Buckets files."""

import importlib
import os

Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module implements Spatial Partitioning classes."""

import os
from functools import reduce, wraps

Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module provide utilities to read GPM Geographic Buckets Apache Parquet files."""

import inspect
import os

Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module provides the routines for the creation of GPM Geographic Buckets."""

import os

import dask
Expand Down
1 change: 1 addition & 0 deletions gpm/bucket/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module provide to write a GPM Geographic Bucket Apache Parquet Dataset."""

import math
import os

Expand Down
1 change: 1 addition & 0 deletions gpm/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module defines functions providing GPM-API Dataset information."""

from itertools import chain

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""GPM-API configurations settings."""

import os
import platform
from subprocess import Popen
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to parse GPM granule attributes."""

import ast

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to enforce CF-conventions into the GPM-API objects."""

import datetime
import warnings

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to extract the coordinates from GPM files."""

import numpy as np
import pandas as pd
import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to define and create CF-compliant CRS."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to read files into a GPM-API Dataset or DataTree."""

import warnings
from functools import partial

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to read a GPM granule into a DataTree object."""

import os

import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to CF-decoding the GPM files."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to sanitize GPM-API Dataset coordinates."""

import numpy as np
import xarray as xr

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/dataarray_attrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to standardize GPM-API Dataset attributes."""

import re

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/decode_1b_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM RADAR L1B products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/decode_1c_pmw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM PMW 1C products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/decode_2a_pmw.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM PMW 2A products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down
5 changes: 2 additions & 3 deletions gpm/dataset/decoding/decode_2a_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM DPR, PR, Ka and Ku products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down Expand Up @@ -184,9 +185,7 @@ def decode_flagHeavyIcePrecip(da):
da = da.where(da >= 1) # make 0 nan
da.attrs["flag_values"] = [4, 8, 12, 16, 24, 32, 40]
da.attrs["flag_meanings"] = [""] * 6 # TODO
da.attrs[
"description"
] = """Flag for detection of strong or severe precipitation accompanied
da.attrs["description"] = """Flag for detection of strong or severe precipitation accompanied
by solid ice hydrometeors above the -10 degree C isotherm"""
return da

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/decode_2b_corra.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM DPR, PR, Ka and Ku products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/decode_imerg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to decode GPM PMW 2A products."""

import xarray as xr

from gpm.dataset.decoding.utils import (
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to apply the products decoding routines."""

import importlib

from gpm.io.products import available_products
Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/decoding/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains utilities for the decoding of GPM product variables."""

import dask.array
import numpy as np

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to retrieve the dimensions associated to each GPM variable."""

import numpy as np
import xarray as xr

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/granule.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to read a single file into a GPM-API Dataset."""

import warnings
from functools import partial

Expand Down
1 change: 1 addition & 0 deletions gpm/dataset/groups_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to read GPM file groups, sub-groups and variables."""

import numpy as np

from gpm.utils.list import flatten_list
Expand Down
1 change: 1 addition & 0 deletions gpm/gv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This directory contains utility for SR/GR validation."""

import gpm.gv.xradar # noqa (import xradar_dev accessor)
from gpm.gv.plots import (
compare_maps,
Expand Down
1 change: 1 addition & 0 deletions gpm/gv/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains plotting utility for SR/GR validation."""

import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import numpy as np
Expand Down
1 change: 1 addition & 0 deletions gpm/gv/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains the routine for SR/GR validation."""

import warnings

import cartopy.crs as ccrs
Expand Down
1 change: 1 addition & 0 deletions gpm/gv/xradar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This directory defines custom xradar xarray accessors."""

from .accessors import Xradar_Dev_DataArray_Accessor, Xradar_Dev_Dataset_Accessor

__all__ = ["Xradar_Dev_DataArray_Accessor", "Xradar_Dev_Dataset_Accessor"]
1 change: 1 addition & 0 deletions gpm/io/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to check the GPM-API arguments."""

import datetime
import os
import subprocess
Expand Down
1 change: 1 addition & 0 deletions gpm/io/data_integrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions that check the GPM files integrity."""

import os

import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions gpm/io/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains the routines required to download data from the NASA PPS and GES DISC servers."""

import datetime
import ftplib
import os
Expand Down
1 change: 1 addition & 0 deletions gpm/io/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to filter files according to user specifics."""

import datetime
import re

Expand Down
1 change: 1 addition & 0 deletions gpm/io/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

# -----------------------------------------------------------------------------.
"""This module contains functions to find data on local and NASA servers."""

import datetime
import os
import warnings
Expand Down
Loading
Loading