NOAA-OWP / hydrotools

Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data.
Other
54 stars 13 forks source link

Package Request: Plotting Support #168

Closed jarq6c closed 1 year ago

jarq6c commented 2 years ago

This issue is for discussion of incorporating plotting utilities into hydrotools.

jarq6c commented 2 years ago

@aaraney

jarq6c commented 2 years ago

Recent events have highlighted the need to quickly generate hydrographs for arbitrary NWM channel features. I think this need could be fulfilled with a hypothetical hydrotools.dashboard subpackage that provides an interface to facilitate plotting capabilities for various hydrotools using a plugin architecture.

While matplotlib is the standard for publication quality static plots, I think dash and plotly are better suited for the above use-case. However, I can imagine a separate hydrotools.plots subpackage with some sort of "standard" matplotlibrc file meant to produce "publication quality" static plots.

In this case, "publication quality" implies standard figure dimensions, minimum 300 DPI, colorblind friendly pallets, and evidence-based recommendations for visualizing continuous and categorical data. We might also include defaults for non-journal use such as presentations, posters, or web-based formats.

aaraney commented 2 years ago

Can you elaborate a bit more on the distinction between hydrotools.dashboard and hydrotools.plots? I could insert assumptions here, but I won't for conversation sake.

Other questions I have (we can probably punt these a little down the conversation):

jarq6c commented 2 years ago

Certainly.

hydrotools.dashboard could be the primary GUI intended to expose basic functionality of various tools. Perhaps the dashboard is a tabbing interface. For example, hydrotools.nwis_client might include a plugin for hydrotools.dashboard that adds a tab in the main hydrotools.dashboard from which you can quickly retrieve and interactively plot observed streamflow. The target audience might be non-developers and/or people that find current USGS NWIS interfaces cumbersome for quickly exploring multiple hydrographs graphically.

hydrotools.nwm_client might offer a plugin for quickly viewing simulated and observed streamflow on the same plot (perhaps with access to hydrotools.metrics). These types of interactive plots could also help data scientists during the exploratory/data discovery phase of projects.

hydrotools.plots is intended to address the original topic that spurred this issue: helping non-scientific developers quickly generate standardized (read highly-opinionated) static plots for scientific audiences. In this case, PDFs, static web pages, slide decks, and posters would be the target platform.

jarq6c commented 2 years ago

Getting more specific: dashboard is a HydroTools GUI. plots is a HydroTools Python plotting API.

aaraney commented 2 years ago

Thanks for elaborating. I am starting to see more of your vision. I have few clarifying questions:

hydrotools.dashboard could be the primary GUI intended to expose basic functionality of various tools.

  1. What do you have in mind when you say GUI? A web app? A literal GUI (e.g. PyQt5)? A console UI (e.g. rich)
  2. Do you envision the dashboard to be installed and used primarily on end-users hardware? Or will are you thinking this could be configured and deployed as a service?
jarq6c commented 2 years ago

I was thinking a web app using a framework like dash. I think this would be easier to maintain than a full fat GUI, especially with a plugin architecture. This would also allow some flexibility for deployment. The dashboard could be used locally or deployed as a service, though deployment details would be left to users (refer to the documentation on deploying dash apps https://dash.plotly.com/deployment).

aaraney commented 2 years ago

That makes sense. I like that idea. How configurable are you thinking the software would be? Specify the the panels or components you would like to have in some kind of configuration file? So maybe a yaml file or something that determines what dashboard components you want and the data sources they use?

jarq6c commented 1 year ago

The TEEHR project (https://github.com/RTIInternational/teehr) is actively developing Python/Notebook based visualization solutions to support CIROH researchers.