harmonize-wq 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1,245 @@
1
+ Metadata-Version: 2.1
2
+ Name: harmonize_wq
3
+ Version: 0.3.0
4
+ Summary: Package to standardize, clean and wrangle Water Quality Portal data into more analytic-ready formats
5
+ Author-email: Justin Bousquin <Bousquin.Justin@epa.gov>
6
+ License: Creative Commons Legal Code
7
+
8
+ CC0 1.0 Universal
9
+
10
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
11
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
12
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
13
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
14
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
15
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
16
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
17
+ HEREUNDER.
18
+
19
+ Statement of Purpose
20
+
21
+ The laws of most jurisdictions throughout the world automatically confer
22
+ exclusive Copyright and Related Rights (defined below) upon the creator
23
+ and subsequent owner(s) (each and all, an "owner") of an original work of
24
+ authorship and/or a database (each, a "Work").
25
+
26
+ Certain owners wish to permanently relinquish those rights to a Work for
27
+ the purpose of contributing to a commons of creative, cultural and
28
+ scientific works ("Commons") that the public can reliably and without fear
29
+ of later claims of infringement build upon, modify, incorporate in other
30
+ works, reuse and redistribute as freely as possible in any form whatsoever
31
+ and for any purposes, including without limitation commercial purposes.
32
+ These owners may contribute to the Commons to promote the ideal of a free
33
+ culture and the further production of creative, cultural and scientific
34
+ works, or to gain reputation or greater distribution for their Work in
35
+ part through the use and efforts of others.
36
+
37
+ For these and/or other purposes and motivations, and without any
38
+ expectation of additional consideration or compensation, the person
39
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
40
+ is an owner of Copyright and Related Rights in the Work, voluntarily
41
+ elects to apply CC0 to the Work and publicly distribute the Work under its
42
+ terms, with knowledge of his or her Copyright and Related Rights in the
43
+ Work and the meaning and intended legal effect of CC0 on those rights.
44
+
45
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
46
+ protected by copyright and related or neighboring rights ("Copyright and
47
+ Related Rights"). Copyright and Related Rights include, but are not
48
+ limited to, the following:
49
+
50
+ i. the right to reproduce, adapt, distribute, perform, display,
51
+ communicate, and translate a Work;
52
+ ii. moral rights retained by the original author(s) and/or performer(s);
53
+ iii. publicity and privacy rights pertaining to a person's image or
54
+ likeness depicted in a Work;
55
+ iv. rights protecting against unfair competition in regards to a Work,
56
+ subject to the limitations in paragraph 4(a), below;
57
+ v. rights protecting the extraction, dissemination, use and reuse of data
58
+ in a Work;
59
+ vi. database rights (such as those arising under Directive 96/9/EC of the
60
+ European Parliament and of the Council of 11 March 1996 on the legal
61
+ protection of databases, and under any national implementation
62
+ thereof, including any amended or successor version of such
63
+ directive); and
64
+ vii. other similar, equivalent or corresponding rights throughout the
65
+ world based on applicable law or treaty, and any national
66
+ implementations thereof.
67
+
68
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
69
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
70
+ irrevocably and unconditionally waives, abandons, and surrenders all of
71
+ Affirmer's Copyright and Related Rights and associated claims and causes
72
+ of action, whether now known or unknown (including existing as well as
73
+ future claims and causes of action), in the Work (i) in all territories
74
+ worldwide, (ii) for the maximum duration provided by applicable law or
75
+ treaty (including future time extensions), (iii) in any current or future
76
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
77
+ including without limitation commercial, advertising or promotional
78
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
79
+ member of the public at large and to the detriment of Affirmer's heirs and
80
+ successors, fully intending that such Waiver shall not be subject to
81
+ revocation, rescission, cancellation, termination, or any other legal or
82
+ equitable action to disrupt the quiet enjoyment of the Work by the public
83
+ as contemplated by Affirmer's express Statement of Purpose.
84
+
85
+ 3. Public License Fallback. Should any part of the Waiver for any reason
86
+ be judged legally invalid or ineffective under applicable law, then the
87
+ Waiver shall be preserved to the maximum extent permitted taking into
88
+ account Affirmer's express Statement of Purpose. In addition, to the
89
+ extent the Waiver is so judged Affirmer hereby grants to each affected
90
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
91
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
92
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
93
+ maximum duration provided by applicable law or treaty (including future
94
+ time extensions), (iii) in any current or future medium and for any number
95
+ of copies, and (iv) for any purpose whatsoever, including without
96
+ limitation commercial, advertising or promotional purposes (the
97
+ "License"). The License shall be deemed effective as of the date CC0 was
98
+ applied by Affirmer to the Work. Should any part of the License for any
99
+ reason be judged legally invalid or ineffective under applicable law, such
100
+ partial invalidity or ineffectiveness shall not invalidate the remainder
101
+ of the License, and in such case Affirmer hereby affirms that he or she
102
+ will not (i) exercise any of his or her remaining Copyright and Related
103
+ Rights in the Work or (ii) assert any associated claims and causes of
104
+ action with respect to the Work, in either case contrary to Affirmer's
105
+ express Statement of Purpose.
106
+
107
+ 4. Limitations and Disclaimers.
108
+
109
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
110
+ surrendered, licensed or otherwise affected by this document.
111
+ b. Affirmer offers the Work as-is and makes no representations or
112
+ warranties of any kind concerning the Work, express, implied,
113
+ statutory or otherwise, including without limitation warranties of
114
+ title, merchantability, fitness for a particular purpose, non
115
+ infringement, or the absence of latent or other defects, accuracy, or
116
+ the present or absence of errors, whether or not discoverable, all to
117
+ the greatest extent permissible under applicable law.
118
+ c. Affirmer disclaims responsibility for clearing rights of other persons
119
+ that may apply to the Work or any use thereof, including without
120
+ limitation any person's Copyright and Related Rights in the Work.
121
+ Further, Affirmer disclaims responsibility for obtaining any necessary
122
+ consents, permissions or other rights required for any use of the
123
+ Work.
124
+ d. Affirmer understands and acknowledges that Creative Commons is not a
125
+ party to this document and has no duty or obligation with respect to
126
+ this CC0 or use of the Work.
127
+
128
+ Project-URL: Homepage, https://github.com/USEPA/harmonize-wq
129
+ Project-URL: Documentation, https://usepa.github.io/harmonize-wq/
130
+ Project-URL: Bug Tracker, https://github.com/USEPA/harmonize-wq/issues
131
+ Keywords: USEPA,water data,water quality
132
+ Classifier: Programming Language :: Python :: 3
133
+ Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
134
+ Classifier: Operating System :: OS Independent
135
+ Requires-Python: >=3.7
136
+ Description-Content-Type: text/markdown
137
+ Provides-Extra: test
138
+ Provides-Extra: doc
139
+ License-File: LICENSE
140
+
141
+ # harmonize-wq
142
+ Standardize, clean and wrangle Water Quality Portal data into more analytic-ready formats
143
+
144
+ US EPA’s [Water Quality Portal (WQP)](https://www.waterqualitydata.us/) aggregates water quality, biological, and physical data provided by many organizations and has become an essential resource with tools to query and retrieval data using [python](https://github.com/USGS-python/dataretrieval) or [R](https://github.com/USGS-R/dataRetrieval). Given the variety of data and variety of data originators, using the data in analysis often requires data cleaning to ensure it meets the required quality standards and data wrangling to get it in a more analytic-ready format. Recognizing the definition of analysis-ready varies depending on the analysis, the harmonixe_wq package is intended to be a flexible water quality specific framework to help:
145
+ - Identify differences in data units (including speciation and basis)
146
+ - Identify differences in sampling or analytic methods
147
+ - Resolve data errors using transparent assumptions
148
+ - Transform data from long to wide format
149
+
150
+ Domain experts must decide what data meets their quality standards for data comparability and any thresholds for acceptance or rejection.
151
+
152
+ For more complete tutorial information, see: [demos](https://github.com/USEPA/harmonize-wq/tree/main/demos)
153
+
154
+ ## Quick Start
155
+ harmonize_wq can be installed from git using pip:
156
+ ```
157
+ pip install git+https://github.com/USEPA/harmonize-wq.git
158
+ ```
159
+
160
+ ## Example Workflow
161
+ ### dataretrieval Query for a geojson
162
+
163
+ ```python
164
+ import dataretrieval.wqp as wqp
165
+ from harmonize_wq import wrangle
166
+
167
+ # File for area of interest
168
+ aoi_url = r'https://github.com/USEPA/harmonize-wq/raw/master/harmonize_wq/tests/data/PPBays_NCCA.geojson'
169
+
170
+ # Build query
171
+ query = {'characteristicName': ['Temperature, water',
172
+ 'Depth, Secchi disk depth',
173
+ ]}
174
+ query['bBox'] = wrangle.get_bounding_box(aoi_url)
175
+ query['dataProfile'] = 'narrowResult'
176
+
177
+ # Run query
178
+ res_narrow, md_narrow = wqp.get_results(**query)
179
+
180
+ # dataframe of downloaded results
181
+ res_narrow
182
+ ```
183
+
184
+ ### Harmonize results
185
+
186
+ ```python
187
+ from harmonize_wq import harmonize
188
+
189
+ # Harmonize all results
190
+ df_harmonized = harmonize.harmonize_all(res_narrow, errors='raise')
191
+ df_harmonized
192
+ ```
193
+
194
+ ### Clean results
195
+
196
+ ```python
197
+ from harmonize_wq import clean
198
+
199
+ # Clean up other columns of data
200
+ df_cleaned = clean.datetime(df_harmonized) # datetime
201
+ df_cleaned = clean.harmonize_depth(df_cleaned) # Sample depth
202
+ df_cleaned
203
+ ```
204
+
205
+ ### Transform results from long to wide format
206
+ There are many columns in the dataframe that are characteristic specific, that is they have different values for the same sample depending on the characteristic. To ensure one result for each sample after the transformation of the data these columns must either be split, generating a new column for each characteristic with values, or moved out from the table if not being used.
207
+
208
+ ```python
209
+ from harmonize_wq import wrangle
210
+
211
+ # Split QA column into multiple characteristic specific QA columns
212
+ df_full = wrangle.split_col(df_cleaned)
213
+
214
+ # Divide table into columns of interest (main_df) and characteristic specific metadata (chars_df)
215
+ main_df, chars_df = wrangle.split_table(df_full)
216
+
217
+ # Combine rows with the same sample organization, activity, location, and datetime
218
+ df_wide = wrangle.collapse_results(main_df)
219
+
220
+ ```
221
+
222
+ The number of columns in the resulting table is greatly reduced
223
+
224
+ Output Column | Type | Source | Changes
225
+ --- | --- | --- | ---
226
+ MonitoringLocationIdentifier | Defines row | MonitoringLocationIdentifier | NA
227
+ Activity_datetime | Defines row | ActivityStartDate, ActivityStartTime/Time, ActivityStartTime/TimeZoneCode | Combined and UTC
228
+ ActivityIdentifier | Defines row | ActivityIdentifier | NA
229
+ OrganizationIdentifier | Defines row | OrganizationIdentifier | NA
230
+ OrganizationFormalName | Metadata| OrganizationFormalName | NA
231
+ ProviderName | Metadata | ProviderName | NA
232
+ StartDate | Metadata | ActivityStartDate | Preserves date where time NAT
233
+ Depth | Metadata | ResultDepthHeightMeasure/MeasureValue, ResultDepthHeightMeasure/MeasureUnitCode | standardized to meters
234
+ Secchi | Result | ResultMeasureValue, ResultMeasure/MeasureUnitCode | standardized to meters
235
+ QA_Secchi | QA | NA | harmonization processing quality issues
236
+ Temperature | Result | ResultMeasureValue, ResultMeasure/MeasureUnitCode | standardized to degrees Celcius
237
+ QA_Temperature | QA | NA | harmonization processing quality issues
238
+
239
+ ## Issue Tracker
240
+ harmonize_wq is under development. Please report any bugs and enhancement ideas using the issue track:
241
+ https://github.com/USEPA/harmonize-wq/issues
242
+
243
+
244
+ ## Disclaimer
245
+ The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.
@@ -0,0 +1,105 @@
1
+ # harmonize-wq
2
+ Standardize, clean and wrangle Water Quality Portal data into more analytic-ready formats
3
+
4
+ US EPA’s [Water Quality Portal (WQP)](https://www.waterqualitydata.us/) aggregates water quality, biological, and physical data provided by many organizations and has become an essential resource with tools to query and retrieval data using [python](https://github.com/USGS-python/dataretrieval) or [R](https://github.com/USGS-R/dataRetrieval). Given the variety of data and variety of data originators, using the data in analysis often requires data cleaning to ensure it meets the required quality standards and data wrangling to get it in a more analytic-ready format. Recognizing the definition of analysis-ready varies depending on the analysis, the harmonixe_wq package is intended to be a flexible water quality specific framework to help:
5
+ - Identify differences in data units (including speciation and basis)
6
+ - Identify differences in sampling or analytic methods
7
+ - Resolve data errors using transparent assumptions
8
+ - Transform data from long to wide format
9
+
10
+ Domain experts must decide what data meets their quality standards for data comparability and any thresholds for acceptance or rejection.
11
+
12
+ For more complete tutorial information, see: [demos](https://github.com/USEPA/harmonize-wq/tree/main/demos)
13
+
14
+ ## Quick Start
15
+ harmonize_wq can be installed from git using pip:
16
+ ```
17
+ pip install git+https://github.com/USEPA/harmonize-wq.git
18
+ ```
19
+
20
+ ## Example Workflow
21
+ ### dataretrieval Query for a geojson
22
+
23
+ ```python
24
+ import dataretrieval.wqp as wqp
25
+ from harmonize_wq import wrangle
26
+
27
+ # File for area of interest
28
+ aoi_url = r'https://github.com/USEPA/harmonize-wq/raw/master/harmonize_wq/tests/data/PPBays_NCCA.geojson'
29
+
30
+ # Build query
31
+ query = {'characteristicName': ['Temperature, water',
32
+ 'Depth, Secchi disk depth',
33
+ ]}
34
+ query['bBox'] = wrangle.get_bounding_box(aoi_url)
35
+ query['dataProfile'] = 'narrowResult'
36
+
37
+ # Run query
38
+ res_narrow, md_narrow = wqp.get_results(**query)
39
+
40
+ # dataframe of downloaded results
41
+ res_narrow
42
+ ```
43
+
44
+ ### Harmonize results
45
+
46
+ ```python
47
+ from harmonize_wq import harmonize
48
+
49
+ # Harmonize all results
50
+ df_harmonized = harmonize.harmonize_all(res_narrow, errors='raise')
51
+ df_harmonized
52
+ ```
53
+
54
+ ### Clean results
55
+
56
+ ```python
57
+ from harmonize_wq import clean
58
+
59
+ # Clean up other columns of data
60
+ df_cleaned = clean.datetime(df_harmonized) # datetime
61
+ df_cleaned = clean.harmonize_depth(df_cleaned) # Sample depth
62
+ df_cleaned
63
+ ```
64
+
65
+ ### Transform results from long to wide format
66
+ There are many columns in the dataframe that are characteristic specific, that is they have different values for the same sample depending on the characteristic. To ensure one result for each sample after the transformation of the data these columns must either be split, generating a new column for each characteristic with values, or moved out from the table if not being used.
67
+
68
+ ```python
69
+ from harmonize_wq import wrangle
70
+
71
+ # Split QA column into multiple characteristic specific QA columns
72
+ df_full = wrangle.split_col(df_cleaned)
73
+
74
+ # Divide table into columns of interest (main_df) and characteristic specific metadata (chars_df)
75
+ main_df, chars_df = wrangle.split_table(df_full)
76
+
77
+ # Combine rows with the same sample organization, activity, location, and datetime
78
+ df_wide = wrangle.collapse_results(main_df)
79
+
80
+ ```
81
+
82
+ The number of columns in the resulting table is greatly reduced
83
+
84
+ Output Column | Type | Source | Changes
85
+ --- | --- | --- | ---
86
+ MonitoringLocationIdentifier | Defines row | MonitoringLocationIdentifier | NA
87
+ Activity_datetime | Defines row | ActivityStartDate, ActivityStartTime/Time, ActivityStartTime/TimeZoneCode | Combined and UTC
88
+ ActivityIdentifier | Defines row | ActivityIdentifier | NA
89
+ OrganizationIdentifier | Defines row | OrganizationIdentifier | NA
90
+ OrganizationFormalName | Metadata| OrganizationFormalName | NA
91
+ ProviderName | Metadata | ProviderName | NA
92
+ StartDate | Metadata | ActivityStartDate | Preserves date where time NAT
93
+ Depth | Metadata | ResultDepthHeightMeasure/MeasureValue, ResultDepthHeightMeasure/MeasureUnitCode | standardized to meters
94
+ Secchi | Result | ResultMeasureValue, ResultMeasure/MeasureUnitCode | standardized to meters
95
+ QA_Secchi | QA | NA | harmonization processing quality issues
96
+ Temperature | Result | ResultMeasureValue, ResultMeasure/MeasureUnitCode | standardized to degrees Celcius
97
+ QA_Temperature | QA | NA | harmonization processing quality issues
98
+
99
+ ## Issue Tracker
100
+ harmonize_wq is under development. Please report any bugs and enhancement ideas using the issue track:
101
+ https://github.com/USEPA/harmonize-wq/issues
102
+
103
+
104
+ ## Disclaimer
105
+ The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.
@@ -0,0 +1,11 @@
1
+ from harmonize_wq import harmonize
2
+
3
+ try:
4
+ from importlib.metadata import version, PackageNotFoundError
5
+ except ImportError:
6
+ from importlib_metadata import version, PackageNotFoundError
7
+
8
+ try:
9
+ __version__ = version('harmonize_wq')
10
+ except PackageNotFoundError:
11
+ __version__ = "version-unknown"