Skip to content
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

Repeated calls to solution.read() do not modify the solution #519

Open
ketch opened this issue May 30, 2015 · 2 comments
Open

Repeated calls to solution.read() do not modify the solution #519

ketch opened this issue May 30, 2015 · 2 comments

Comments

@ketch
Copy link
Member

ketch commented May 30, 2015

The solution.read method loads a solution from file into an existing (empty) solution object. However, if a solution has already been loaded into a given object, attempting to load a different solution into it has no effect. This is easily reproduced by doing the following in a directory that has output in ./_output/:

s = pyclaw.Solution()
s.read(0)
print s.t
s.read(1)
print s.t

The printed time will be the same for both frames.

@ketch
Copy link
Member Author

ketch commented May 30, 2015

I haven't yet investigated what causes this, but it strikes me that a better interface would look like:

solution = pyclaw.io.read(frame=0,path='./_output',file_format='hdf5')

That is, the read functions would not be methods belonging to Solution, but just stand-alone functions that return a Solution object.

@mandli
Copy link
Member

mandli commented Jun 2, 2015

+1 on removing the read functionality from solution. I would say that we should keep the ability to initialize a solution object by providing a path and frame, in effect calling the appropriate read functionality. The read function in solution does not do a whole lot anyway. Also, as an added benefit this jives with @ketch's proposal for griddle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants