-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new get_output_steps() and debugging step annotation #7
base: mapping_parser
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ladinesa I've made some notes in case it helps you navigate this mess of a code 😬
@@ -112,15 +159,62 @@ def get_contributions( | |||
contributions.append({'name': key, **step_data}) | |||
return contributions | |||
|
|||
def set_step(self, source: Dict[str, Any], **kwargs) -> pint.Quantity: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just created this function mimic get_output_data but set the step instead of value from some rnd observable, but it appears to never be called.
# assert sec_outputs[1].custom_outputs[0].name == 'custom_thermodynamic_properties' | ||
# assert sec_outputs[1].custom_outputs[0].value == approx(100.0) | ||
# assert sec_outputs[1].custom_outputs[0].unit == 'newton / angstrom ** 2' | ||
assert sec_outputs[3].step == 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests fail here, so you can see that the energies and temperatures are being set correctly
@@ -284,7 +294,31 @@ class TrajectoryOutputs(outputs.TrajectoryOutputs): | |||
m_def = Section( | |||
validate=False, | |||
# extends_base_section=True, | |||
# a_mapping=dict(hdf5=MapperAnnotation(mapper='.@')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this but it didn't have an effect
# a_mapping=dict(hdf5=MapperAnnotation(mapper='.@')), | ||
) | ||
|
||
# step = Quantity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried to redefine step and then annotate step.m_anno...
below
mapper=( | ||
'set_step', | ||
['.@'], | ||
dict(path='observables.custom_forces'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again just a rnd observ. to test the calling of set_step()
) | ||
# MapperAnnotation(mapper='.step') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this and for time below, with no effect
# ), | ||
) | ||
|
||
custom_outputs.m_def.m_annotations.setdefault('mapping', {})['hdf5'] = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here i think annot should be for TrajectoryOutputs.custom_outputs
No description provided.