Skip to content

Commit

Permalink
Asc327/procoda parser.py (#283)
Browse files Browse the repository at this point in the history
* test case for test_column_of_data

* test case for test_day_fraction

* added test case for test_time_column_index

* comment out other method that tests time_column_index

* fixed indentation

* added test case for test_data_from_dates

* added test cases and clarified specs for column_start_to_end

* uncommented test_get_data_by_time

* added testing file; changed column_start_to_end test case

* test for plot_columns and removed unnecessary parameter

* added test cases for plot_column

* added valueerror test case

* asserted expression in plot_columns

* added test cases for iplot_columns

* removed parameter for figure in plot_columns and iplot_columns

* testing to see why CI report failed

* column_of_time allows any unit of time return type; test case for it

* added imports to hopefully fix failing build

* testing codecov

* undid testing codecov comment

* attempted to test on file statelog 11-5-19 downloaded into local drive

* get_data_by_state accepts github.com URLS

* implements and tests the intersection function

* optimizing procoda_parser functions

* simplified fxns, added units to get_data_by_time

* Fix documentation on intersect function

* added elapsed time option to get_data_by_time

* Fixed the test_intersect function

* Updated version

Co-authored-by: Alice Zhao <az297@cornell.edu>
Co-authored-by: HannahSi <hs649@cornell.edu>
  • Loading branch information
3 people authored Nov 10, 2020
1 parent a28dd03 commit 0a774df
Show file tree
Hide file tree
Showing 8 changed files with 749 additions and 505 deletions.
486 changes: 172 additions & 314 deletions aguaclara/research/procoda_parser.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name = 'aguaclara',
version = '0.2.5',
version = '0.2.6',
description = (
'An open-source Python package for designing and performing research '
'on AguaClara water treatment plants.'
Expand Down
67 changes: 67 additions & 0 deletions tests/research/data/datalog_11-5-2019.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Day fraction since midnight on 11/5/2019,7 kPa (cm),water flow (mL/s),coag flow (mL/s),max x + 1 (),max cycles (),cycles ()
0.36840286,0,0.5067,0,6,12,0
0.36846073,0,0.5067,0,6,12,0
0.36854175,0,0.5067,0,6,12,0
0.36855332,0,0.5067,0,6,12,0
0.3685649,0,0.5067,0,6,12,1
0.36857646,0,0.5067,0,6,12,1
0.36858804,0,0.5067,0,6,12,1
0.36859962,0,0.5067,0,6,12,1
0.36861119,0,0.5067,0,6,12,1
0.36862276,0,0.5067,0,6,12,1
0.36863434,0,0.5067,0,6,12,1
0.36864591,0,0.5067,0,6,12,1
0.36865749,0,0.5067,0,6,12,1
0.36866906,0,0.5067,0,6,12,1
0.36868065,0,0.5067,0,6,12,1
0.36869221,0,0.5067,0,6,12,1
0.36870379,0,0.5067,0,6,12,1
0.36871537,0,0.5067,0,6,12,1
0.36872693,0,0.5067,0,6,12,1
0.36873852,0,0.5067,0,6,12,1
0.3687501,0,0.5067,0,6,12,1
0.36876166,0,0.5067,0,6,12,1
0.36877323,0,0.5067,0,6,12,1
0.36878481,0,0.5067,0,6,12,2
0.36879637,0,0.5067,0,6,12,2
0.36880795,0,0.5067,0,6,12,2
0.36881954,0,0.5058731,0.0008269,6,12,3
0.3688311,0,0.5058731,0.0008269,6,12,3
0.36884267,0,0.5058731,0.0008269,6,12,3
0.36885425,0,0.5058731,0.0008269,6,12,4
0.36886582,0,0.5058731,0.0008269,6,12,4
0.3688774,0,0.5058731,0.0008269,6,12,4
0.36888897,0,0.5050462,0.0016538,6,12,5
0.36890054,0,0.5050462,0.0016538,6,12,5
0.36891212,0,0.5050462,0.0016538,6,12,5
0.36892369,0,0.5050462,0.0016538,6,12,6
0.36893526,0,0.5050462,0.0016538,6,12,6
0.36894684,0,0.5050462,0.0016538,6,12,6
0.36895841,0,0.5033924,0.0033076,6,12,7
0.36896998,0,0.5033924,0.0033076,6,12,7
0.36898156,0,0.5033924,0.0033076,6,12,7
0.36899313,0,0.5033924,0.0033076,6,12,8
0.36900471,0,0.5033924,0.0033076,6,12,8
0.36901629,0,0.5033924,0.0033076,6,12,8
0.36902785,0,0.5000848,0.0066152,6,12,9
0.36903944,0,0.5000848,0.0066152,6,12,9
0.36905102,0,0.5000848,0.0066152,6,12,9
0.36906258,0,0.5000848,0.0066152,6,12,10
0.36907415,0,0.5000848,0.0066152,6,12,10
0.36908573,0,0.5000848,0.0066152,6,12,10
0.3690973,0,0.4934696,0.0132304,6,12,11
0.36910888,0,0.4934696,0.0132304,6,12,11
0.36912045,0,0.4934696,0.0132304,6,12,11
0.36913202,0,0.4934696,0.0132304,6,12,12
0.3691436,0,0.4934696,0.0132304,6,12,12
0.36915518,0,0.4934696,0.0132304,6,12,12
0.36916674,0,0.4802392,0.0264608,6,12,13
0.36917832,0,0.4802392,0.0264608,6,12,13
0.3691899,0,0.4802392,0.0264608,6,12,13
0.36920146,0,0.4802392,0.0264608,6,12,14
0.36921304,0,0.4802392,0.0264608,6,12,14
0.36922462,0,0.4802392,0.0264608,6,12,14
0.36923619,0,0.4802392,0.0264608,6,12,14
0.36924776,0,0.5067,0,6,12,15
0.36925934,0,0.5067,0,6,12,15
0.36926282,0,0.5067,0,6,12,15
1 change: 1 addition & 0 deletions tests/research/data/datalog_11-5-2019.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Day fraction since midnight on 11/5/2019 7 kPa (cm) water flow (mL/s) coag flow (mL/s) max x + 1 () max cycles () cycles ()0.36840286 0 0.5067 0 6 12 00.36846073 0 0.5067 0 6 12 00.36854175 0 0.5067 0 6 12 00.36855332 0 0.5067 0 6 12 00.3685649 0 0.5067 0 6 12 10.36857646 0 0.5067 0 6 12 10.36858804 0 0.5067 0 6 12 10.36859962 0 0.5067 0 6 12 10.36861119 0 0.5067 0 6 12 10.36862276 0 0.5067 0 6 12 10.36863434 0 0.5067 0 6 12 10.36864591 0 0.5067 0 6 12 10.36865749 0 0.5067 0 6 12 10.36866906 0 0.5067 0 6 12 10.36868065 0 0.5067 0 6 12 10.36869221 0 0.5067 0 6 12 10.36870379 0 0.5067 0 6 12 10.36871537 0 0.5067 0 6 12 10.36872693 0 0.5067 0 6 12 10.36873852 0 0.5067 0 6 12 10.3687501 0 0.5067 0 6 12 10.36876166 0 0.5067 0 6 12 10.36877323 0 0.5067 0 6 12 10.36878481 0 0.5067 0 6 12 20.36879637 0 0.5067 0 6 12 20.36880795 0 0.5067 0 6 12 20.36881954 0 0.5058731 0.0008269 6 12 30.3688311 0 0.5058731 0.0008269 6 12 30.36884267 0 0.5058731 0.0008269 6 12 30.36885425 0 0.5058731 0.0008269 6 12 40.36886582 0 0.5058731 0.0008269 6 12 40.3688774 0 0.5058731 0.0008269 6 12 40.36888897 0 0.5050462 0.0016538 6 12 50.36890054 0 0.5050462 0.0016538 6 12 50.36891212 0 0.5050462 0.0016538 6 12 50.36892369 0 0.5050462 0.0016538 6 12 60.36893526 0 0.5050462 0.0016538 6 12 60.36894684 0 0.5050462 0.0016538 6 12 60.36895841 0 0.5033924 0.0033076 6 12 70.36896998 0 0.5033924 0.0033076 6 12 70.36898156 0 0.5033924 0.0033076 6 12 70.36899313 0 0.5033924 0.0033076 6 12 80.36900471 0 0.5033924 0.0033076 6 12 80.36901629 0 0.5033924 0.0033076 6 12 80.36902785 0 0.5000848 0.0066152 6 12 90.36903944 0 0.5000848 0.0066152 6 12 90.36905102 0 0.5000848 0.0066152 6 12 90.36906258 0 0.5000848 0.0066152 6 12 100.36907415 0 0.5000848 0.0066152 6 12 100.36908573 0 0.5000848 0.0066152 6 12 100.3690973 0 0.4934696 0.0132304 6 12 110.36910888 0 0.4934696 0.0132304 6 12 110.36912045 0 0.4934696 0.0132304 6 12 110.36913202 0 0.4934696 0.0132304 6 12 120.3691436 0 0.4934696 0.0132304 6 12 120.36915518 0 0.4934696 0.0132304 6 12 120.36916674 0 0.4802392 0.0264608 6 12 130.36917832 0 0.4802392 0.0264608 6 12 130.3691899 0 0.4802392 0.0264608 6 12 130.36920146 0 0.4802392 0.0264608 6 12 140.36921304 0 0.4802392 0.0264608 6 12 140.36922462 0 0.4802392 0.0264608 6 12 140.36923619 0 0.4802392 0.0264608 6 12 140.36924776 0 0.5067 0 6 12 150.36925934 0 0.5067 0 6 12 150.36926282 0 0.5067 0 6 12 15
Expand Down
3 changes: 3 additions & 0 deletions tests/research/data/datalog_6-16-2018.xls
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Day fraction since midnight on 6/15/2018 Sensor (cm) Temperature (C) Influent Turbidity (NTU) Effluent Turbidity () PumpControl(Clay) () drain control () Scale (g)
0.00005238 7.39367676 24.26708603 99.84 6.1 0.01503953 0 -999999
0.00016812 7.2499795 24.26683617 100.55 6.12 0.01297213 0 -999999
33 changes: 33 additions & 0 deletions tests/research/data/statelog_11-5-2019.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Day fraction since midnight on 11/5/2019, State ID, State name, Rule that caused previous state to end
0.36842392,0,OFF,Operator changed the state
0.3685598,2,Warmup,Operator changed the state
0.36875633,1,Run,go to run
0.36877994,2,Warmup,go to warmup
0.36879175,1,Run,go to run
0.36881547,2,Warmup,go to warmup
0.36882739,1,Run,go to run
0.3688509,2,Warmup,go to warmup
0.36886304,1,Run,go to run
0.36888666,2,Warmup,go to warmup
0.36889881,1,Run,go to run
0.36892231,2,Warmup,go to warmup
0.36893422,1,Run,go to run
0.36895784,2,Warmup,go to warmup
0.36896999,1,Run,go to run
0.36899372,2,Warmup,go to warmup
0.36900587,1,Run,go to run
0.36902936,2,Warmup,go to warmup
0.36904117,1,Run,go to run
0.36906502,2,Warmup,go to warmup
0.36907704,1,Run,go to run
0.36910055,2,Warmup,go to warmup
0.3691127,1,Run,go to run
0.36913631,2,Warmup,go to warmup
0.36914801,1,Run,go to run
0.36917172,2,Warmup,go to warmup
0.36918353,1,Run,go to run
0.36920725,2,Warmup,go to warmup
0.36921894,1,Run,go to run
0.36924256,2,Warmup,go to warmup
0.36925471,1,Run,go to run
0.3692686,0,OFF,Operator changed the state
1 change: 1 addition & 0 deletions tests/research/data/statelog_11-5-2019.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Day fraction since midnight on 11/5/2019 State ID State name Rule that caused previous state to end0.36842392 0 OFF Operator changed the state0.3685598 2 Warmup Operator changed the state0.36875633 1 Run go to run0.36877994 2 Warmup go to warmup0.36879175 1 Run go to run0.36881547 2 Warmup go to warmup0.36882739 1 Run go to run0.3688509 2 Warmup go to warmup0.36886304 1 Run go to run0.36888666 2 Warmup go to warmup0.36889881 1 Run go to run0.36892231 2 Warmup go to warmup0.36893422 1 Run go to run0.36895784 2 Warmup go to warmup0.36896999 1 Run go to run0.36899372 2 Warmup go to warmup0.36900587 1 Run go to run0.36902936 2 Warmup go to warmup0.36904117 1 Run go to run0.36906502 2 Warmup go to warmup0.36907704 1 Run go to run0.36910055 2 Warmup go to warmup0.3691127 1 Run go to run0.36913631 2 Warmup go to warmup0.36914801 1 Run go to run0.36917172 2 Warmup go to warmup0.36918353 1 Run go to run0.36920725 2 Warmup go to warmup0.36921894 1 Run go to run0.36924256 2 Warmup go to warmup0.36925471 1 Run go to run0.3692686 0 OFF Operator changed the state
Expand Down
Loading

0 comments on commit 0a774df

Please sign in to comment.