Reporting Script
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Inizia esaminando i punti di ingresso dei comandi di cwms-cli e la pull request collegata #46, quindi confronta i repository esistenti repgen5 e cwms-python. La issue propone diversi motori, formati di output, temi per i template e possibili modifiche al repository, quindi l’ambito e i criteri di accettazione devono essere definiti prima dell’implementazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
CLI Script
Other
Feature Proposal
Talking with @danieltosborne about reports
Integrating Report Generation (repgen) into cwms-cli
What are our thoughts on creating the following
cwms-cli reporting --engine repgen5 --output=myfile.txt --input=mytemplate.txt ..args
or
cwms-cli reporting --engine jinja3 --output=myfile.html --input=myfile.html.j2 ..args
Idea is to make re-use of the existing click arg handling, the same package distribution, and provide users with the ability to have a one stop shop for their scripting needs.
We talked briefly about if it made sense to GitHub sub module these, i.e. keep them in their own repos. But this has potential to archive the existing repgen5 repo?
Another thought, for down the road is we could add a .pdf output and make it use itext (with jpype) with input template libraries.
Details
Repgen would be updated to use cwms-python and jinja and the pdf option later could also use jinja.
This combines the DEF and FORM tags and makes for highly dynamic reports and outsources template documentation to Jinja while making use of the enterprise data fetch library and exposing it's mathematical capabilities straight in the template.
Things like JSON, HTML, TXT, and many other formats are dynamically opened with built-in vscode syntax highlighters.
@NobuNobuu has had success using Jinja + Cwms-Python to generate reports at SWF
Examples:
<!-- templates/_table.html.j2 -->
<div class="table-responsive plot-container mb-5">
<table class="table align-middle table-hover table-bordered mb-0 data-table">
<thead>
<tr class="first-row">
<th rowspan="1">Reservoir</th>
<th colspan="2">Pool Elevation (ft)</th>
</tr>
<tr class="second-row">
<th rowspan="2"></th>
<th rowspan="2">8AM<br>FT-NGVD</th>
</tr>
</thead>
<tbody>
{% for basin_name, reservoirs in basins.items() %}
<tr class="table-secondary">
<th colspan="17" class="text-start">{{ basin_name }}</th>
</tr>
{% for prefix, name in reservoirs %}
<tr class="table-light">
<td class="text-start">{{ name }}</td>
<td>{{ ts(name="keys.elev.inst.1Hour.0.Ccp-Rev", office="SWT") }}</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
Additional thoughts
If we are looking at a whole rewrite of repgen for the new engine in addition to what exists, it was thought we could do that in the repgen repo. But perhaps some change to add it to cwms-cli would help with adoption and get most districts using the same report generation methods.
Going a step further (in the future) we can define standard template types that regions might need. For example
cwms-cli reporting --template-theme=USACE-WM ...args
Related Context or Links
https://jinja.palletsprojects.com/en/stable/
https://github.com/USACE-WaterManagement/repgen5
- Lingua principale
- Python
- Stelle
- 3
- Fork
- 5
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di HydrologicEngineeringCenter/cwms-cli
-
Suggested Clarification about Windows EnvironmentForse già presa @krowvin l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
what is cwms cli?Forse già presa @krowvin l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
HydrologicEngineeringCenter/cwms-cli#284 · 3 commenti · 1 reazione ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
-
Read the Docs suggestion - "What is cwms-cli" - who should install it, and what can you do once its installedForse già presa @krowvin l’ha presa 48 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di HydrologicEngineeringCenter/cwms-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
UKGovernmentBEIS/inspect_ai#6512 ·
I maintainer di solito rispondono entro 1 giorno
-
area/c++ area/core kind/bug-report
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tensorflow/quantum#1140 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Kav-K/GPTDiscord#501 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
UKGovernmentBEIS/inspect_evals#2863 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno