Custom definition of properties in the scripting module#494
Conversation
|
Could this be made to work with compute functions provided by someone else than the user running the simulation? I.e. can we write Other wishes I have would be to allow using this from the # in ipi/metatomic.py
class compute_properties:
def __init__(self, template, outputs, …):
...
def __call__(self, simulation):
...and then in something like <output prefix='script-c-p'>
<custom_property name="custom" class="ipi.metatomic.compute_properties">
template.xyz, outputs_name, … </def>
</custom_property>
<properties stride='2' filename='out'>[ step, custom ]</properties>
</output> |
It already works roughly like that, look at the example in |
GardevoirX
left a comment
There was a problem hiding this comment.
LGTM, this works well with the additional inputs recently added in metatomic. Maybe worth adding a more detailed example in atomistic cookbook after this PR in metatomic repo
* Add machinery to define (and output) custom properties in the scripting module * Better names * Added an example, including the use of a class method to compute a property
This allows defining new properties, that can then be computed and output with the usual i-PI output mechanism.