Skip to content

Customizable questionsets and web app - #2

Open
suung wants to merge 9 commits into
mainfrom
questionsets
Open

Customizable questionsets and web app#2
suung wants to merge 9 commits into
mainfrom
questionsets

Conversation

@suung

@suung suung commented Aug 24, 2024

Copy link
Copy Markdown
Collaborator

Pull Request: Integrate Question Set Functionality and Enhance Analysis Workflow

Summary

This pull request introduces significant enhancements to the Climate+Tech Sustainability Report Analytics App. The key changes include the integration of question set functionality, improved directory management, and enhanced analysis workflow. These updates aim to provide a more flexible and robust tool for sustainability report analysis.

Changes

  1. Question Set Integration:

    • Added support for multiple question sets, allowing users to select and customize question sets for analysis.
    • Introduced a new question_sets directory to store YAML files defining different question sets.
    • Updated code/app.py to load and use the selected question set during analysis.
  2. Directory Management:

    • Defined and created necessary directories (input, output, data, question_sets) if they do not exist.
    • Updated paths in code/app.py to dynamically use directories based on the selected question set.
  3. Enhanced Analysis Workflow:

    • Modified code/app.py to include the relative path to app.py when running the analysis script.
    • Improved the handling of uploaded reports and question sets in code/web.py.
    • Added functionality to generate and download CSV files containing analysis results.
    • Implemented radar chart visualization for comparing scores across reports.
  4. Environment Variable Management:

    • Added .env file support to manage environment variables securely.
    • Updated .gitignore to exclude sensitive directories and files (input/, output/, data/, .env).
  5. Code Refactoring and Cleanup:

    • Refactored code/document.py, code/reader.py, and code/user_qa.py to remove hardcoded values and use environment variables.
    • Introduced utility functions in code/utils.py for loading configurations, structuring data, and generating CSV files.
    • Added a new code/config.py to manage configuration loading.
  6. Documentation and Comments:

    • Added comments and documentation to improve code readability and maintainability.
    • Updated the Streamlit app to include links to relevant research papers and the Climate+Tech website.

Files Added/Modified

  • .env.sample
  • .gitignore
  • code/app.py
  • code/cfg.py
  • code/config.py
  • code/document.py
  • code/reader.py
  • code/user_qa.py
  • code/utils.py
  • code/web.py
  • question_sets/default.yaml

How to Test

  1. Clone the repository and switch to the branch for this pull request.
  2. Create a .env file based on the .env.sample and add the necessary environment variables.
  3. Run the Streamlit app using streamlit run code/web.py.
  4. Upload a sustainability report and select a question set to run the analysis.
  5. Verify that the analysis completes successfully and the results are available for download as a CSV file.
  6. Check the radar chart visualization for comparing scores across reports.

Additional Notes

  • Ensure that the OpenAI API key is set in the .env file for the analysis to work correctly.
  • Review the changes to the directory structure and paths to avoid any potential issues with file management.

@pr (Diff with Main Branch)

@suung suung changed the title Customiable questionsets and web app Customizable questionsets and web app Aug 24, 2024
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.

1 participant