File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,26 +22,11 @@ repos:
2222 args :
2323 - ' --py38-plus'
2424
25- - repo : https://github.com/psf/black
26- rev : 23.3.0
25+ - repo : https://github.com/astral-sh/ruff-pre-commit
26+ rev : v0.15.6
2727 hooks :
28- - id : black
29- - id : black-jupyter
30-
31- - repo : https://github.com/keewis/blackdoc
32- rev : v0.3.8
33- hooks :
34- - id : blackdoc
35-
36- - repo : https://github.com/PyCQA/flake8
37- rev : 6.0.0
38- hooks :
39- - id : flake8
40-
41- - repo : https://github.com/PyCQA/isort
42- rev : 5.12.0
43- hooks :
44- - id : isort
28+ - id : ruff-check
29+ - id : ruff-format
4530
4631 - repo : https://github.com/pre-commit/mirrors-prettier
4732 rev : v3.0.0-alpha.6
Original file line number Diff line number Diff line change 55except PackageNotFoundError :
66 __version__ = "version-unknown"
77
8- from dataretrieval .nadp import * # noqa: F403
9- from dataretrieval .nwis import * # noqa: F403
10- from dataretrieval .samples import * # noqa: F403
11- from dataretrieval .streamstats import * # noqa: F403
12- from dataretrieval .utils import * # noqa: F403
13- from dataretrieval .waterdata import * # noqa: F403
14- from dataretrieval .waterwatch import * # noqa: F403
15- from dataretrieval .wqp import * # noqa: F403
8+ from dataretrieval .nadp import *
9+ from dataretrieval .nwis import *
10+ from dataretrieval .samples import *
11+ from dataretrieval .streamstats import *
12+ from dataretrieval .utils import *
13+ from dataretrieval .waterdata import *
14+ from dataretrieval .waterwatch import *
15+ from dataretrieval .wqp import *
Original file line number Diff line number Diff line change 1- from .states import * # noqa: F403
2- from .timezones import * # noqa: F403
1+ from .states import *
2+ from .timezones import *
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
13from json import JSONDecodeError
24from typing import Literal , Optional , Union
35
@@ -246,12 +248,12 @@ def get_features(
246248 " be provided with lat or long"
247249 )
248250
251+ if not lat and (comid or data_source ) and navigation_mode is None :
252+ raise ValueError (
253+ "navigation_mode is required if comid or data_source is provided"
254+ )
255+
249256 if not lat :
250- if comid or data_source :
251- if navigation_mode is None :
252- raise ValueError (
253- "navigation_mode is required if comid or data_source is provided"
254- )
255257 # validate the feature source and comid
256258 _validate_feature_source_comid (feature_source , feature_id , comid )
257259 # validate the data source
Original file line number Diff line number Diff line change 44
55"""
66
7+ from __future__ import annotations
8+
79import re
810import warnings
911from io import StringIO
@@ -79,10 +81,9 @@ def format_response(
7981 if service == "peaks" :
8082 df = preformat_peaks_response (df )
8183
82- if gpd is not None :
83- if "dec_lat_va" in list (df ):
84- geoms = gpd .points_from_xy (df .dec_long_va .values , df .dec_lat_va .values )
85- df = gpd .GeoDataFrame (df , geometry = geoms , crs = _CRS )
84+ if gpd is not None and "dec_lat_va" in list (df ):
85+ geoms = gpd .points_from_xy (df .dec_long_va .values , df .dec_lat_va .values )
86+ df = gpd .GeoDataFrame (df , geometry = geoms , crs = _CRS )
8687
8788 # check for multiple sites:
8889 if "datetime" not in df .columns :
Original file line number Diff line number Diff line change @@ -77,12 +77,6 @@ repository = "https://github.com/DOI-USGS/dataretrieval-python.git"
7777[tool .setuptools_scm ]
7878write_to = " dataretrieval/_version.py"
7979
80- [tool .isort ]
81- profile = " black"
82-
83- [tool .black ]
84- skip-string-normalization = true
85-
8680[tool .ruff .format ]
8781quote-style = " double"
8882docstring-code-format = true
@@ -99,4 +93,6 @@ extend-select = [
9993
10094[tool .ruff .lint .per-file-ignores ]
10195"demos/*.ipynb" = [" E501" , " W291" ]
96+ "dataretrieval/__init__.py" = [" F403" ]
97+ "dataretrieval/codes/__init__.py" = [" F403" ]
10298
You can’t perform that action at this time.
0 commit comments