Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ice-dev] [ice-build] [eclipse/ice] b5d553: Removed the CSVPlot.hasValidProvider() method, and...

If you want, I could take a look at this. It feels like this is right up my alley considering how closely I've been working with the IVizService interfaces. Also, I need to hook up the VisItVizService to the ICEResourcePage, so there's quite a bit of overlap...

Jordan
________________________________________
From: ice-dev-bounces@xxxxxxxxxxx <ice-dev-bounces@xxxxxxxxxxx> on behalf of Jay J. Billings <billingsjj@xxxxxxxx>
Sent: Tuesday, February 17, 2015 2:45 PM
To: ice-dev@xxxxxxxxxxx
Subject: Re: [ice-dev] [ice-build] [eclipse/ice] b5d553: Removed the CSVPlot.hasValidProvider() method, and...

Anna,

Check the documentation for IPlot.draw():

This operation directs the IPlot to draw itself in its parent as the
specified plot type. The exact details of how the plot is drawn and what
is drawn inside the parent composite are left completely up to the
implementation. This operation may be called multiple types to change
its type. It is expected that the implementation will know how to clear
the parent, if necessary, or to otherwise manage its own drawing
service. There is no guarantee that the caller will clear the parent.

Specified by: draw(...) in IPlot
Parameters:
category - The category of the plot to create. That is, the key in the
map; something "line" or "scatter" using the example from getPlotTypes();
plotType - The type of plot that this IPlot should show
parent - The composite in which the plot should be drawn.
Throws:
Exception - This exception indicates that they IPlot could not be drawn
with either the given type or parent and explains why.

Notice that it throws an exception. If the DataProvider is null, draw()
should throw an exception and line 293 of ICEResourcePage.java should
call e.printStackTrace() and clean itself up. This would include
notifying the user that the exception was caught and removing any plots
from the plot composite, map, etc. I designed this into the interface as
the "final and ultimate" mechanism to stop a bad plot, but the onus is
on the implementation to throw the exception. It shouldn't be a check;
just an exception that gets caught and handled appropriately.

Note that to get this to work you may need to move the call to
plotComposite.layout() to be between 295 and 296 of ICEResourcePage.java.

So, consider fixing all of that exception stuff step 1.

Step 2 is to figure out whether or not the data in the file can still be
plotted even though it is m x n_i where i is the row number such that
row one has length n_1, row two has length n_2, etc. all the way to
length n_m for row m. CSV files are typically plotted
column-against-column, so as long as the columns are the same length we
shouldn't really have a problem. We can do either truncation or
interpolation/extrapolation if they have different lengths. If n_i
changes in an unpredictable way then you need to check with the BISON
team to make sure this is the expected behavior before we go any further
on fixing it. If it is, then we need to rewrite the provider to insert
zeros or interpolate. If not, then we have found a bug in BISON.

Jay

On 02/17/2015 02:20 PM, Wojtowicz, Anna wrote:
> Well, a plot with invalid data will still show up in the ResourceComponent. A user can still click on it, and that's where I make use of the isValidPlot() method, to check if the resource should actually attempt to plot (will throw errors), or just complain (which is what it currently does, in the console).
>
> I haven't found a better place to put this kind of check, because IPlots are handled in generally this order on the ICEResourcePage:
>
> 1.) ResourceComponent updates to say "hay I got some plots"
> 2.) ICEResourcePage checks the ResourceComponent for new VizResources (CSV files in this case)
> 3.) If a new VizResource is found, it will create a CSVDataLoader. The URI is valid, the file exists, everything checks out in this respect.
> 4.) CSVDataLoader calls load(), which returns a CSVDataProvider object, which gets stored on the CSVPlot object. This is what contains the actual CSV data. Here's the caveat -- if the CSV file isn't in a m x n format (which is necessary for plotting), I've made it so the CSVDataLoader will just exit (and print an error), which causes the CSVDataProvider to be null. Now we have a CSVPlot with a null CSVDataProvider (ie. no data because it was invalid)
>
> ________________________________________
> From: ice-dev-bounces@xxxxxxxxxxx <ice-dev-bounces@xxxxxxxxxxx> on behalf of Deyton, Jordan H. <deytonjh@xxxxxxxx>
> Sent: Tuesday, February 17, 2015 1:50 PM
> To: ice developer discussions
> Subject: Re: [ice-dev] [ice-build] [eclipse/ice] b5d553: Removed the CSVPlot.hasValidProvider() method, and...
>
> Anna,
>
> I think the reason he said "Jordan" was because he and I discussed the same issue a few days ago.
>
> In any case, if the data is invalid but otherwise has CSV plot types, shouldn't the CSVPlot have some way to deal with it? Maybe open a dialog explaining the invalid data or just expose what data can be displayed? Then you wouldn't need the extra method on IPlot.
>
> Just one option to consider...
>
> Jordan
>
> ________________________________________
> From: ice-dev-bounces@xxxxxxxxxxx <ice-dev-bounces@xxxxxxxxxxx> on behalf of Wojtowicz, Anna <wojtowicza@xxxxxxxx>
> Sent: Tuesday, February 17, 2015 1:29 PM
> To: ice developer discussions
> Subject: Re: [ice-dev] [ice-build] [eclipse/ice] b5d553: Removed the CSVPlot.hasValidProvider() method, and...
>
> (It was me who put it in, not Jordan)
>
>
> This was motivated by realizing that some BISON CSV files don't have valid m x n formats (i.e. some rows shorter or longer). The plot types list is created and filled at construction, and then actual data is loaded into it after that. So it is possible in this sense, for the plot to have a valid list of plot types, but have invalid data.? Is there a better way to address this gap?
>
>
> Anna
>
>
> ________________________________
> From: ice-dev-bounces@xxxxxxxxxxx <ice-dev-bounces@xxxxxxxxxxx> on behalf of Jay J. Billings <billingsjj@xxxxxxxx>
> Sent: Tuesday, February 17, 2015 12:37 PM
> To: ice developer discussions
> Subject: Re: [ice-dev] [ice-build] [eclipse/ice] b5d553: Removed the CSVPlot.hasValidProvider() method, and...
>
> Jordan,
>
> I would expect isValidPlot() to basically be a convenience method that essentially wraps getPlotTypes() and checks whether the map is empty? That was the original way that I intended IPlot to work because it should be able to
> 1.) Check the file type and see if it can even load it.
> 2.) Read the head, if one is available, and determine what it can load.
> 3.) Throw an exception if it cannot plot it.
>
> If isValidPlot() is for something else and I am missing it, please correct me. My goal is to make sure that we don't end up bloating the implementation or the interfaces.
>
> Jay
>
> On 02/17/2015 11:54 AM, GitHub wrote:
>
>    Branch: refs/heads/anna/postprocessing
>    Home:   https://github.com/eclipse/ice
>    Commit: b5d5534aae05fe5bf826fd31720b898048a6035c
>        https://github.com/eclipse/ice/commit/b5d5534aae05fe5bf826fd31720b898048a6035c
>    Author: Anna Wojtowicz <wojtowicza@xxxxxxxx><mailto:wojtowicza@xxxxxxxx>
>    Date:   2015-02-17 (Tue, 17 Feb 2015)
>
>    Changed paths:
>      M src/org.eclipse.ice.client.widgets/src/org/eclipse/ice/client/widgets/ICEResourcePage.java
>      M src/org.eclipse.ice.client.widgets/src/org/eclipse/ice/client/widgets/viz/service/IPlot.java
>      M src/org.eclipse.ice.viz.service.visit/src/org/eclipse/ice/viz/service/visit/VisItPlot.java
>      M src/org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/csv/CSVPlot.java
>
>    Log Message:
>    -----------
>    Removed the CSVPlot.hasValidProvider() method, and instead added a
> method to the IPlot interface called isValidPlot() that returns a
> boolean. It will be up to each implementation to discern what is/isn't
> valid plotting data. This is necessary because it's still possible to
> have a valid IPlot object, but have invalid data loaded into it.
>
> Signed-off-by: Anna Wojtowicz <wojtowicza@xxxxxxxx><mailto:wojtowicza@xxxxxxxx>
>
>
>
>
>
>
> _______________________________________________
> ice-build mailing list
> ice-build@xxxxxxxxxxx<mailto:ice-build@xxxxxxxxxxx>
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/ice-build
>
>
>
> --
> Jay Jay Billings
> Oak Ridge National Laboratory
> Twitter Handle: @jayjaybillings
> _______________________________________________
> ice-dev mailing list
> ice-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/ice-dev
> _______________________________________________
> ice-dev mailing list
> ice-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/ice-dev
> _______________________________________________
> ice-dev mailing list
> ice-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/ice-dev

--
Jay Jay Billings
Oak Ridge National Laboratory
Twitter Handle: @jayjaybillings

_______________________________________________
ice-dev mailing list
ice-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/ice-dev


Back to the top