diff --git a/CHANGELOG.md b/CHANGELOG.md index 2df62c2..c6c6635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ The rules for this file: - Switch to micromamba in CI (PR #88) +- Default physical property is now 'position' for ACF widget (PR #89) ### Deprecated diff --git a/mdadash/backend/analyses/acf.py b/mdadash/backend/analyses/acf.py index 525312b..b88e379 100644 --- a/mdadash/backend/analyses/acf.py +++ b/mdadash/backend/analyses/acf.py @@ -27,8 +27,8 @@ class ACFAnalysis(WidgetBase): The following physical properties are supported: - * velocity * position + * velocity * force A custom :class:`SlidingWindowACF` is used to calculate autocorrelation of chosen @@ -48,8 +48,8 @@ class ACFAnalysis(WidgetBase): Default: ``serial`` Physical property - The physical property to analyze - `velocity`, `position` or `force` - Default: ``velocity`` + The physical property to analyze - `position`, `velocity` or `force` + Default: ``position`` Selection The MDAnalysis selection phrase to run this analysis on @@ -155,8 +155,8 @@ class ACFAnalysis(WidgetBase): "description": "Physical property to analyze", "type": "select", "items": [ - "velocity", "position", + "velocity", "force", ], }, @@ -229,7 +229,7 @@ class ACFAnalysis(WidgetBase): def __init__(self): super().__init__() self.acf = None - self.physical_property = "velocity" + self.physical_property = "position" self.selection = "all" self.dim_type = "xyz" self.centered = False @@ -382,7 +382,7 @@ class SlidingWindowACF: def __init__( self, u: mda.Universe, - physical_property: str = "velocity", + physical_property: str = "position", select: str = "all", dim_type: str = "xyz", centered: bool = False, @@ -391,8 +391,8 @@ def __init__( ): self.u = u property_map = { - "velocity": "velocities", "position": "positions", + "velocity": "velocities", "force": "forces", } self.physical_property = property_map[physical_property] diff --git a/mdadash/backend/tests/data/adk_oplsaa.trr b/mdadash/backend/tests/data/adk_oplsaa.trr deleted file mode 100644 index bde5942..0000000 Binary files a/mdadash/backend/tests/data/adk_oplsaa.trr and /dev/null differ diff --git a/mdadash/backend/tests/test_server.py b/mdadash/backend/tests/test_server.py index 7157fda..4610c6f 100644 --- a/mdadash/backend/tests/test_server.py +++ b/mdadash/backend/tests/test_server.py @@ -13,7 +13,7 @@ from mdadash.backend.kernel.core import BufferedTrajectory from mdadash.backend.main import MDADash, app, sio, start_server from mdadash.backend.state.manager import StateManager -from mdadash.backend.tests.data.files import TPR, TRR, XTC +from mdadash.backend.tests.data.files import TPR, XTC from mdadash.backend.widgets.base import WidgetBase, WidgetManager from .utils import ( @@ -57,20 +57,6 @@ def imd_server_fixture(): server.cleanup() -@pytest.fixture(name="imd_server_trr") -def imd_server_fixture_trr(): - u = mda.Universe(TPR, TRR) - server = InThreadIMDServer(u.trajectory) - info = create_default_imdsinfo_v3() - info.velocities = True - info.forces = False - info.box = True - server.set_imdsessioninfo(info) - server.handshake_sequence("localhost", first_frame=True) - yield server - server.cleanup() - - def test_start_server_imd_trajectory(mocker): # mock the command line params mocker.patch.object( @@ -109,7 +95,7 @@ def test_start_server_file_trajectory(mocker): "--topology", str(TPR), "--trajectory", - str(TRR), + str(XTC), ], ) mock_uvicorn_run = mocker.patch("uvicorn.run") @@ -1090,11 +1076,11 @@ async def test_widget_run_msd_diffusion_coefficient(_client): await disconnect_from_simulation() -async def test_widget_run_vacf_serial(_client): +async def test_widget_run_acf_serial(_client): uuid = await add_widget("ACF") - await connect_to_file_simulation(TRR, step=1, batch_size=3) + await connect_to_file_simulation(XTC, step=1, batch_size=3) inputs = [ - ("physical_property", "velocity"), + ("physical_property", "position"), ("selection", "resid 1"), ("custom_title", ""), ("show_particle_acfs", True), @@ -1109,11 +1095,11 @@ async def test_widget_run_vacf_serial(_client): await disconnect_from_simulation() -async def test_widget_run_vacf_serial_batch(_client): +async def test_widget_run_acf_serial_batch(_client): uuid = await add_widget("ACF") - await connect_to_file_simulation(TRR, step=1, batch_size=3) + await connect_to_file_simulation(XTC, step=1, batch_size=3) inputs = [ - ("physical_property", "velocity"), + ("physical_property", "position"), ("selection", "resid 1"), ("_run_frequency", "batch"), ] @@ -1124,11 +1110,11 @@ async def test_widget_run_vacf_serial_batch(_client): await disconnect_from_simulation() -async def test_widget_run_vacf_parallel(_client): +async def test_widget_run_acf_parallel(_client): uuid = await add_widget("ACF") - await connect_to_file_simulation(TRR, step=1, batch_size=3) + await connect_to_file_simulation(XTC, step=1, batch_size=3) inputs = [ - ("physical_property", "velocity"), + ("physical_property", "position"), ("selection", "resid 1"), ("show_particle_acfs", True), ("_run_mode", "parallel"), @@ -1140,11 +1126,11 @@ async def test_widget_run_vacf_parallel(_client): await disconnect_from_simulation() -async def test_widget_run_vacf_parallel_batch(_client): +async def test_widget_run_acf_parallel_batch(_client): uuid = await add_widget("ACF") - await connect_to_file_simulation(TRR, step=1, batch_size=3) + await connect_to_file_simulation(XTC, step=1, batch_size=3) inputs = [ - ("physical_property", "velocity"), + ("physical_property", "position"), ("selection", "resid 1"), ("_run_frequency", "batch"), ("_run_mode", "parallel"), @@ -1156,11 +1142,11 @@ async def test_widget_run_vacf_parallel_batch(_client): await disconnect_from_simulation() -async def test_widget_run_vacf_running_integral(_client): +async def test_widget_run_acf_running_integral(_client): uuid = await add_widget("ACF") - await connect_to_file_simulation(TRR, step=1, batch_size=2) + await connect_to_file_simulation(XTC, step=1, batch_size=2) inputs = [ - ("physical_property", "velocity"), + ("physical_property", "position"), ("selection", "resid 1"), ("show_running_integral", True), ] @@ -1483,7 +1469,7 @@ async def test_trajectory_file(_client): main.mdadash.sm.universe_configs[0].update( { "topology": str(TPR), - "trajectory": str(TRR), + "trajectory": str(XTC), } ) handler = sio.handlers["/"]["connect_to_simulations"]