usnistgov / AusteniteCalculator

Software and GUI for uncertainty quantification of austenite phase fraction
Other
1 stars 0 forks source link

Display Precision in tables #8

Closed creuzige closed 2 years ago

creuzige commented 2 years ago

I've tried a few times to truncate the precision of the items in the normalized intensity table with no success. I added and commented out what I've tried. Most of the suggestions from Dash suggest modifying the DataFrame or data directly, which I'd prefer not to do.

dnewton600 commented 2 years ago

One option that I sometimes use is having the full DataFrame available for computations, but then round whichever columns as you are plotting it..

creuzige commented 2 years ago

Open to that, but it seemed like what gets returned to be plotted isn't the dataframe anymore, it's a dictionary. Maybe there are other ways to return values/tables we should look into? I felt that a bit when trying to add additional terms to plot...

dnewton600 commented 2 years ago

Yeah, it's kind of annoying that dash data_table can't just take in a pandas DataFrame.. perhaps it'd be better to keep the table as a dataframe and to write a short function that converts the DF to a dictionary only when needed for plotting (and we can do the same for rounding)

creuzige commented 2 years ago

I like that plan. Then we probably could just return dataframes from the compute* modules. And maybe then just output the dataframes to a file...

dnewton600 commented 2 years ago

To your last sentence, do you think we should have a 'download as .csv' button for the user to download the tables as a csv?

creuzige commented 2 years ago

I think Max started on something like this, i.e. being able to download a 'report'. But the content and format hasn't gotten ironed out yet.