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
[WIP] Adding Enzo-P frontend. #1439
Conversation
self.Level = -1 | ||
|
||
def __repr__(self): | ||
return "EnzoPBlock_%s" % self.block_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should match the name of the class, ideally for python objects exec(repr(obj)) should yield the object back (although that's probably not possible here)
yt/frontends/enzo_p/fields.py
Outdated
'AvgElec0': [0, 1, 1], | ||
'AvgElec1': [1, 0, 1], | ||
'AvgElec2': [1, 1, 0], | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be surprised if this was actually useful for Enzo-p, given that it doesn't support MHDCT yet (right?)
yt/frontends/enzo_p/io.py
Outdated
|
||
_particle_position_names = {} | ||
|
||
class EPIOHandler(BaseIOHandler): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be called EnzoPIOHandler
?
Hey I know this is WIP, just wanted to leave some comments that I noticed on initially looking this over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still making my way through, but so far looks good to me. I'll test with data I generate here.
pbar = get_pbar("Parsing Hierarchy ", self.num_grids) | ||
f = open(self.ds.parameter_filename, "r") | ||
fblock_size = 32768 | ||
file_size = f.seek(0, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use os.SEEK_END
here?
file_size = f.seek(0, 2) | ||
nblocks = np.ceil(float(file_size) / | ||
fblock_size).astype(np.int64) | ||
offset = f.seek(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this always going to be offset = 0
?
try: | ||
gf = self.io._read_field_names(grid) | ||
except self.io._read_exception: | ||
raise IOError("Grid %s is a bit funky?", grid.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am moderately pleased this has made its way into the EnzoP
function.
raise IOError("Grid %s is a bit funky?", grid.id) | ||
mylog.debug("Grid %s has: %s", grid.id, gf) | ||
field_list = field_list.union(gf) | ||
if "AppendActiveParticleType" in self.dataset.parameters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not necessary.
This adds a basic Enzo-P frontend representing the current state of Enzo-P hdf5 output. This will be a work in progress for a little while as the Enzo-P format solidifies.
Currently missing (as they are also missing from the format):