sisl icon indicating copy to clipboard operation
sisl copied to clipboard

Handling different `order` arguments for sub-calls in fdf reads

Open zerothi opened this issue 1 year ago • 0 comments

Describe the feature

The problem arises when one reads anything from a fdfSile.

Doing fdf.read_geometry(order="fdf") does not tell how it should fetch the other information that might be associated with the geometry.

This could be solved using contexts, or by passing dictionary like arguments:

fdf.read_geometry(order=[..., {"read_lattice" | "lattice": ["fdf"]}]

or similar. This can get quite complicated since it isn't clear which routines are called. (track is your friend here).

A context manager could resolve this:

with fdf.set_order(lattice=["fdf"], geometry="TSHS", nsc=None) as fdf_context:
    geom = fdf_context.read_geometry(...)

zerothi avatar Oct 10 '24 06:10 zerothi