Skip to content

Commit

Permalink
[ADD] update all figures with GomSpace data
Browse files Browse the repository at this point in the history
  • Loading branch information
hollydinkel committed Jul 24, 2024
1 parent 0d50f50 commit 635229a
Show file tree
Hide file tree
Showing 22 changed files with 39 additions and 31 deletions.
14 changes: 11 additions & 3 deletions financial_data/company_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@
"color" : [0, 96, 176],
"style" : ":"
},
"planet":
"GomSpace":
{"file" : "GomSpace.xlsx",
"start_date" : "2019-12-31",
"end_date" : "2023-12-31",
"sheet" : ["consolidated"],
"color" : [229, 95, 147],
"style" : "dashdot"
},
"Planet":
{"file" : "planet.xlsx",
"start_date" : "2021-01-31",
"end_date" : "2024-04-30",
"sheet" : ["consolidated"],
"color" : [139, 60, 103],
"style" : "-"
},
"satellogic":
"Satellogic":
{"file" : "satellogic.xlsx",
"start_date" : "2021-12-31",
"end_date" : "2023-12-31",
"sheet" : ["consolidated"],
"color" : [6, 32, 92],
"style" : "--"
},
"synspective":
"Synspective":
{"file" : "synspective.xlsx",
"start_date" : "2018-12-31",
"end_date" : "2022-12-31",
Expand Down
Binary file modified images/acf_analysis/diffAssets_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/diffAssets_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/diffEquity_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/diffEquity_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/diffLiabilities_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/diffLiabilities_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnAssets_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnAssets_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnEquity_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnEquity_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnLiabilities_acf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/acf_analysis/lnLiabilities_pacf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/asset_turnover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/financial_leverage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/npm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/roe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_asset_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_equity_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/total_liabilities_growth_rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def plot_growth_rate(fig, ax, data, key, company_metadata, company, ylabel):
ax.set_ylabel(ylabel, fontsize=16)
company_color = np.array(company_metadata[company]["color"]) / 255
ax.plot(data["Quarter"].values[1:], data[key], color=company_color, linestyle=company_metadata[company]["style"], label=company, linewidth=10)
ax.legend(ncol=4, bbox_to_anchor=(.95, -0.15), fancybox=True, title="Company", fontsize='16', frameon=True)
ax.legend(ncol=4, bbox_to_anchor=(0.98, -0.15), fancybox=True, title="Company", fontsize='16', frameon=True)
fig.tight_layout()
box = ax.get_position()
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
Expand All @@ -20,7 +20,7 @@ def plot_kpis(fig, ax, data, key, company_metadata, company, ylabel):
ax.set_ylabel(ylabel, fontsize=16)
company_color = np.array(company_metadata[company]["color"]) / 255
ax.plot(data["Quarter"].values[:], data[key], color=company_color, linestyle=company_metadata[company]["style"], label=company, linewidth=10)
ax.legend(ncol=4, bbox_to_anchor=(0.8, -0.15), fancybox=True, title="Company", fontsize='16', frameon=True)
ax.legend(ncol=4, bbox_to_anchor=(0.93, -0.15), fancybox=True, title="Company", fontsize='16', frameon=True)
fig.tight_layout()
box = ax.get_position()
ax.set_position([box.x0, box.y0 + box.height * 0.2, box.width, box.height * 0.8])
Expand Down
52 changes: 26 additions & 26 deletions src/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def transform_financial_metrics(company, filtered_data):
"diffLogLiabilities": diffLogLiabilities,
"diffLogEquity": diffLogEquity
}
if company == "synspective":
if company == "Synspective":
print("Not enough revenue data")
else:
revenue = filtered_data["Revenue"].values.astype(int)
Expand Down Expand Up @@ -77,18 +77,18 @@ def transform_financial_metrics(company, filtered_data):
exchange_rate = pd.read_csv(exchange_rate_file, header=None, names=['Date', 'Value'])
exchange_rate['Date'] = pd.to_datetime(exchange_rate['Date'])

fig1, ax1 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig2, ax2 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig21, ax21 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig22, ax22 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig23, ax23 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig24, ax24 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig25, ax25 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig26, ax26 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig27, ax27 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig28, ax28 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig29, ax29 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig30, ax30 = plt.subplots(2, 2, figsize=(12, 10), dpi=300)
fig1, ax1 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig2, ax2 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig21, ax21 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig22, ax22 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig23, ax23 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig24, ax24 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig25, ax25 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig26, ax26 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig27, ax27 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig28, ax28 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig29, ax29 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig30, ax30 = plt.subplots(2, 3, figsize=(12, 10), dpi=300)
fig3, ax3 = plt.subplots(figsize=(10, 6), dpi=300)
fig4, ax4 = plt.subplots(figsize=(10, 6), dpi=300)
fig5, ax5 = plt.subplots(figsize=(10, 6), dpi=300)
Expand All @@ -115,24 +115,24 @@ def transform_financial_metrics(company, filtered_data):
transformed_data = transform_financial_metrics(company, filtered_data)
company_color = np.asarray(company_metadata[company]["color"]) / 255 # normalized color coordinates

plot_acf(transformed_data["lnAssets"], lags=3, title=company, ax = ax1[i//2, i%2], color = 'red')
plot_pacf(transformed_data["lnAssets"], lags=2, title=company, ax = ax2[i//2, i%2], color = 'red')
plot_acf(transformed_data["lnLiabilities"], lags=3, title=company, ax = ax21[i//2, i%2], color = 'red')
plot_pacf(transformed_data["lnLiabilities"], lags=3, title=company, ax = ax22[i//2, i%2], color = 'red')
plot_acf(transformed_data["lnEquity"], lags=3, title=company, ax = ax23[i//2, i%2], color = 'red')
plot_pacf(transformed_data["lnEquity"], lags=3, title=company, ax = ax24[i//2, i%2], color = 'red')
plot_acf(transformed_data["diffAssets"], lags=3, title=company, ax = ax25[i//2, i%2], color = 'red')
plot_pacf(transformed_data["diffAssets"], lags=2, title=company, ax = ax26[i//2, i%2], color = 'red')
plot_acf(transformed_data["diffLiabilities"], lags=3, title=company, ax = ax27[i//2, i%2], color = 'red')
plot_pacf(transformed_data["diffLiabilities"], lags=2, title=company, ax = ax28[i//2, i%2], color = 'red')
plot_acf(transformed_data["diffEquity"], lags=3, title=company, ax = ax29[i//2, i%2], color = 'red')
plot_pacf(transformed_data["diffEquity"], lags=2, title=company, ax = ax30[i//2, i%2], color = 'red')
plot_acf(transformed_data["lnAssets"], lags=3, title=company, ax = ax1[i//3, i%3], color = 'red')
plot_pacf(transformed_data["lnAssets"], lags=2, title=company, ax = ax2[i//3, i%3], color = 'red')
plot_acf(transformed_data["lnLiabilities"], lags=3, title=company, ax = ax21[i//3, i%3], color = 'red')
plot_pacf(transformed_data["lnLiabilities"], lags=3, title=company, ax = ax22[i//3, i%3], color = 'red')
plot_acf(transformed_data["lnEquity"], lags=3, title=company, ax = ax23[i//3, i%3], color = 'red')
plot_pacf(transformed_data["lnEquity"], lags=3, title=company, ax = ax24[i//3, i%3], color = 'red')
plot_acf(transformed_data["diffAssets"], lags=3, title=company, ax = ax25[i//3, i%3], color = 'red')
plot_pacf(transformed_data["diffAssets"], lags=2, title=company, ax = ax26[i//3, i%3], color = 'red')
plot_acf(transformed_data["diffLiabilities"], lags=3, title=company, ax = ax27[i//3, i%3], color = 'red')
plot_pacf(transformed_data["diffLiabilities"], lags=2, title=company, ax = ax28[i//3, i%3], color = 'red')
plot_acf(transformed_data["diffEquity"], lags=3, title=company, ax = ax29[i//3, i%3], color = 'red')
plot_pacf(transformed_data["diffEquity"], lags=2, title=company, ax = ax30[i//3, i%3], color = 'red')

fig3 = plot_growth_rate(fig3, ax3, transformed_data, "growthAssets", company_metadata, company, 'Total Asset Growth Rate (%)')
fig4 = plot_growth_rate(fig4, ax4, transformed_data, "growthLiabilities", company_metadata, company, 'Total Liabilities Growth Rate (%)')
fig5 = plot_growth_rate(fig5, ax5, transformed_data, "growthEquity", company_metadata, company, 'Total Equity Growth Rate (%)')

if company == "synspective":
if company == "Synspective":
continue
else:
fig6 = plot_kpis(fig6, ax6, transformed_data, "financialLeverage", company_metadata, company, 'Financial Leverage')
Expand Down

0 comments on commit 635229a

Please sign in to comment.