Skip to content

Commit

Permalink
Merge pull request #7 from chrisiacovella/docs
Browse files Browse the repository at this point in the history
Docs
  • Loading branch information
chrisiacovella authored Mar 22, 2023
2 parents fc5d80e + 19508bb commit d2d4a12
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Usage
Basic usage
------------
To load a HOOMD-blue XML file or GSD file, we need only pass the file path to the constructor.

.. code:: ipython3
import hoomdxml_reader as hxml
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- networkx
- numpydoc
- sphinx_rtd_theme

- gsd

# Pip-only installs
#- pip:
Expand Down
4 changes: 2 additions & 2 deletions hoomdxml_reader/hoomdxml_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def load(self, file=None, frame=0, identify_molecules=True, ignore_zero_bond_ord
if molecule_dict is not None:
self.set_molecule_name_by_dictionary(molecule_dict)

"""
def convert_mdtraj(self, mdtraj=None, frame=0, identify_molecules=True, ignore_zero_bond_order=False):
if mdtraj is None:
raise Exception("mdtraj traj not defined")
Expand All @@ -207,7 +207,7 @@ def convert_mdtraj(self, mdtraj=None, frame=0, identify_molecules=True, ignore_z
self._calc_bond_order()
if self._identify_molecules == True:
self._infer_molecules()

"""
# generic function to parse the topology entries,
# takes the element as an argument and number of entries per line
def _parse_topology(self, element, length):
Expand Down
15 changes: 15 additions & 0 deletions hoomdxml_reader/tests/test_hoomdxml_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ def test_loader_gsd():
assert len(system.unique_molecules) == 1
assert 'AABB' in system.unique_molecules

system._clear()
assert len(system.box) == 0
assert system.n_particles == 0
assert len(system.xyz) == 0
assert len(system.masses) == 0
assert len(system.charges) == 0
assert len(system.bonds) == 0
assert len(system.angles) == 0
assert len(system.dihedrals) == 0
assert len(system.impropers) == 0
assert len(system.bond_order) == 0
assert len(system.molecules) == 0
assert len(system.unique_molecules) == 0
assert system._filename == None

def test_loader_xml_basic():
cwd = os.getcwd()
system = hxml.System(cwd + "/hoomdxml_reader/tests/example.hoomdxml")
Expand Down

0 comments on commit d2d4a12

Please sign in to comment.