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

[WIP] Adding Enzo-P frontend. #1439

Closed
wants to merge 0 commits into from

Conversation

brittonsmith
Copy link
Member

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):

  • units
  • particles
  • runtime parameters

self.Level = -1

def __repr__(self):
return "EnzoPBlock_%s" % self.block_name
Copy link
Member

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)

'AvgElec0': [0, 1, 1],
'AvgElec1': [1, 0, 1],
'AvgElec2': [1, 1, 0],
}
Copy link
Member

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?)


_particle_position_names = {}

class EPIOHandler(BaseIOHandler):
Copy link
Member

@ngoldbaum ngoldbaum Jun 5, 2017

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?

@ngoldbaum
Copy link
Member

Hey I know this is WIP, just wanted to leave some comments that I noticed on initially looking this over

Copy link
Member

@matthewturk matthewturk left a 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)
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not necessary.

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

Successfully merging this pull request may close these issues.

None yet

3 participants