Skip to content

Commit

Permalink
Merge pull request #106 from Lucky-Armin/dev
Browse files Browse the repository at this point in the history
Chore: Rephrasing of atomic_system.py docstring
  • Loading branch information
97gamjak authored Jun 20, 2024
2 parents 3a8ab27 + 63baa93 commit 70ee673
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
16 changes: 8 additions & 8 deletions PQAnalysis/atomic_system/atomic_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ class AtomicSystem(
Notes
-----
An atomic system does not have to containing any positions,
velocities, forces and so forth. The only requirement is that
An atomic system does not have to contain any positions,
velocities, forces and so on. The only requirement is that
the number of atoms in the topology is equal to the number of
entries in the positions, velocities, forces and charges
arrays. If e.g. only a system containing information of the
velocities is needed, the positions, forces and charges arrays
arrays. For example, if a system containing only information about
the velocities is needed, the positions, forces and charges arrays
can be left empty (i.e. np.zeros((0, 3)) and np.zeros(0)).
The same goes for the other properties. An empty cell can be
created with Cell() and represents a system without periodic
boundary conditions. (For more information see the
documentation of :py:class:`~PQAnalysis.core.cell.cell.Cell`).
As the topology is can be really and complex and most of the
cases really specific to the system, here no further
information is given. (For more information see the
Since, the topology can be really complex and most of the
cases really specific to the system, no further
information is given here. (For more information see the
documentation of :py:class:`~PQAnalysis.topology.topology.Topology`).
Furthermore for this reason if no specialization of the topology
For this reason, if no specialization of the topology
is needed, the atomic system can be initialized with only a list
of atoms (see examples, and the documentation of
:py:class:`~PQAnalysis.core.atom.atom.Atom`).
Expand Down
12 changes: 6 additions & 6 deletions PQAnalysis/core/cell/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ def __str__(self) -> str:
str
A string representation of the Cell.
"""
x = self.x
y = self.y
z = self.z
alpha = self.alpha
beta = self.beta
gamma = self.gamma
x = float(self.x)
y = float(self.y)
z = float(self.z)
alpha = float(self.alpha)
beta = float(self.beta)
gamma = float(self.gamma)

if self != Cell():
return f"Cell({x=}, {y=}, {z=}, {alpha=}, {beta=}, {gamma=})"
Expand Down
4 changes: 3 additions & 1 deletion tests/core/test_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def test_image(self):

def test__str__(self):
cell = Cell(1, 2, 3, 60, 90, 120)
assert str(cell) == "Cell(x=1, y=2, z=3, alpha=60, beta=90, gamma=120)"
assert str(
cell
) == "Cell(x=1.0, y=2.0, z=3.0, alpha=60.0, beta=90.0, gamma=120.0)"
assert str(cell) == repr(cell)

cell = Cell()
Expand Down

0 comments on commit 70ee673

Please sign in to comment.