Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
B
bpengine
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 3
    • Merge Requests 3
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  • Confidential and Proprietary
  • BlocPower
  • bpengine
  • Merge Requests
  • !38

Merged
Opened Aug 08, 2019 by Tillie Kottmann@deletescapeOwner

PPTX Template Fill-in Functionality

  • Overview 0
  • Commits 18
  • Changes 8

Created by: john525

Hi, I have added a new directory "pna" in bpeng, with the following new files: pna.py - handles generation of V1 ASHP PNA (ASHP-v1 specific) template.py - handles filling our PPTX template (extensible to other kinds of PNA) discrete_bar_graph.py - generates a pseudo "bar graph" by dynamically coloring in N cells of a table field_format.py - a few helper functions for text formatting

Higher up there is also a new folder dev-templates that contains a PPTX template we can use for python-pptx (local development only, we will have to set up stable versioned links for PPTX templates to be downloaded from in production)

Under the main bpeng test directory, I have added a file pna/test_basic.py that tests the PPTX generation.

To review this PR, cd to your bpengine directory and then:

git checkout pna_updates

Then make a virtual environment using python3 (e.g. virtualenv asdf && source asdf/bin/activate) and install all bpengine dependencies:

pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -r requirements-conda.txt
python3

Then within that python3 shell, you can run:

from tests.pna.test_basic import test
test()

If everything works right, you should get some print statements to stdout, the last of which will be a path to a temporary file. You can then do

exit()
open /tmp/bpeng/74b7dc6f-635b-4a58-8210-aa907c414316/PNS_81_Prospect_Street.pptx

But obviously, replacing that specific path with the path that is printed out from the test function.

Check out the result PPT - if everything looks good, go into tests/pna/test_basic.py and try messing around with some of the input parameters that are passed to the function generate_ashp_pna() to see if it still generates a PPTX that looks correct. Then exit and re-enter the python shell, re-import the test function, and run it again to get a new path to a new PPTX file

If you get any errors importing the module or running the test script, comment them here

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: exconfidential/blocpower/bpengine!38
Source branch: pna_updates