Skip to content

Commit

Permalink
improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ragzouken committed Sep 25, 2024
1 parent 4dbd1ff commit 43026d3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/fundamentals/commands_and_state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion examples/fundamentals/frame.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/fundamentals/servers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -808,7 +808,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -822,9 +822,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.12.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
9 changes: 9 additions & 0 deletions python-libraries/nanover-omni/src/nanover/omni/omni.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,26 @@ def print_basic_info_and_wait(self):

@property
def app_server(self):
"""
The NanoVer application server used by this runner.
"""
return self._app_server

@property
def simulation(self):
"""
The currently selected simulation.
"""
try:
return self.simulations[self._simulation_index]
except IndexError:
return None

@property
def is_paused(self):
"""
Is the currently selected simulation paused?
"""
return self._runner.is_paused if self._runner is not None else None

@property
Expand Down
11 changes: 9 additions & 2 deletions python-libraries/nanover-omni/src/nanover/omni/openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
class OpenMMSimulation:
"""
A wrapper for OpenMM simulations so they can be run inside the OmniRunner.
The following attributes can be configured after construction: :attr:`frame_interval`, :attr:`include_velocities`,
:attr:`include_forces`
"""

@classmethod
Expand Down Expand Up @@ -56,9 +59,13 @@ def __init__(self, name: Optional[str] = None):
self.app_server: Optional[NanoverImdApplication] = None

self.frame_interval = 5
"""Number of simulation steps to advance between frames."""
self.include_velocities = False
"""Include particle velocities in frames."""
self.include_forces = False
self.platform: Optional[str] = None
"""Include particle forces in frames."""
self.platform_name: Optional[str] = None
"""Name of OpenMM platform to use at the time the system is loaded from XML."""

self.imd_force = create_imd_force()
self.simulation: Optional[Simulation] = None
Expand All @@ -78,7 +85,7 @@ def load(self):
with open(self.xml_path) as infile:
self.imd_force = create_imd_force()
self.simulation = serializer.deserialize_simulation(
infile, imd_force=self.imd_force, platform_name=self.platform
infile, imd_force=self.imd_force, platform_name=self.platform_name
)

self.checkpoint = self.simulation.context.createCheckpoint()
Expand Down

0 comments on commit 43026d3

Please sign in to comment.