serpent-tools icon indicating copy to clipboard operation
serpent-tools copied to clipboard

ENH Return self from reader read method

Open drewejohnson opened this issue 11 months ago • 0 comments

Is your feature request related to a problem? Please describe. Not related to a problem, but related to separating out readers from things holding the read data - #335

Right now, if a script is doing, e.g.,

import serpentTools
r = serpentTools.ResultsReader(...)
r. read()
# do stuff
r.resdata["colKeff"]

and we then change it such that ResultsReader does not store the read data (see #335), then the script would break because the results reader does not store result data.

I think an intermediate solution would be to return self from r.read and encourage people to use the following pattern

r = serpentTools.ResultsReader(...)
data = r.read()
data.resdata["colKeff"]

drewejohnson avatar Aug 07 '23 23:08 drewejohnson