Skip to content

Better API to execute arbitrary models with arbitrary outputs #12

Open
@Luthaf

Description

@Luthaf

Yuxuan and I have ported a preliminary chemical shielding model to an ase-MetatensorCalculator.
This model returns atom centered non standard properties, namely the chemical shieldings.
I would feel like, that the most natural way to compute these properties woule be like this (ideally even without having to specify the domain name itself):

calc = MetatensorCalculator("model.pt")
frame.set_calculator(calc)
cs_iso = frame.get_properties(["mtt::cs_iso"])

However, currently it requires doing this, which I find not so intuitive:

output = calc.run_model(frame, outputs)
cs_iso = output['mtt::cs_iso'].block(0).values.detach().numpy()

I personally feel like the results should be stored in the results dict as numpy arrays, that way models can be used from users outside the metatensor universe.

Originally posted by @bananenpampe in metatensor/metatensor#658 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions