Skip to content

Commit ea7bbef

Browse files
authored
release: v0.5.6
Add platform and Python version information to User-Agent headers
2 parents 23c41c3 + a12862d commit ea7bbef

39 files changed

+501
-338
lines changed

.github/workflows/ruff-mypy.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: lint-format-type-check
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
linting:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install dependencies
22+
run: |
23+
pip install --upgrade pip
24+
pip install "ruff>=0.9.6,<1.0.0" "mypy>=1.0.0,<2.0.0" "types-tqdm>=4.67,<5.0.0"
25+
26+
- name: Run Ruff Check
27+
run: ruff check . --select I
28+
29+
- name: Run Ruff Format
30+
run: ruff format --check .
31+
32+
- name: Run MyPy
33+
run: mypy .

.github/workflows/ruff.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.5.6] - 2025-03-26
8+
9+
### Added
10+
11+
- platform and python version information to User-Agent headers.
12+
713
## [0.5.5] - 2025-03-11
814

915
### Fixed

docs/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Add description of your changes
1111
* Add and ensure tests are passing
1212
* Ensure branch is mergeable
13-
* If possible, ruff check your code :)
13+
* Use Ruff to format and lint your code
1414

1515
## Testing
1616

docs/conf.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
# -- Project information -----------------------------------------------------
88
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
99

10-
# import re
10+
# mypy: ignore-errors
11+
# TODO (v1): Fix type issues and remove 'mypy: ignore-errors' after verifying non-breaking changes
12+
1113
import os
12-
import sys
1314
import re
15+
import sys
1416

15-
from sphinx_gallery.sorting import ExampleTitleSortKey
16-
import os
17-
os.environ['PYDEVD_DISABLE_FILE_VALIDATION'] = "1"
17+
os.environ["PYDEVD_DISABLE_FILE_VALIDATION"] = "1"
1818
project = "earthdaily"
1919
copyright = "2024, EarthDailyAgro"
2020
author = "Geosys/EarthDailyAgro"
@@ -24,16 +24,16 @@
2424

2525

2626
extensions = [
27-
'sphinx.ext.autodoc', # For automatic API documentation
28-
'sphinx.ext.napoleon', # For Google/NumPy style docstrings
29-
'sphinx.ext.viewcode', # To add links to source code
30-
'sphinx_autodoc_typehints', # For better type hint support
27+
"sphinx.ext.autodoc", # For automatic API documentation
28+
"sphinx.ext.napoleon", # For Google/NumPy style docstrings
29+
"sphinx.ext.viewcode", # To add links to source code
30+
"sphinx_autodoc_typehints", # For better type hint support
3131
"sphinx.ext.autosummary",
3232
"sphinx.ext.viewcode",
3333
"sphinx_gallery.gen_gallery",
3434
"sphinx_copybutton",
3535
"sphinx_automodapi.automodapi",
36-
"sphinx_automodapi.smart_resolver",# for a page per function
36+
"sphinx_automodapi.smart_resolver", # for a page per function
3737
"myst_parser",
3838
]
3939
#
@@ -119,4 +119,4 @@
119119
# -- Options for todo extension ----------------------------------------------
120120

121121
# If true, `todo` and `todoList` produce output, else they produce nothing.
122-
todo_include_todos = False
122+
todo_include_todos = False

earthdaily/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
from typing import Optional
21
from pathlib import Path
3-
from . import earthdatastore, datasets
4-
from .accessor import __EarthDailyAccessorDataArray, __EarthDailyAccessorDataset
2+
from typing import Optional
3+
54
from earthdaily.core import options
65

6+
from . import datasets, earthdatastore # noqa: F401
7+
from .accessor import ( # noqa: F401
8+
__EarthDailyAccessorDataArray,
9+
__EarthDailyAccessorDataset,
10+
)
11+
712
__all__ = ["options"]
813

9-
__version__ = "0.5.5"
14+
__version__ = "0.5.6"
1015

1116

1217
def EarthDataStore(
@@ -47,6 +52,7 @@ def EarthDataStore(
4752
json_path=json_path,
4853
toml_path=toml_path,
4954
profile=profile,
55+
client_version=__version__,
5056
presign_urls=presign_urls,
5157
asset_proxy_enabled=asset_proxy_enabled,
5258
)

earthdaily/accessor/__init__.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import warnings
2-
import xarray as xr
3-
import rioxarray as rxr
4-
import numpy as np
5-
import pandas as pd
61
import geopandas as gpd
7-
from shapely.geometry import Point
8-
from dask import array as da
2+
import numpy as np
93
import spyndex
4+
import xarray as xr
5+
from dask import array as da
106
from dask_image import ndfilters as dask_ndimage
117
from scipy import ndimage
12-
from xarray.core.extensions import AccessorRegistrationWarning
8+
from shapely.geometry import Point
9+
1310
from ..earthdatastore.cube_utils import GeometryManager
1411

1512

@@ -99,7 +96,7 @@ def plot_band(self, cmap="Greys", col="time", col_wrap=5, **kwargs):
9996
def whittaker(
10097
self,
10198
beta: float = 10000.0,
102-
weights: (np.ndarray, list) = None,
99+
weights: np.ndarray | list | None = None,
103100
time="time",
104101
):
105102
from . import whittaker
@@ -108,7 +105,7 @@ def whittaker(
108105

109106
def sel_nearest_dates(
110107
self,
111-
target: (xr.Dataset, xr.DataArray),
108+
target: xr.Dataset | xr.DataArray,
112109
max_delta: int = 0,
113110
method: str = "nearest",
114111
return_target: bool = False,
@@ -159,7 +156,7 @@ def zonal_stats(
159156
With new dimension "zonal_statistics" and "geometry".
160157
161158
"""
162-
from ..earthdatastore.cube_utils import zonal_stats, GeometryManager
159+
from ..earthdatastore.cube_utils import GeometryManager, zonal_stats
163160

164161
geometry = GeometryManager(geometry).to_geopandas()
165162
return zonal_stats(
@@ -181,7 +178,7 @@ def lee_filter(self, window_size: int):
181178
kwargs=dict(window_size=window_size),
182179
)
183180

184-
def centroid(self, to_wkt: str = False, to_4326: bool = True):
181+
def centroid(self, to_wkt: bool = False, to_4326: bool = True):
185182
"""Return the geographic center point in 4326/WKT of this dataset."""
186183
# we can use a cache on our accessor objects, because accessors
187184
# themselves are cached on instances that access them.

earthdaily/accessor/whittaker/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
@author: nkk
55
"""
66

7-
import xarray as xr
87
import numpy as np
8+
import xarray as xr
99
from scipy.linalg import solve_banded
10-
import warnings
11-
from dask import array as da
1210

1311

1412
def whittaker(dataset, beta=10000.0, weights=None, time="time"):

earthdaily/accessor/whittaker/_pywapor_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
import numpy as np
6-
from numba import types, guvectorize, njit, float64, int64
6+
from numba import float64, guvectorize, int64, njit, types
77

88

99
def second_order_diff_matrix(x):

earthdaily/core/_options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
allowing users to set and retrieve options that affect package behavior.
55
"""
66

7-
from typing import Dict, Any, Optional, List, Callable
87
from dataclasses import dataclass
8+
from typing import Any, Callable, Dict, List, Optional
99

1010

1111
@dataclass
@@ -56,7 +56,7 @@ def validate(self, value: Any) -> bool:
5656
if self.valid_values is not None:
5757
if value not in self.valid_values:
5858
raise ValueError(
59-
f"Invalid value: {value}. " f"Must be one of: {self.valid_values}"
59+
f"Invalid value: {value}. Must be one of: {self.valid_values}"
6060
)
6161
return True
6262

earthdaily/datasets/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
23
import geopandas as gpd
34

45
__pathFile = os.path.dirname(os.path.realpath(__file__))

0 commit comments

Comments
 (0)