AguaClara / aguaclara_research

a python package containing research tools for AguaClara
MIT License
1 stars 4 forks source link

Testing of ProCoDA_Parser.py #6

Closed WPennock closed 6 years ago

WPennock commented 6 years ago

So far, this looks like an excellent module, and I'm looking forward to getting it up and running!

I tried the last two functions, and these were the results:

~\aguaclara_research\aguaclara_research\ProCoDA_Parser.py in read_state_with_metafile(func, state, column, path, units) 595 596 # use a loop to evaluate each experiment in the metafile --> 597 for i in range(paths): 598 # get the range of dates for experiment i 599 day1 = metafile[i+1, 1]

TypeError: only integer scalar arrays can be converted to a scalar index

I believe it was a problem with calling `range` on a list of strings, but I'm not sure.

- `write_calculations_to_csv`:

AttributeError Traceback (most recent call last)

in () ----> 1 pro.write_calculations_to_csv([avg], ["2"], ["1"], "C:\\Users\\whp28\\Google Drive\\AGUACLARA DRIVE\\AguaClara Grads\\William Pennock\\Meta_File.txt", ["mean"], "test.txt") ~\aguaclara_research\aguaclara_research\ProCoDA_Parser.py in write_calculations_to_csv(funcs, states, columns, path, headers, out_name) 684 685 data_agg = [] --> 686 for i in range(headers.len()): 687 ids, data = read_state_with_metafile(funcs[i], states[i], columns[i], path) 688 data_agg = np.append(data_agg, [data]) AttributeError: 'list' object has no attribute 'len' ``` It appears it did not consider the `headers` list to have the property `len()`. Maybe it would be okay to just do `len(headers)`?
fletchapin commented 6 years ago

@WPennock good catch. I changed it to len(headers) and added len(paths)

Both changes should be pushed to master so you can try to test again