-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add CML GitHub Action #7
base: master
Are you sure you want to change the base?
Conversation
.github/workflows/cml.yaml
Outdated
|
||
jobs: | ||
run: | ||
runs-on: [ubuntu-latest] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HarshCasper - I think we can add the FLINTcloud containers here. Docs on Running Jobs in a Container
-runs-on: [ubuntu-latest]
+container: ghcr.io/moja-global/rest_api_gcbm:master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will add the container for the workflow.
I've been tinkering with the post-processing tools to get some nice summaries. We can add this step to our CML Action:
Then we want to pull out annual summaries. Here's an example that returns the total forest biomass in megatonnes: import sqlite3
import pandas
conn = sqlite3.connect("output/compiled_gcbm_output.db")
query = f"""
SELECT years.year, COALESCE(SUM(i.pool_tc), 0) / 1e6 AS total_biomass_mt
FROM (SELECT DISTINCT year FROM v_age_indicators ORDER BY year) AS years
LEFT JOIN v_pool_indicators i
ON years.year = i.year
WHERE i.indicator = 'Total Biomass'
AND (years.year BETWEEN 1920 AND 2020)
GROUP BY years.year
ORDER BY years.year
"""
df = pd.read_sql_query(query, conn)
ax = df.plot.line("year") # x-axis
ax.figure.savefig('output/total_biomass_mt.png', dpi=300) @yodavo might have some good suggestions for relevant results summaries! |
Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml Update cml.yaml
8f975d8
to
2a89a1c
Compare
1cebe3f
to
b7f1fbe
Compare
This PR is a work-in-progress. Current action items include: