Skip to content

Commit

Permalink
Fix finances page
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Oct 22, 2024
1 parent 2b30b27 commit 3a0110f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:

# Encrypt pages that are only meant for team consumption
- name: Encrypt some pages
run: staticrypt book/_build/dirhtml/people/index.html -p ${{ secrets.STATICRYPT_PASSWORD }} -d book/_build/dirhtml/people/ --short;
run: |
staticrypt book/_build/dirhtml/people/index.html -p ${{ secrets.STATICRYPT_PASSWORD }} -d book/_build/dirhtml/people/ --short --template-color-primary "#1D4EF5" --template-title "Only for the 2i2c team!" --template-instructions "Check the team BitWarden for the password...";
staticrypt book/_build/dirhtml/finances/index.html -p ${{ secrets.STATICRYPT_PASSWORD }} -d book/_build/dirhtml/finances/ --short --template-color-primary "#1D4EF5" --template-title "Only for the 2i2c team!" --template-instructions "Check the team BitWarden for the password...";
# Upload artifact for looking at later
- uses: actions/upload-artifact@v4
Expand Down
30 changes: 20 additions & 10 deletions book/finances.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def convert_column_string_to_object(string):

## Costs

Costs are manually calculated for now from [this Google Sheet](https://docs.google.com/spreadsheets/d/1OpKfPSIiFTY28OkV6--MhZygvdLVSdmpagjlnge2ELc/edit?usp=sharing). Monthly costs are calculated from the table below.
We'll define a baseline cost as the average over the last three months of this table.
Costs are manually calculated for now from [this Google Sheet](https://docs.google.com/spreadsheets/d/1OpKfPSIiFTY28OkV6--MhZygvdLVSdmpagjlnge2ELc/edit?usp=sharing). These **exclude our Fiscal Sponsor Fee** (because this fee is already subtracted from revenue projections below).

```{code-cell} ipython3
---
Expand Down Expand Up @@ -215,6 +214,8 @@ opportunities = opportunities.rename(columns=rename)
# Convert probability to a %
opportunities["Probability Success"] = opportunities["Probability Success"] / 5
PROBABILITY_CUTOFF = .4
opportunities = opportunities.query("`Probability Success` >= @PROBABILITY_CUTOFF")
# Choose categories based on stage and category
for ix, irow in opportunities.iterrows():
Expand All @@ -232,6 +233,16 @@ for col in numeric_cols:
opportunities.loc[:, col] = opportunities.loc[:, col].astype(float)
```

```{code-cell} ipython3
---
editable: true
slideshow:
slide_type: ''
tags: [remove-input]
---
Markdown(f"Note: All projections **exclude opportunities with < %{PROBABILITY_CUTOFF*100:.0f} probability**.")
```

```{code-cell} ipython3
---
editable: true
Expand All @@ -250,10 +261,11 @@ slideshow:
slide_type: ''
tags: [remove-input]
---
# TURNING THIS OFF because we'll password-protect this page for now.
# Anonymize opportunities if we are in a CI/CD environment because this will be public
if "GITHUB_ACTION" in os.environ:
for ix, name in opportunities["Name"].items():
opportunities.loc[ix, "Name"] = f"Opportunity {ix}"
# if "GITHUB_ACTION" in os.environ:
# for ix, name in opportunities["Name"].items():
# opportunities.loc[ix, "Name"] = f"Opportunity {ix}"
```

```{code-cell} ipython3
Expand Down Expand Up @@ -310,7 +322,7 @@ amortized_records = amortized_records.query("Date >= '2022-01-01'")
amortized_records = amortized_records.sort_values("Monthly amount", ascending=False)
```

+++ {"editable": true, "slideshow": {"slide_type": ""}}
+++ {"editable": true, "slideshow": {"slide_type": ""}, "user_expressions": [{"expression": "PROBABILITY_CUTOFF", "result": {"status": "ok", "data": {"text/plain": "0.4"}, "metadata": {}}}]}

## Budget projections

Expand All @@ -337,7 +349,6 @@ legend_orientation = dict(
x=0.5,
)
def update_layout(fig):
fig.update_layout(
legend=legend_orientation,
Expand Down Expand Up @@ -398,15 +409,14 @@ bar_kwargs = dict(
figures = {}
labels = ["committed", "estimated", "full", "estimated (categories)"]
labels = ["committed", "estimated", "full", "estimated by category"]
for label in labels:
# Bar plot of revenue
data_plot = amortized_records.query(qu_date)
if label == "full":
# If we are using total amount, only use records with >= 40% chance success
data_plot = data_plot.query("`Probability Success` >= .4")
iname = "Monthly amount"
title = "Monthly Revenue if contracts >= 40% chance are awarded"
title = "Monthly Revenue (full contract revenue)"
elif label == "estimated":
iname = "Monthly amount (expected)"
title = "Monthly Revenue (weighted by probability success)"
Expand Down

0 comments on commit 3a0110f

Please sign in to comment.