jonnymaserati / welleng

A collection of Wells/Drilling Engineering tools, focused on well trajectory planning for the time being.
Apache License 2.0
113 stars 31 forks source link

Example evaluating_clearance.py doesn't work. ValueError: Data must be 1-dimensional #145

Closed sensebur closed 8 months ago

sensebur commented 1 year ago

Example evaluating_clearance.py doesn't work. ValueError: Data must be 1-dimensional

Problem: python version 3.7.15 (default, Nov 24 2022, 18:44:54) [MSC v.1916 64 bit (AMD64)] welleng 0.5.1 on Windows. pandas version 1.3.5

1) ValueError: Data must be 1-dimensional 2) IndexError: At least one sheet must be visible

Exporting data to data/output/output.xlsx... Traceback (most recent call last): File "C:\welleng-main\examples\evaluating_clearance.py", line 266, in df = pd.DataFrame(data=data) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\frame.py", line 614, in init mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\internals\construction.py", line 465, in dict_to_mgr arrays, data_names, index, columns, dtype=dtype, typ=typ, consolidate=copy File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\internals\construction.py", line 124, in arrays_to_mgr arrays = _homogenize(arrays, index, dtype) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\internals\construction.py", line 590, in _homogenize val, index, dtype=dtype, copy=False, raise_cast_failure=False File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\construction.py", line 576, in sanitize_array subarr = _sanitize_ndim(subarr, data, dtype, index, allow_2d=allow_2d) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\core\construction.py", line 627, in _sanitize_ndim raise ValueError("Data must be 1-dimensional") ValueError: Data must be 1-dimensional

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\welleng-main\examples\evaluating_clearance.py", line 266, in df = pd.DataFrame(data=data) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\io\excel_base.py", line 1020, in exit self.close() File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\io\excel_base.py", line 1024, in close content = self.save() File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\pandas\io\excel_openpyxl.py", line 80, in save self.book.save(self.handles.handle) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\workbook\workbook.py", line 407, in save save_workbook(self, filename) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\writer\excel.py", line 293, in save_workbook writer.save() File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\writer\excel.py", line 275, in save self.write_data() File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\writer\excel.py", line 89, in write_data archive.writestr(ARC_WORKBOOK, writer.write()) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\workbook_writer.py", line 148, in write self.write_views() File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\workbook_writer.py", line 135, in write_views active = get_active_sheet(self.wb) File "C:\Users\username\anaconda3\envs\welleng\lib\site-packages\openpyxl\workbook_writer.py", line 33, in get_active_sheet raise IndexError("At least one sheet must be visible") IndexError: At least one sheet must be visible

Process finished with exit code -1

Solution: ?

jonnymaserati commented 1 year ago

Thanks again @sensebur. Appologies, I thought I'd fixed this one but I see I never pushed this fix to the main branch. I'll get that done now.

jonnymaserati commented 1 year ago

@sensebur this should be sorted now if you install v0.7.3.

jonnymaserati commented 8 months ago

This was fixed.