Skip to content

Commit 4bbbd57

Browse files
committed
Merge pull request #11 from phobson/misc-cleanup
misc cleanup
2 parents 02ca00d + 01a6e06 commit 4bbbd57

2 files changed

Lines changed: 17 additions & 29 deletions

File tree

pybmpdb/dataAccess.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -87,49 +87,37 @@ def __init__(self, filename, dbtable=None, sqlquery=None, catanalysis=False):
8787
8888
Parameters
8989
----------
90-
9190
filename : string
9291
CSV file or MS Access database containing the data.
93-
9492
dbtable : optional string (defaults to the bundled data')
9593
Table in the MS Access database storing the data for analysis.
9694
Only used if `usingdb` is True.
97-
9895
catanalysis : optional bool (default = False)
9996
Toggles the filtering for data that have been approved for BMP
10097
Category-level analysis
10198
10299
Attributes
103100
----------
104-
105-
self.dbfile : string
101+
dbfile : string
106102
Full path to the database file.
107-
108-
self.driver : string
103+
driver : string
109104
ODBC-compliant Microsoft Access driver string.
110-
111-
self.category_type : string
105+
category_type : string
112106
See Input section.
113-
114-
self.usingdb : bool
107+
usingdb : bool
115108
See Input section.
116-
117-
self.excluded_parameters : list of string or None
109+
excluded_parameters : list of string or None
118110
See `parametersToExclude` in Input section.
119-
120-
self.data : pandas DataFrame
111+
data : pandas DataFrame
121112
DataFrame of all of the data found in the DB or CSV file.
122113
123114
Methods
124115
-------
125-
126-
(see individual docstrings for more info):
127-
128-
- self.connect
129-
- self.redefineBMPCategory
130-
- self.convertTablesToCSV
131-
- self.getAllData
132-
- self.getGroupData
116+
connect
117+
redefineBMPCategory
118+
convertTablesToCSV
119+
getAllData
120+
getGroupData
133121
134122
'''
135123
self.file = filename

pybmpdb/summary.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ def getSummaryData(dbpath=None, catanalysis=False, astable=False,
142142
minstorms=3, minbmps=3, name=None, useTex=False,
143143
excludedbmps=None, excludedparams=None,
144144
**selection):
145-
'''Select offical data from database.
145+
"""
146+
Select offical data from database.
146147
147148
Parameters
148149
----------
@@ -177,7 +178,7 @@ def getSummaryData(dbpath=None, catanalysis=False, astable=False,
177178
-------
178179
subset : pandas.DataFrame or bmpTable
179180
180-
'''
181+
"""
181182

182183
# main dataset
183184
if dbpath is None:
@@ -216,10 +217,9 @@ def getSummaryData(dbpath=None, catanalysis=False, astable=False,
216217
# retention ponds and wetland basins. Samples of an unknown
217218
# type are excluded
218219
querytxt = (
219-
"(sampletype == 'composite') | ("
220-
"(category in {}) | "
221-
"(paramgroup == 'Biological') "
222-
") & (sampletype != 'unknown')"
220+
"(sampletype == 'composite') | "
221+
"((category in {}) | (paramgroup == 'Biological')) & "
222+
"(sampletype != 'unknown')"
223223
).format(grab_BMPs)
224224
subset = table.data.query(querytxt)
225225

0 commit comments

Comments
 (0)