-
Notifications
You must be signed in to change notification settings - Fork 6
Adding the Compare to... time series options #333
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
Conversation
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.
I would prefer to see the code that's the same for the two plots factored out into a function or a loop rather than copy-pasted. Copy-paste mistakes are easy to make and often hard to notice.
I wonder if the missing controls I commented on below will fix the assertion. If not, let me know and I will investigate.
This plotly issue sounds similar to the problem you saw. It was fixed in plotly.js 2.17.1, which made it into plotly.py in version 5.12. We currently have plotly 5.11. Please try upgrading plotly (and everything else) by following the section "Adding or removing dependencies" in the README. (While you're at it, you could change the title to "Adding, removing, or upgrading dependencies.") Then create a new environment as described in the section "Creating a conda environment with this project's dependencies" (add that pointer to the "Adding..." section too), and test.
While a new conda-lock is building... I have a couple questions. So practically, code could potentially be factored in through the pgo.Scatter objects. Whether I go that far, or not, the question I have is how to deal with the trys/excepts that potentially return in the middle of the code an errorfig? Should the error checkings be inside the factored in function and the function returns an object or an errorfig (it would be weird that the function doesn't return objects of same nature always); or the function returns an object or an error and then follow up code returns the errorfig or keeps going. See per my comment that there is no missing control/id. And the code fails with the Number object that comes after the DataNoYear object anyways... |
Also... how to have italic or bold or what-have-you in the text in our f""" """ strings? When mentioning the name of something in the page like the control Compare to..., I would like to write it Compare to... |
I would keep display concerns (anything related to plotly) out of the calcuation function. Have it return a DataArray (?) on success; on failure, it could either return a sentinel value (e.g. I don't know what difficulty you're having with italics. dcc.Markdown looks like an easy way to get it. " ", """ """, f" ", and f""" """ are all just ways of building a string. You can put markdown in any of them. Want to show me a particular example that didn't work? |
BTW I'm confused by the multiple submit buttons that all seem to do the same thing. |
I also uncommented the assertion you had commented out, and that assertion isn't failing either. Are you sure you don't have any uncommitted changes? |
what is the confusion about more specifically? |
I do still get assertion errors... Actually had to comment one more... |
I still can't reproduce the assertion failure. Do you get it on initial page load, or only after changing certain inputs? If the latter, please give details. |
I actually don't even get the app to run: (enactsmulti) remic@shortfin01:/data/remic/Dash/python-maprooms/enacts/wat_bal (remic/compare)$ CONFIG=../config.yaml:../config-sng.yaml:../myconfig.yaml python maproom_monit.py |
Got it. That one does fail for me. The previous one, in line 151, which you
also commented out, isn't failing (possibly not even being hit--I haven't
tried to understand the flow.).
… Message ID: ***@***.***>
|
I think the only thing still unresolved here is the issue of the multiple submit buttons, which I find problematic.
|
A few comments of different nature about this: 1/ You clearly haven't read the text describing the Maproom. It's also in a scrolling box and so it's also hard to see that there is more to read. Maybe we should change scrolling boxes with collapsable content? 2/ Regardless, a typical user will jump to the controls and not bother read text/instructions until they realize they don't understand what's going on, so the criticism remains valid. 3/ I personally feel those controls take too much space: 4/ I believe those controls/buttons are in individual "Cards" objects that could have bolder or color coded frames so that they can be seen better. Opinions? |
@kgraaf should get involved in this discussion since it has implications for what UI layout options we want in maprooms in general. (See Rémi's comment preceding this one.) @remicousin do you want to move ahead with this version and improve the UI in subsequent PRs? |
I've just pushed with what I was playing with, but happy to revert that. I am not very good at that business. |
My problem with the submit buttons is related to something I've mentioned before: for some reason the input boxes are much wider for me than they are for you, and as a result the form takes much more vertical space. Fixing that would probably make this a non-issue. See screenshot below. Move ahead and address that later? |
It's funny that the behavior differ on your system vs mine... But anyway indeed we already have an issue #251 for this. |
This adds a 2nd time series to the local graph that puts the monitored one in context. Controls allow to compare different things (another planting date, another year, another crop).
There are a couple of problems.
I commented out the assertion in controls.py because it complained even though I really can't tell why it behaves differently from all the other Sentence objects. I printed that it believes the Number object for year_ago is a list instead of what it is asserting. There are Numbers in other Sentences... I don't get it...
The other problem is that the improper behavior of printing additional stuff first mentioned in #302 (and not addressed because we moved then to bar plots for which it's irrelevant) has returned. I get it each time I change the planting date month of the Compare to... ts from default June to May.