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

Rob/mdanse trajectory filter #615

Open
wants to merge 27 commits into
base: protos
Choose a base branch
from

Conversation

RobBuchananCompPhys
Copy link
Collaborator

@RobBuchananCompPhys RobBuchananCompPhys commented Nov 28, 2024

Description of work
TODO:

(Probably don't need to solve all of these immediately - some may become issues for further work after this is completed)

UI

  • Odd crash occurs when returning to TrajectoryFilter job page from another job, error appears to be due to deleted grid layout components in the trajectory filter widget
  • Trajectory filter widget panel inputs move around alot in layout - will change to a grid layout for all input components to improve stability
  • Allow user to visualise the attenuated trajectory power spectrum alongside filter (currently non-enabled "Show attenuation" checkbox)
  • When x-axis is set to energy units, the axis contracts - this should remain the same scale as for frequency units

UI &/or Backend

  • Number of simulation frames post-filtering exceeds original frame count
  • Investigate cause of atoms collapsing to 'ugly blob' when certain filter variants (seems to be highpass and bandpass removing low frequency vibrations) are applied to trajectory

Backend

  • Filter class and filter-variant child classes
  • Write metadata (filter configuration)

Tests

  • Basic unit tests for correct functioning of filter class
  • Full end-to-end test for a more complex molecular dynamics trajectory

Other

  • Ensure sensible default values for filters
  • Complete numpy docstrings for methods
  • Apply black formatting

Fixes
A list of fixes.

To test
Please describe the tests that were run to verify the changes.

@RobBuchananCompPhys RobBuchananCompPhys marked this pull request as ready for review December 16, 2024 10:51
Comment on lines 47 to 89
settings = collections.OrderedDict()
settings["trajectory"] = ("HDFTrajectoryConfigurator", {})
settings["frames"] = (
"CorrelationFramesConfigurator",
{"dependencies": {"trajectory": "trajectory"}},
)
settings["instrument_resolution"] = (
"InstrumentResolutionConfigurator",
{"dependencies": {"trajectory": "trajectory", "frames": "frames"}},
)
settings["projection"] = (
"ProjectionConfigurator",
{"label": "project coordinates"},
)
settings["trajectory_filter"] = (
"TrajectoryFilterConfigurator",
{"dependencies": {"trajectory": "trajectory"}},
)
settings["atom_selection"] = (
"AtomSelectionConfigurator",
{"dependencies": {"trajectory": "trajectory"}},
)
settings["atom_transmutation"] = (
"AtomTransmutationConfigurator",
{
"dependencies": {
"trajectory": "trajectory",
"atom_selection": "atom_selection",
}
},
)
settings["weights"] = (
"WeightsConfigurator",
{
"default": "atomic_weight",
"dependencies": {"atom_selection": "atom_selection"},
},
)
settings["output_files"] = (
"OutputTrajectoryConfigurator",
{"format": "MDTFormat"},
)
settings["running_mode"] = ("RunningModeConfigurator", {})
Copy link
Collaborator

@ChiCheng45 ChiCheng45 Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these settings are not used and/or are not relevant to the filter job. They can be removed, this will clear up the job settings in the actions tab as well.

Comment on lines +100 to +111
def configure(self, value: str):
"""Configure an input value.

Parameters
----------
value : str
The selection setting in a json readable format.
"""
print(f"Configuring {value}")
self.settings = value
self["value"] = self.settings

Copy link
Collaborator

@ChiCheng45 ChiCheng45 Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update this so that it includes some error checking? See any of the other configurators e.g. the FloatConfigurator. This is so that invalid settings are not inputted, this will also provide a warning to the user in the GUI. Also, please use the MDANSE logger instead of printing.

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.

3 participants