yt.frontends.amrvac.io module

AMRVAC-specific IO functions

class yt.frontends.amrvac.io.AMRVACIOHandler(ds)[source]

Bases: yt.utilities.io_handler.BaseIOHandler

io_iter(chunks, fields)
peek(grid, field)
preload(chunk, fields, max_size)
push(grid, field, data)
yt.frontends.amrvac.io.read_amrvac_namelist(parfiles)[source]

Read one or more parfiles, and return a unified f90nml.Namelist object.

This function replicates the patching logic of MPI-AMRVAC where redundant parameters only retain last-in-line values, with the exception of &filelist:base_filename, which is accumulated. When passed a single file, this function acts as a mere wrapper of f90nml.read().

Parameters

parfiles (str, os.Pathlike, byte, or an iterable returning those types) – A file path, or a list of file paths to MPI-AMRVAC configuration parfiles.

Returns

unified_namelist – A single namelist object. The class inherits from ordereddict.

Return type

f90nml.Namelist