Skip to content
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

Open
wants to merge 9 commits into
base: mapping_parser
Choose a base branch
from

Conversation

JFRudzinski
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

@JFRudzinski JFRudzinski left a 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:
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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='.@')),
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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'),
Copy link
Collaborator Author

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')
Copy link
Collaborator Author

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'] = (
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants