-
Notifications
You must be signed in to change notification settings - Fork 48
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
Auto-detect output format #220
Conversation
This looks good. Other formats that are in use include hdf5 and PyClaw's "petsc" output format. It would be great if those were added to the auto-detect. |
I am about to endeavor on an effort to really implement NetCDF output but these too could be indentified with the extra files and suffix. |
Oops, this breaks if
in @ketch, @mandli: Do we really need to set the format when Also, what file extensions should we look for to auto-detect hdf5 and |
The |
Yes, I honestly don't remember at all how the OutputController works or what might break by setting its file_format to None. |
The |
Yes, I would rather that VisClaw didn't read files at all. It ought to really just deal with Solutions in memory. A few years ago I made some changes in this direction, but it's too difficult to separate it all out at this point. Why not put the functionality proposed in this PR into the pyclaw.Solution object? |
As a VisClaw user, I'd love to see just the opposite - a standalone VisClaw that can work without any other Clawpack repositories. I realize this would be a major reorganization, (and may not even fit into the current clawpack/pyclaw paradigm) but VisClaw could be really useful on its own. I'd vote for a flexible way for users to plug-in their own readers, which of course could be supplied by Clawpack for clawpack users, or supplied as stand-alone readers for people using other packages. |
@donnaaboise I don't think we disagree here. I would like to see the plotting code know nothing about loading data files; i.e., have a clean well-defined interface between the two. Whether the code that loads files lives in the same repository as the vis code is a separate question. In the Griddle project I started (but didn't finish), loading of solutions was to be incorporated into the same package as visualization, while still carefully keeping the two orthogonal. Basically, I think we agree that some parts of PyClaw and VisClaw would work really great if separated out into their own package. That package wouldn't need to know anything about the rest of Clawpack and might be useful to a lot of people who don't use Clawpack. |
@ketch Actually, I am advocating for a vis package that does know how to read files. Or that has a generic interface to either clawpack supplied or user supplied readers. I do agree that where they are stored is probably a separate issue. |
As I said, my plan was to have the package include loading of files. But the functions/subroutines that plot things would not know or care about things like file formats and directories. I don't see a good reason to entangle those the way they are, for instance, in frametools. Indeed, if I get back to developing griddle, the next step was to move the fileio and Solution stuff out of PyClaw and into Griddle. I think that's exactly what you're asking for. Anyway, I think we're both just repeating the same things. |
I agree this needs more discussion before implementing, so I'm closing this broken PR and opened #221 so we don't forget about it. |
I'm sorry; I didn't mean for our discussion to completely derail this. A quick solution might be worthwhile, even if we are planning something more involved later. |
I have something in a branch for PyClaw. Let me make a PR so we can at least continue to have a discussion. I actually think it may still be prudent to set |
Check to see if clawpack/pyclaw#581 addresses this. |
Currently
plotdata.format
insetplot.py
has to be consistent withclawdata.output_format
insetrun.py
. If one isascii
and the otherbinary
then obscure errors happen without explanation.In the proposed change to
data.getframe
, if format is set toNone
, it checks if there are anyfort.b
files in the outdir and if so assumesbinary
, otherwiseascii
.Are
hdf5
ornetcdf
in use and should we try to auto-detect those?Note: This change is needed to allow a single
setplot
to load data from two different outdir's (for comparison plots) in the case they have different formats, not currently possible. A future PR will support this.