Conversation
|
As discussed, you could use variables to define that input (strings) that are added to the html site that you create with plotly: (I do not konw if %s and so on is the right way to use variables with the dash library, but something like that). |
|
If you have questions with Dash, I can help :) using |
|
thank you @Bachibouzouk |
|
Hi @mahendrark, is anything you can push to this branch? I would be really happy to have a look at the HTML/dash HTML/code until our call on Wednesday! :) |
smartie2076
left a comment
There was a problem hiding this comment.
Cool, thanks for the update!
Can you add the libraries I have to install to test the code in the requirements.txt?
This will probably have to be added: |
|
@smartie2076 , I will add the packages used to requirements.txt once I am done with the HTML Layout script. Other packages might be needed as well. In addition to the changes you suggested, I will also make branch-id as a separate variable so that we can use the technic @SabineHaas suggested in the issue thread #134 |
I think it is better to include them step by step, so that when I or so. else pulls your branch to test it can also execute it effortlessly.
👍 |
|
Maybe this will help with the tables? Link to plotly dash tutorial |
|
Hi @mahendrark, I suppose I did something not quite proper by directly committing "Add simDate=today()" to the branch - sorry. It defines simDate directly with todays date. |
src/F2_autoreport.py
Outdated
| '/logo-eland-original.svg', width='370px'), | ||
| html.H1('MULTI VECTOR SIMULATION - REPORT SHEET')], | ||
| style={ | ||
| 'textAlign': 'center', |
There was a problem hiding this comment.
It is better to save all the style setting in a class def in a cssfile, then use the prop className to link to the class. For small project inline styling is ok though.
There was a problem hiding this comment.
You can save the css file in a folde rnamed assets then dash will automatically load it (the folder should be in the same path as the file defining the app)
src/F2_autoreport.py
Outdated
|
|
||
| html.Div(className='inpdatabox', children=[html.H2('INPUT DATA')], | ||
| style={ | ||
| 'textAlign': 'center', |
There was a problem hiding this comment.
In the css file you can add this to
.inpdatabox h2{
...
}
|
@mahendrark - I don't see graphs or tables here, could you push everytime you make progress on this branch? You can create functions which return an A good thing to do is to always make the rough html structure of the whole report, then fill the sections |
| import dash_html_components as html | ||
| import time | ||
| import pandas as pd | ||
| import reverse_geocoder as rg |
There was a problem hiding this comment.
Please add this also to requirements.txt:
reverse_geocoder=1.5.1
scipy=1.4.1
| # This script generates a report of the simulation automatically, with all the important data. | ||
|
|
||
| # Importing necessary packages | ||
| import dash |
There was a problem hiding this comment.
"Updates" is not a very helpful commit message, especially if all your commit messages are "Updates" :)
There was a problem hiding this comment.
You can stlll change it by doing git commit --amendand then git push -f
|
@smartie2076 For some reason, the browser doesnt render those when I run the script. |
|
@mahendrark - I know why, you can't directly provide png :) Let me find the process for you: |
|
You can find the plot functions in F1. Specifically, here |
|
@smartie2076 & @Bachibouzouk, Which plots to choose if there are multiple PV components and demand time series? |
In the future, there will be multiple PV components/demands - they should all be in the automatic report at some point. Basically, we only have to wrap a loop around the calls of html.Img() to add them all in later.
Yeah, there is a standardized format - we can create the loop from that format but also the json_processed file. For now, please concencrate on the simple example given with the "inputs" on dev. The other stuff comes in the next iteration! :) |
|
@mahendrark - you can use the raw data to make plotly plots :) |
|
I am struggling a bit with the pdf report generation. Can you please help me out? Specific question.. how do we save a HTML file from the dash web app ? |
src/F2_autoreport.py
Outdated
|
|
||
|
|
||
|
|
||
| dfprojectData = pd.read_csv('../inputs/csv_elements/project_data.csv') |
There was a problem hiding this comment.
Did you run black . prior to committing? I am not sure why you commit 3 empty spaces?
There was a problem hiding this comment.
Oops. This is a mistake. I wanted to read the data just below the three empty lines from JSONs as well. But then postponed it and forgot to remove these lines. Consider them placeholders xD
|
@Bachibouzouk agreed to take over the task of integrating F2 into the mvs.
|
|
@mahendrark - I would say that this PR should be merged and subsequent PR should be made for
|
|
@Bachibouzouk I will take up all other tasks in the next PR, as you suggested. |
Added sectors
…ormatting of sectors
51c2e2d to
44b6df9
Compare
Bachibouzouk
left a comment
There was a problem hiding this comment.
This will be merged as is and subsequent PR will be opened for improvements to the feature of auto-reporting and integration into mvs
Fix #134
Changes proposed in this pull request:
The following steps were realized, as well (if applies):
black . --exclude docs/)Please mark above checkboxes as following:
❌ Check not applicable to this PR
For more information on how to contribute check the CONTRIBUTING.md.