Skip to content

Commit a7a42d0

Browse files
committed
Add waterdata types
1 parent 86ed884 commit a7a42d0

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

dataretrieval/waterdata/api.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ def get_daily(
165165
if your internet connection is spotty. The default (NA) will set the
166166
limit to the maximum allowable limit for the service.
167167
convert_type : boolean, optional
168-
If True, the function will convert the data to dates and qualifier to
169-
string vector
168+
If True, converts columns to appropriate types like numeric, datetime,
169+
boolean, categorical, etc.
170170
171171
Returns
172172
-------
@@ -475,6 +475,9 @@ def get_monitoring_locations(
475475
The returning object will be a data frame with no spatial information.
476476
Note that the USGS Water Data APIs use camelCase "skipGeometry" in
477477
CQL2 queries.
478+
convert_type : boolean, optional
479+
If True, converts columns to appropriate types like numeric, datetime,
480+
boolean, categorical, etc.
478481
479482
Returns
480483
-------
@@ -666,8 +669,8 @@ def get_time_series_metadata(
666669
if your internet connection is spotty. The default (None) will set the
667670
limit to the maximum allowable limit for the service.
668671
convert_type : boolean, optional
669-
If True, the function will convert the data to dates and qualifier to
670-
string vector
672+
If True, converts columns to appropriate types like numeric, datetime,
673+
boolean, categorical, etc.
671674
672675
Returns
673676
-------
@@ -842,8 +845,8 @@ def get_latest_continuous(
842845
if your internet connection is spotty. The default (None) will set the
843846
limit to the maximum allowable limit for the service.
844847
convert_type : boolean, optional
845-
If True, the function will convert the data to dates and qualifier to
846-
string vector
848+
If True, converts columns to appropriate types like numeric, datetime,
849+
boolean, categorical, etc.
847850
848851
Returns
849852
-------
@@ -1017,8 +1020,8 @@ def get_latest_daily(
10171020
if your internet connection is spotty. The default (None) will set the
10181021
limit to the maximum allowable limit for the service.
10191022
convert_type : boolean, optional
1020-
If True, the function will convert the data to dates and qualifier to
1021-
string vector
1023+
If True, converts columns to appropriate types like numeric, datetime,
1024+
boolean, categorical, etc.
10221025
10231026
Returns
10241027
-------
@@ -1183,8 +1186,8 @@ def get_field_measurements(
11831186
if your internet connection is spotty. The default (None) will set the
11841187
limit to the maximum allowable limit for the service.
11851188
convert_type : boolean, optional
1186-
If True, the function will convert the data to dates and qualifier to
1187-
string vector
1189+
If True, converts columns to appropriate types like numeric, datetime,
1190+
boolean, categorical, etc.
11881191
11891192
Returns
11901193
-------

dataretrieval/waterdata/utils.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,25 @@ def _type_cols(df: pd.DataFrame) -> pd.DataFrame:
684684
685685
"""
686686
cols = set(df.columns)
687-
numerical_cols = ["value", "contributing_drainage_area", "drainage_area", "altitude", "altitude_accuracy", "well_constructed_depth", "hole_constructed_depth"]
688-
time_cols = ["time", "datetime", "last_modified"]
687+
numerical_cols = [
688+
"altitude",
689+
"altitude_accuracy",
690+
"contributing_drainage_area",
691+
"drainage_area",
692+
"hole_constructed_depth",
693+
"value",
694+
"well_constructed_depth",
695+
]
696+
time_cols = [
697+
"begin",
698+
"begin_utc",
699+
"construction_date",
700+
"end",
701+
"end_utc",
702+
"datetime", # unused
703+
"last_modified",
704+
"time",
705+
]
689706
categorical_cols = [
690707
"approval_status",
691708
"monitoring_location_id",

0 commit comments

Comments
 (0)