Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for #85: Ideate new approach to formatting table/diagram structure in template #97

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

snairdesai
Copy link
Contributor

@snairdesai snairdesai commented Jan 29, 2024

Closes #85.

The purpose of this PR is to extend the template architecture to enable native Excel to PDF conversions. See the issue thread for additional details, and in particular #85 (comment) for the final proposal of the workflow. The core workhorse function is export_excel_tables() in gslab_make() (find the development version here).

@jc-cisneros has been assigned as a reviewer. To review this PR, please complete the following:

  • Carefully review the instructions in /extensions/excel_tables/README.md to ensure they are clear and capture the essence of our proposed direction in Ideate new approach to formatting table/diagram structure in template #85.
  • Review the core functions in gslab_make to ensure they are logical (see the relevant lines here). If preferred, you can also achieve this as part of the parallel PR in gslab_make (see here).
  • Follow the instructions to ensure the process works on your Mac machine.
  • Follow the instructions to ensure the process works on your Windows machine (note we haven't tested this yet, so I expect that there might be errors that you can flag here).

Thanks for the review @jc-cisneros!

@jc-cisneros
Copy link
Contributor

@snairdesai, confirming a successful run on a Mac machine. Some files don't match the ones on this branch. I will push what I have on my end, but feel free to revert/overwrite if needed.

@jc-cisneros
Copy link
Contributor

@snairdesai, I think the current README is too lengthy. My suggestion would be to remove or push down any details on context or extra information. As a user, the first section I want to see is a clear intuition of the input and output, concrete steps for implementation, and only relevant warnings. I would remove all the details on the spreadsheet linking and the description of the function arguments (this should be documented in the code itself).

@snairdesai
Copy link
Contributor Author

@jc-cisneros Sounds good, and I agree. I'll remove the details on linking and function arguments. In the PR, can you use the "suggestion" tag to delete any other lines you feel are irrelevant? I can review and we'll discuss your proposed changes.

@snairdesai
Copy link
Contributor Author

@jc-cisneros: Latest version for your comments pushed in this commit.

@jc-cisneros
Copy link
Contributor

Thanks @snairdesai! The README looks less cluttered now. Will test this on a Windows machine.

@jc-cisneros
Copy link
Contributor

@snairdesai, I got the following error on Windows (also note that you need to run the terminal as administrator to get the right permission level):

\juanc\OneDrive\Desktop\template\paper_slides\code\slides.tex"`
pdf-crop-margins not found. Installing it now...
pdf-crop-margins has been successfully installed.
Error in `export_excel_tables()` for gs_primary: list index out of range

Traceback (most recent call last):
  File "C:\Users\juanc\OneDrive\Desktop\template\paper_slides\..\lib\gslab_make\gslab_make\run_program.py", line 1268, in export_excel_tables
    worksheet = workbook.Worksheets[2]
                ~~~~~~~~~~~~~~~~~~~^^^
  File "C:\Users\juanc\miniconda3\envs\template\Lib\site-packages\win32com\client\dynamic.py", line 322, in __getitem__
    return self._get_good_object_(self._enum_.__getitem__(index))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\juanc\miniconda3\envs\template\Lib\site-packages\win32com\client\util.py", line 41, in __getitem__
    return self.__GetIndex(index)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\juanc\miniconda3\envs\template\Lib\site-packages\win32com\client\util.py", line 65, in __GetIndex
    raise IndexError("list index out of range")
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\juanc\OneDrive\Desktop\template\paper_slides\make.py", line 52, in <module>
    gs.export_excel_tables(PATHS, template = 'gs_primary', scalar = 'gs_primary_scalars.xlsx')
  File "C:\Users\juanc\OneDrive\Desktop\template\paper_slides\..\lib\gslab_make\gslab_make\run_program.py", line 1294, in export_excel_tables
    raise RuntimeError(error_message)
RuntimeError: Error in `export_excel_tables()` for gs_primary: list index out of range

@snairdesai
Copy link
Contributor Author

Thanks @jc-cisneros, that is helpful. I'll try testing this on the lab Windows and see if I can debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ideate new approach to formatting table/diagram structure in template
2 participants