Skip to content

Create XMF file template for pebble data HDF5 #56

@ZoeRichter

Description

@ZoeRichter

In a new branch on arfc/ghastly called velocity there is a single new file: ghastly/data.py Within data.py, there is a function called _write_data_xmf. At the moment, it brute-force writes lines of text to a file, and it kinda sucks to look at. However, I believe it would be very doable as a jinja template (which is how Ghastly already auto-generates LAMMPS inputs).

You do not need to understand XMF formatting or HDF5 to do this task. I'm attaching a file that _write_data_xmf created so you know what the correct answer looks like, and can make the template for it.

Anything you'd have to do to get this working has already been done in an existing template (looping, controlling whitespace, etc) - so between the current templates in ghastly/templates/lammps/ and the functions that call those templates in Ghastly, you should have a working example for everything you need to do.

To work on this, you will want to

  1. fork Ghastly from arfc,
  2. clone your fork to get it locally,
  3. add arfc/ghastly as a remote
  4. pull the velocity branch down from arfc so you have it locally
  5. push it back up to your fork,
  6. [actually do the task, committing and pushing commits to YOUR FORK as you work]
  7. when you've finished, you can make a PR of your fork's velocity branch into arfc/ghastly's velocity branch.
  8. Add me as a reviewer, I'll check it over, and then merge your fix into arfc/ghastly's velocity branch when it's ready to go

Then I'll be able to pull in your changes myself from arfc/ghastly's velocity branch to get the fix on my own fork.

here's the example xmf file (made into plain text so I can attach it)

example_xmf.txt

if you compare it to the function, you'll see that it has 50 timesteps, and there is a block it repeats, once for each timestep. this is where you'll want to use a loop in the jinja template itself. Also note that in _write_data_xmf, when it writes strings, variables are inserted like this: {pebble_radius}. Those are the parts of the text that will be variables inside the jinja template, too - everything else in those strings can just be static text in the template.

Metadata

Metadata

Assignees

Labels

Comp:AnalysisThis issue has to do with the analysis component of the code or document. (plots, postprocessing)Comp:CoreThis issue has to do with the main bulk of the code or document. (methods, main content)Difficulty:1-BeginnerThis issue does not require expert knowledge and may be a good issue for new contributors.Priority:1-CriticalThis is the highest priority (i.e. it is blocking other work or facing a deadline).

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions