Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The rules for this file:
<!-- Changes in existing functionality -->

- Switch to micromamba in CI (PR #88)
- Default physical property is now 'position' for ACF widget (PR #89)

### Deprecated

Expand Down
14 changes: 7 additions & 7 deletions mdadash/backend/analyses/acf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -155,8 +155,8 @@ class ACFAnalysis(WidgetBase):
"description": "Physical property to analyze",
"type": "select",
"items": [
"velocity",
"position",
"velocity",
"force",
],
},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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]
Expand Down
Binary file removed mdadash/backend/tests/data/adk_oplsaa.trr
Binary file not shown.
50 changes: 18 additions & 32 deletions mdadash/backend/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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),
Expand All @@ -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"),
]
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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),
]
Expand Down Expand Up @@ -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"]
Expand Down
Loading